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

Function module to get table fields list

Former Member
0 Likes
15,040

Hi there dear ABAP'ers.

1. I would like to ask do you know some function module that I pass a table name to and it would return this table fields list?

2. Is there some possibility to get not only table fields list, but their types as well?

What I want to do is that I want to get ADRC table fields list and put this fields list into searchhelp later.

I will be thankful for some suggestions.

Regards,

P.

1 ACCEPTED SOLUTION
Read only

Former Member
5,036

Hi,

You can use the FM below.

  • Calling FM to get the dictionary field attributes

CALL FUNCTION 'DDIF_FIELDINFO_GET'
    EXPORTING
      tabname        = rv_table (Your table name)
    TABLES
      dfies_tab      = lt_fields
    EXCEPTIONS
      not_found      = 1
      internal_error = 2
      OTHERS         = 3.

  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

This will give all the field attributes as well.

Regards,

Ganga

2 REPLIES 2
Read only

Former Member
5,037

Hi,

You can use the FM below.

  • Calling FM to get the dictionary field attributes

CALL FUNCTION 'DDIF_FIELDINFO_GET'
    EXPORTING
      tabname        = rv_table (Your table name)
    TABLES
      dfies_tab      = lt_fields
    EXCEPTIONS
      not_found      = 1
      internal_error = 2
      OTHERS         = 3.

  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

This will give all the field attributes as well.

Regards,

Ganga

Read only

GauthamV
Active Contributor
0 Likes
5,036

Plz SEARCH in SCN before posting, it is already discussed here lot of times.