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

how to get the fields of an internal table?

Hi experts!

Is there a standard function module that gets the fieldname, length, and data type of an internal table?

I was trying to use display_internal_tables but it's not working.

Thanks!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Oct 17, 2006 at 05:39 AM

    hi try this,

    1. can I get the field-name of that column

    2. using FM

    GET_COMPONENT_LIST'

    3.

    DATA : components LIKE rstrucinfo OCCURS 0 WITH HEADER LINE.

    *----


    Get component list

    CALL FUNCTION 'GET_COMPONENT_LIST'

    EXPORTING

    program = sy-repid

    fieldname = 'ITAB'

    TABLES

    components = components.

    rgds

    anver

    if hlped pls mark points

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 17, 2006 at 05:42 AM

    HI,

    Declare a work area in the top include and you can create the internal table based on that in your subroutine..

    Call the GET_COMPONENT_LIST with the Work area name..It will get you the components...

    EX:

    DATA: BEGIN OF WA,

    VBELN LIKE VBAK-VBELN,

    POSNR LIKE VBAP-POSNR,

    END OF WA.

    REPORT YRT_TEST1 line-size 500.

    data:

    Fields type i,

    begin of fieldlist occurs 0,

    no like RSTRUCINFO,

    end of fieldlist,

    begin of itab occurs 0,

    f1 TYPE C,

    f2,

    f3,

    end of itab.

    CALL FUNCTION 'GET_COMPONENT_LIST'

    EXPORTING

    program = 'YRT_TEST1'

    fieldname = 'ITAB'

    tables

    components = fieldlist

    .

    describe table fieldlist lines fields.

    write:/ fields.

    Regards,

    Laxmi.

    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.