‎2007 Jan 26 1:48 PM
Hi friends,
I have 2 internal tables.
<b>ITAB1</b>(with 2 fields) containing 5 records.
<b>ITAB2</b>(with 3 fields) containing 10 records.
How can we print these fields side by side in an <b>SINGLE OUTPUT</b>.
What is the logic behind it.
Pl help me out.
‎2007 Jan 29 6:35 AM
loop at itab1 .
write:/ itab1-field
read table itab2 with key field = itab1-field .
write itab2-field
endloop .
Raja
‎2007 Jan 29 6:59 AM
hi,
if you want to use an ALV make a new internal table with all the 5 fields,populate the table and use the sort functionality of ALV on the desired columns.
Regards,
Sourabh
‎2007 Jan 29 7:35 AM
Hi,
IF NOT itab1 IS INITIAL.
LOOP AT itab1.
write:/ 1 itab1-f1,
11 itab1-f2.
READ TABLE itab2 WITH KEY f3 = itab1-f1.
(some key fields should be here)
IF sy-subrc = 0.
write:/ 16 itab2-f3,
20 itab2-f4,
28 itab2-f5.
ENDIF.
ENDLOOP.
ENDIF.Otherwise
IF NOT itab1 IS INITIAL.
LOOP AT itab1.
LOOP AT itab2.
write:/ 1 itab1-f1,
11 itab1-f2.
16 itab2-f3,
20 itab2-f4,
28 itab2-f5.
ENDLOOP.
ENDLOOP.
ENDIF.Hope this may help you.