Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

internal table

Former Member
0 Likes
521

Dear all,

1) i have one iternal table now i want it should be header line of another internal table

how it possible?

2) in second case i want my data in horizental wise ,or row wise, insted of colulmn wise. e.g. A

B

C

D

but i wann like below

A B C D.

Thanks ,

*******************Point is assured ***************

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
502

try like this.

loop at itab1.

if sy-tabix = 1.

wa2-field1 = itab1-field.

endif

if sy-tabix = 2.

wa2-field2 = itab1-field.

endif

if sy-tabix = 3.

wa2-field3 = itab1-field.

endif

if sy-tabix = 4.

wa2-field4 = itab1-field.

endif

endloop.

append wa2 to itab2.

hope it will help. If you want anymore clarifications, feel free to get back to me.

5 REPLIES 5
Read only

Former Member
0 Likes
502

Hi,

Declare your internal tablw with header line.

In your second case.

Loop at itab.

concatenate itab-field1 itab-field2 itab-field3 into itab2 separated by space.

append itab2.

clear itab2.

endloop.

Thanks,

Sri.

Read only

Former Member
0 Likes
502

1. table1 and table2 should have the same structure.


loop at table1 into table2.
....
endloop.

or move-corresponding table1 to table2..

2. Read Rich's blog about Dynamic Internal Table

/people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap

This should solve your problem.

Read only

Former Member
0 Likes
503

try like this.

loop at itab1.

if sy-tabix = 1.

wa2-field1 = itab1-field.

endif

if sy-tabix = 2.

wa2-field2 = itab1-field.

endif

if sy-tabix = 3.

wa2-field3 = itab1-field.

endif

if sy-tabix = 4.

wa2-field4 = itab1-field.

endif

endloop.

append wa2 to itab2.

hope it will help. If you want anymore clarifications, feel free to get back to me.

Read only

Former Member
0 Likes
502

Hi,

Do like this.

Data:

begin of itab1 occurs 0,

f1(10) type c,

f2(10) type c,

end of itab1.

data:

itab2 like itab1 occurs 0 with header line,

itab3 like itab1 occurs 0 with header line.

  • Let itab1 have some data

*U can split into horizontal as:

loop at itab1.

<b>split itab1 into itab2.</b>

append itab2 to itab3.

clear itab2.

clear itab1.

endloop.

Regards,

Rama chary.Pammi

Read only

Former Member
0 Likes
502

Thanks to All,

Point has been given