cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

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

post whatever coding you have done

thanks

surjit

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

former_member208581
Participant
0 Kudos

Additionally remark:

You should not use header lines any longer. It's not the best of programming. Use a seperat structure instead.