‎2006 Dec 22 8:37 AM
Hi ,
I have one problem in report.
I have X table having fields f1, f2...............f10.
data: lt_tab "internal table
ls_tab "WA
for field f1 i got multiple entries in lt_fun by function module.
Now i have condition like
ls_tab-f2 = .....
ls_tab-f3 = ......
append ls_tab to lt_tab.
calling FM
by passing f1 i got multiple entries in lt_fun.
*suppose lt_fun having 2 records.
loop at lt_fun from ls_fun .
lv_tabix = sy-tabix.
gs_tab-f4 = ls_fun-f4.
gs_tab-f5 = ls_fun-f5.
modify lt_tab from ls_tab index lv_tabix transporting f3 f4.
endloop.
Is the above mentioned logic is fine.?
I am assuming output like
X
f1 f2 f3 f4 f5
1 a a1 a2 a3
b2 b3
c3 c3
Pls let me know asap.
‎2006 Dec 22 8:45 AM
Hi NEHA ,
Logic is fine .
But my question is for f1 if you get two entries in table lt_fun .then how do you decide that it will in field F4 and f5 .
‎2006 Dec 22 8:51 AM
No dinesh it is not looking like what i wanted to write.
Actually
X
f1 f2 f3 f4 f5
1 a1 a1 a2 a3
b2 b3
‎2006 Dec 22 8:55 AM
OK, ket me see if this is what you wanted.
loop at itab into wa.
loop at lt_fun into ls_fun where f2 = wa-f2.
move-correspoding wa to ls_final.
ls_final-f2 = ls_fun-f2.
ls_final-f3 = ls_fun-f3.
append ls_final to lt_final.
clear ls_final.
endloop.
endloop.
lt_final will have the final internal table.
Regards,
ravi
‎2006 Dec 22 9:01 AM
Hi,
I am assiuming the output is like this. Due to some setting problem it was changed.
X
f1 f2 f3 f4 f5
1 a a1 a2 a3
o o o b2 b3
o o o c2 c3
Pls assume that o means no value.
‎2006 Dec 22 8:53 AM