Skip to Content

RTTS question

Hi,

Given any internal table i was wondering if i could get the refernce type of its components?

So far i could only get the internal types and lengths. I want to get the Data Dictionary references so i can dynamically assign column titles in creating my ALV field catalog.

Is this possible? My other option is to use a dynamic internal table managed by a type manager class but thats too tedious and using the dynamic internal table is a bit awkward.

thanks in advance!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2006 at 12:07 PM

    Hi emir,

    1. we can get the field list using

    the FM GET_COMPONENT_LIST

    2. just copy paste

    3.

    REPORT abc.

    *----


    DATA : BEGIN OF itab OCCURS 0,

    lifnr LIKE lfa1-lifnr,

    land1 LIKE lfa1-land1,

    name1 LIKE lfa1-name1,

    name2 LIKE lfa1-name2,

    END OF itab.

    DATA : allfields(300) TYPE c.

    DATA : fld(100) TYPE c.

    DATA : components LIKE rstrucinfo OCCURS 0 WITH HEADER LINE.

    *----


    CALL FUNCTION 'GET_COMPONENT_LIST'

    EXPORTING

    program = sy-repid

    fieldname = 'ITAB'

    TABLES

    components = components.

    BREAK-POINT.

    LOOP AT components.

    CONCATENATE 'LFA1~' components-compname '' INTO fld.

    CONCATENATE allfields fld INTO allfields SEPARATED BY space.

    ENDLOOP.

    *----


    SELECT (allfields)

    FROM lfa1

    INTO TABLE itab.

    *----


    BREAK-POINT.

    regards,

    amit m.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Emir Cruz

      Hi again,

      1. From ITAB-LIFNR,

      u want LFA1-LIFNR,

      2. If your purpose of getting this,

      is for getting the FIELD DESCRIPTION,

      then the FM for ALV FIELD CATALOGUE MERGE,

      will automaticlly do it.

      3. However,

      we can get some TABLE-LIFNR

      from DD03L table,

      where we can pass the field name as LIFNR,

      and we get all records,

      (ie. all tables/structures)

      which use this field.

      regards,

      amit m.

  • Posted on Jun 16, 2006 at 12:22 PM

    repost deleted.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2006 at 12:27 PM

    Hi again,

    1. From ITAB-LIFNR,

    u want LFA1-LIFNR,

    2. If your purpose of getting this,

    is for getting the FIELD DESCRIPTION,

    then the FM for ALV FIELD CATALOGUE MERGE,

    will automaticlly do it.

    3. However,

    we can get some TABLE-LIFNR

    from DD03L table,

    where we can pass the field name as LIFNR,

    and we get all records,

    (ie. all tables/structures)

    which use this field.

    regards,

    amit m.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 16, 2006 at 01:06 PM

    hi. cool stuff but it still doesnt fit my requirement.

    ie.

    DATA: BEGIN OF itab,

    document LIKE bkpf-belnr,

    gjahr LIKE bkpf-gjahr,

    budat LIKE bkpf-budat,

    line_item LIKE bseg-buzei,

    END OF itab.

    notice that my internal table could be anything. It is not defined by a specific DDIC structure or table. The components, however, are ALWAYS defined by a table-field.

    Basically, I am trying NOT to hardcode the descriptions of my field catalog.

    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.