Skip to Content
author's profile photo
Former Member

How do I put information from Structure into an internal table?!

How do I put information from a Structure which I have created into an internal table?

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

5 Answers

  • author's profile photo
    Former Member
    Sep 29, 2005 at 02:20 PM

    hi,

    data : itab1 like mara occurs 0 with header line.

    data : struc_x type mara . ( structure )

    move-corresponding struc_x to itab1.

    append itab1.

    or

    itab1 = struc_x.

    append itab1.

    cheers,

    sasi

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Sep 29, 2005 at 03:25 PM

    TYPES:

    BEGIN OF TY_MARA.

    INCLUDE STRUCTURE MARA.

    TYPES:

    END OF TY_MARA.

    DATA:

    ITAB TYPE STANDARD TABLE OF TY_MARA.

    ITAB_H LIKE LINE OF ITAB.

    MOVE-CORRESPONDING ITAB_H TO ITAB.

    APPEND ITAB.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Sep 29, 2005 at 03:35 PM

    Data: Begin of Itab1 occurs 0,

    daily_hours type i,

    End of Itab1.

    Data: Begin of Itab2 occurs 0,

    weekly_hours type i,

    w_itab1 TYPE Itab1,

    End of Itab2.

    loop at Itab2.

    Itab2-w_itab1-daily_hours = " Value".

    endloop.

    I am not Sure about it.

    Just give a try.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Sep 30, 2005 at 04:34 AM

    The following code is working. So you can use the same logic for your's.

    Data: Begin of Itab1,

    name1(10) type c,

    name2(10) type c,

    End of Itab1.

    Data: Begin of Itab2 occurs 0,

    name3(10) type c,

    name4(10) type c,

    w_ITAB1 LIKE Itab1,

    End of Itab2.

    Itab2-name3 = 'Baburaj'.

    Itab2-name4 = 'GSK'.

    Itab2-w_Itab1-name1 = 'Cheran'.

    Itab2-w_Itab1-name2 = 'Srinivasan'.

    Append Itab2.

    loop at Itab2.

    Write: / Itab2-name3,

    30 Itab2-name4,

    40 Itab2-w_Itab1-name1,

    50 Itab2-w_Itab1-name2.

    Endloop.

    If you are satisfied with the answer, give the reward points.

    Regards,

    Baburaj

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Sep 30, 2005 at 04:45 AM

    above ans are very helpful, did you got ans if not

    post whatever coding you have done

    thanks

    surjit

    Add comment
    10|10000 characters needed characters exceeded