Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Store fieldname in internal table

Hi,

How do you store the internal table fieldnames in a internal table of filedname type?

Ex: My table add 3 fields of name field_1, field_2 et field_3. My another table would be 3 records in the fieldname field : field_1, field_2 et field_3.

Thanks.

Tags:
Former Member
Former Member replied

You can check this example..

using the function you can get the fields present in the internal table. in the components table parameter you can see the Fieldnames.

REPORT  zztest_fieldname.

DATA: components TYPE TABLE OF rstrucinfo.

DATA: BEGIN OF it_field OCCURS 0,
       filed1(30),
       field2(30),
       field3(30),
      END OF it_field.

CALL FUNCTION 'GET_COMPONENT_LIST'
  EXPORTING
    program    = sy-repid
    fieldname  = 'IT_FIELD'
  TABLES
    components = components.

break-point.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question