Arvin.Yang
Arvin.Yang

Reputation: 49

How to get SAP DDIC table structure in C#?

I'm writing some codes about extract table's structure from SAP using C#, and I've got a question about RFC_READ_TABLE, when I define a table's name and the FIELDS table returned 5 columns, like : FIELDNAME, OFFSET, LENGTH, T and FIELDTEXT, actually I couldn't know what's the decimal places of a numeric field according to these 5 columns, is there any other way to get this? Please be noted that my SAP account is a public one because other peoples are also using it, I'm not supposed to create new function module in SAP.

Below info was what I got from FIELDS table of module RFC_READ_TABLE:

MANDT   | 000000   | 000003   | C   | Client**: length * 3**
BUKRS   | 000003   | 000004   | C   | Company Code: **length * 3**
ANLN1   | 000007   | 000012   | C   | Main Asset Number: **length * 3**
ANLN2   | 000019   | 000004   | C   | Asset Subnumber: **length * 3**
GJAHR   | 000023   | 000004   | N   | Fiscal Year: **numeric(4,0)**
LNRAN   | 000027   | 000005   | N   | Sequence Number of Asset Line Items in Fiscal Year: **numeric(5,0)**
AFABE   | 000032   | 000002   | N   | Real depreciation area: **numeric(2,0)**
ZUJHR   | 000034   | 000004   | N   | Asset acquisition year (currently not used): **numeric(4,0)**
ZUCOD   | 000038   | 000004   | N   | Sub-classification of asset acquisitions(currently not used): **numeric(4,0)**
AUFWV   | 000042   | 000013   | P   | Proportional cumulative revaluation on replacement value: **numeric(13,??=2)** 

The datatype of this field is numeric(13,2) according to DB, but how can I get this clue? thanks in advance!

Upvotes: 1

Views: 1544

Answers (1)

mkysoft
mkysoft

Reputation: 5758

RFC_READ_TABLE FM returns only summary of field. You can use DDIF_FIELDINFO_GET FM for details.

Upvotes: 3

Related Questions