Skip to Content
author's profile photo Former Member
Former Member

How to get all the tables and table fields in SAP

Hi All,

I want to get all table fields of all tables which are configured and have data in them,

I tried using DD03L but I am also getting a lot of structures and structure fields. What I would want is all the table fields of table which have data in SAP ISU.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Jun 22, 2016 at 12:40 PM

    Hi,

    to get all the fields that may have data, you can use an ABAP code like

    REPORT z_list_table_fields.

    TYPES: BEGIN OF t_field,

    tabname TYPE dd02l-tabname,

    position TYPE dd03l-position,

    fieldname TYPE dd03l-fieldname,

    END OF t_field.

    DATA: gv_table TYPE dd02l-tabname.

    DATA: gt_fields TYPE SORTED TABLE OF t_field

    WITH UNIQUE KEY tabname position.

    FIELD-SYMBOLS: <gwa_fields> TYPE t_field.

    SELECT-OPTIONS: so_table FOR gv_table DEFAULT 'VBA+' OPTION CP SIGN I.

    START-OF-SELECTION.

    SELECT dd02l~tabname dd03l~position dd03l~fieldname

    FROM dd02l

    INNER JOIN dd03l

    ON dd03l~tabname = dd02l~tabname

    AND dd03l~as4local = dd02l~as4local

    AND dd03l~as4vers = dd02l~as4vers

    INTO CORRESPONDING FIELDS OF TABLE gt_fields

    WHERE dd02l~tabname IN so_table

    AND dd02l~as4local EQ 'A'

    AND dd02l~as4vers EQ '0000'

    AND dd02l~tabclass IN ( 'TRANSP', 'POOL', 'CLUSTER' )

    AND dd03l~precfield EQ space. "filled for append and include structure names

    LOOP AT gt_fields

    ASSIGNING <gwa_fields>.

    WRITE: /1 <gwa_fields>-tabname,

    <gwa_fields>-fieldname.

    AT END OF tabname.

    ULINE.

    ENDAT.

    ENDLOOP.

    If you want to have only tables listed, that are not empty, you can enhance this code with a SELECT on the table. You can enhance this code on field content, too, but this may become very slow.

    Regards,

    Klaus

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 23, 2016 at 12:45 PM

    Hi Jowin,

    Try with FM - SACC_DDIC_INFO_READ.

    Regards,

    Siddharth Shah

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.