Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

fetch field names & Description for Table

Former Member
0 Likes
829

Hi,

My requirement is if i enter the Table name i have to get all the field names and description .Please tell me how to do.

Thanks,

Mohan

1 ACCEPTED SOLUTION
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
695

Try this :

SELECT * FROM dd03l

INTO TABLE tab_fields

WHERE

tabname = i_tabname .

4 REPLIES 4
Read only

former_member229729
Active Participant
0 Likes
695

Hi,

TABLES: DFIES,
        X030L.

DATA: BEGIN OF INTTAB OCCURS 100.
        INCLUDE STRUCTURE DFIES.
DATA: END OF INTTAB.

PARAMETERS: TABLENM TYPE DDOBJNAME       DEFAULT 'MSEG',
            FIELDNM TYPE DFIES-FIELDNAME DEFAULT 'MENGE'.

      call function 'DDIF_FIELDINFO_GET'
        exporting
          tabname              = TABLENM
          FIELDNAME            = FIELDNM
          LANGU                = SY-LANGU
*         LFIELDNAME           = ' '
*         ALL_TYPES            = ' '
*       IMPORTING
*         X030L_WA             = WATAB
*         DDOBJTYPE            =
*         DFIES_WA             =
*         LINES_DESCR          =
        TABLES
          DFIES_TAB            = INTTAB
*         FIXED_VALUES         =
        EXCEPTIONS
          NOT_FOUND            = 1
          INTERNAL_ERROR       = 2
          OTHERS               = 3.

      if sy-subrc <> 0.
         WRITE:/ 'Field name not found'.
      endif.

      LOOP AT INTTAB.
         WRITE:/ INTTAB-TABNAME, INTTAB-FIELDNAME, INTTAB-FIELDTEXT.
      ENDLOOP.

Thanks and regards,

Ramani N

Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
696

Try this :

SELECT * FROM dd03l

INTO TABLE tab_fields

WHERE

tabname = i_tabname .

Read only

Former Member
0 Likes
695

Hi,

Try this fm CATSXT_GET_DDIC_FIELDINFO

Regards

Debarshi

Read only

0 Likes
695

thanks..!! u solved my problem....