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

How can we read data from dynamic internal table?

Hi All,

I have a problem to read data from dynamic internal table.

My code is..

FIELD-SYMBOLS:<t_dyntable> TYPE STANDARD TABLE, "Dynamic internal table name

<fs_dyntable>. " work area

fld_name = 'EAN11'.

READ TABLE <t_dyntable> INTO <fs_dyntable> WITH KEY (fld_name) = ean_no.

IF sy-subrc = 0. " Perfect till now

Now i want the value of filed EAN11 and MATNR which is already assigned.

Variable1 = <fs_dyntable>-????? " have error (want EAN11 Value)

Variable2 = <fs_dyntable>-????? " have error (want MATNR Value)

endif.


Thanks & Regards,

Mital

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Dec 16, 2014 at 10:44 AM

    Hi, Mital!

    You can try smth like that

    ASSIGN COMPONENT 'EAN11' OF STRUCTURE <fs_dyntable> TO <lv_ean11>.
    IF sy-subrc = 0.
    Variable1 = <lv_ean11>.
    ENDIF.
    ASSIGN COMPONENT 'MATNR' OF STRUCTURE <fs_dyntable> TO <lv_matnr>.
    IF sy-subrc = 0.
    Variable2 = <lv_matnr>.
    ENDIF.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 16, 2014 at 10:38 AM

    Pls reply. its very urgent to me..

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 16, 2014 at 10:57 AM

    Hi, Please find to create the dynamic table,

    FIELD-SYMBOLS: <GIT> TYPE STANDARD TABLE,

    <GFL> TYPE ANY,

    <VAL> type ANY.

    data: GIT_FLDS TYPE LVC_T_FCAT,

    GIT TYPE REF TO DATA,

    CALL METHOD

    CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE

    EXPORTING

    IT_FIELDCATALOG = GIT_FLDS

    IMPORTING

    EP_TABLE = GIT.

    IF IS ASSIGNED.

    UNASSIGN .

    ENDIF.

    ASSIGN GIT->* TO <GIT>.

    CREATE DATA GFL LIKE LINE OF .

    IF IS ASSIGNED.

    UNASSIGN .

    ENDIF.

    ASSIGN GFL->* TO <GFL>.

    and to read or update the information in dynamic table,

    ASSIGN COMPONENT GFL_FLDS-FIELDNAME OF STRUCTURE <GFL> TO <VAL>.

    Regards.

    Praveer.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 16, 2014 at 11:04 AM

    Hi Mital,

    Please refer this link

    http://scn.sap.com/docs/DOC-53788

    With Regards

    Arun VS

    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.