‎2006 Jun 16 7:26 AM
Hi pals,
How to write internal table records vertically .
suppose the records are
a1 a2 a3
b1 b2 b3
we need to display
a1 b1
a2 b2
a3 b3
Thanks in advance.
balaji.T
‎2006 Jun 16 7:38 AM
You have to write a small program.
LOOP AT int_horizontal.
AT NEW row.
loc_cnt = 1.
ENDAT.
CASE loc_cnt.
WHEN 1.
int_vertical-a1 = int_horizontal- value.
WHEN 2.
int_vertical-a2= int_horizontal- value.
WHEN 3.
int_vertical-a3_size = int_horizontal-value.
.
.
.
.
ENDCASE.
loc_cnt = loc_cnt + 1.
AT END OF row .
APPEND int_vertical.
CLEAR int_vertical.
ENDAT.
ENDLOOP.
You will have to know the number of columns of your horizontal table.
Regards,
Subhasish
‎2006 Jun 16 7:41 AM
‎2006 Jun 16 7:50 AM
Just check the code
DATA: BEGIN OF itab OCCURS 0,
f1 TYPE i,
f2 TYPE i,
f3 TYPE i,
END OF itab.
DATA pos TYPE i.
"Define your lines where you want to print here...
DATA line1 TYPE i VALUE 10.
DATA line2 TYPE i VALUE 12.
DATA line3 TYPE i VALUE 14.
itab-f1 = '1'.
itab-f2 = '10'.
itab-f3 = '100'.
APPEND itab.
itab-f1 = '2'.
itab-f2 = '20'.
itab-f3 = '200'.
APPEND itab.
itab-f1 = '3'.
itab-f2 = '30'.
itab-f3 = '300'.
APPEND itab.
itab-f1 = '4'.
itab-f2 = '40'.
itab-f3 = '400'.
APPEND itab.
loop at itab.
write : / itab-f1,itab-f2,itab-f3.
endloop.
LOOP AT itab.
pos = pos + 10.
SKIP TO LINE line1.
POSITION pos.
WRITE itab-f1.
SKIP TO LINE line2.
POSITION pos.
WRITE itab-f2.
SKIP TO LINE line3.
POSITION pos.
WRITE itab-f3.
ENDLOOP.