02-14-2006 2:57 PM
Hi,
I am trying to read the field description of an internal table, which consists of fields from different DD tables. I am able to read the descriptions of a DD table by using FM 'DDIF_FIELDINFO_GET'.
Can you please suggest me how can read the text descriptions of an internal table fields in a Language other than English.
Thanks
Lokman
02-14-2006 3:09 PM
try that:
TYPES: BEGIN OF my_struct,
bukrs TYPE bkpf-bukrs,
belnr TYPE bkpf-belnr,
gjahr TYPE bkpf-gjahr,
blart TYPE bkpf-blart,
bldat TYPE bkpf-bldat,
END OF my_struct.
DATA header TYPE string.
DATA: itab TYPE my_struct,
descr_ref TYPE REF TO cl_abap_structdescr.
SELECT-OPTIONS s_werks FOR t001w-werks.
FIELD-SYMBOLS:
<comp_wa> TYPE abap_compdescr.
DATA wk TYPE t001w-werks VALUE '30++'.
PARAMETERS datei LIKE rlgrap-filename DEFAULT 'c:temptest01'.
DATA fname TYPE dd03l-fieldname.
AT SELECTION-SCREEN ON s_werks.
IF wk IN s_werks.
* MESSAGE e000(01) WITH 'false werks'.
ENDIF.
START-OF-SELECTION.
header = 'ITAB-'.
descr_ref ?= cl_abap_typedescr=>describe_by_data( itab ).
LOOP AT descr_ref->components ASSIGNING <comp_wa>.
CONCATENATE 'ITAB-' <comp_wa>-name INTO fname.
WRITE: / fname.
ENDLOOP.
or use fm REUSE_ALV_FIELDCATALOG_MERGE
Andreas
Message was edited by: Andreas Mann
02-14-2006 2:59 PM
02-14-2006 3:03 PM
Sample .
report zrich_0003 .
data: lang type sy-langu.
data: fields type table of dfies with header line.
lang = 'DE'.
call function 'DDIF_FIELDINFO_GET'
exporting
tabname = 'MARA'
langu = lang
tables
dfies_tab = fields
exceptions
not_found = 1
internal_error = 2
others = 3.
loop at fields.
write:/ fields-tabname, fields-fieldname, fields-fieldtext.
endloop.
Regards,
Rich Heilman
02-14-2006 3:06 PM
Here is my code. I am trying to use imternal table instead of DD table. If I use internal table I get short dump. The language is OK withh DD table.
CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING
TABNAME = 'ZFISB_TRANSFERS'
TABNAME = trsf_sel_tab
LANGU = SY-LANGU
TABLES
DFIES_TAB = trsf_field_tab.
*delete trsf_field_tab where fieldname <> 'NR' OR FIELDNAME <> 'TDATE'
*OR
FIELDNAME <> 'FYEAR'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'NR'
value_org = 'S'
callback_program = 'ZFI_SCHOOL_BANKING_APP'
callback_form = 'TRANSFERS_F4CALLBACK'
TABLES
field_tab = trsf_field_tab
value_tab = trsf_sel_tab
return_tab = return_tab
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
02-14-2006 3:01 PM
Hi Lokman,
Internal tables are temporary table generated during the execution of the program.So,you cant really know the field description,whether its English or any other language.
02-14-2006 3:04 PM
hi you can just login to sap using some other language other than english
02-14-2006 3:09 PM
try that:
TYPES: BEGIN OF my_struct,
bukrs TYPE bkpf-bukrs,
belnr TYPE bkpf-belnr,
gjahr TYPE bkpf-gjahr,
blart TYPE bkpf-blart,
bldat TYPE bkpf-bldat,
END OF my_struct.
DATA header TYPE string.
DATA: itab TYPE my_struct,
descr_ref TYPE REF TO cl_abap_structdescr.
SELECT-OPTIONS s_werks FOR t001w-werks.
FIELD-SYMBOLS:
<comp_wa> TYPE abap_compdescr.
DATA wk TYPE t001w-werks VALUE '30++'.
PARAMETERS datei LIKE rlgrap-filename DEFAULT 'c:temptest01'.
DATA fname TYPE dd03l-fieldname.
AT SELECTION-SCREEN ON s_werks.
IF wk IN s_werks.
* MESSAGE e000(01) WITH 'false werks'.
ENDIF.
START-OF-SELECTION.
header = 'ITAB-'.
descr_ref ?= cl_abap_typedescr=>describe_by_data( itab ).
LOOP AT descr_ref->components ASSIGNING <comp_wa>.
CONCATENATE 'ITAB-' <comp_wa>-name INTO fname.
WRITE: / fname.
ENDLOOP.
or use fm REUSE_ALV_FIELDCATALOG_MERGE
Andreas
Message was edited by: Andreas Mann
02-14-2006 3:14 PM
just try to use body of the internal table "DFIES_TAB = trsf_field_tab[]" instead of
"DFIES_TAB = trsf_field_tab".......this may workout
but iam not sure
02-14-2006 3:23 PM