‎2007 Dec 06 7:08 AM
hi,
i have a following scenario
table1
mstat
1
2
3
4
5
6
7
table 2
matno vno pno mstat quan
m001 v001 p001 1 1
but for this particular record i want show other status also which are in table 1 how to do that
table 3 should be in this way
matno vno pno mstat quan
m001 v001 p001 1 1
m001 v001 p001 2 0
m001 v001 p001 3 0
m001 v001 p001 4 0
m001 v001 p001 5 0
m001 v001 p001 6 0
m001 v001 p001 7 0
can any one tell me how to do that
‎2007 Dec 06 7:13 AM
Hi Venkat,
Declare a 3rd internal table with all the fields .
Loop at 1st internal table.
read 2nd internal table with key mstat = it1-mstat.
if sy-subrc eq 0.
it3-quan = it2-quan.
else.
it3-quan = 0.
endif.
append it3 to it3_tab.
endloop.
*reward if this helps
regards,
Sandeep
‎2007 Dec 06 7:13 AM
Hi Venkat,
Declare a 3rd internal table with all the fields .
Loop at 1st internal table.
read 2nd internal table with key mstat = it1-mstat.
if sy-subrc eq 0.
it3-quan = it2-quan.
else.
it3-quan = 0.
endif.
append it3 to it3_tab.
endloop.
*reward if this helps
regards,
Sandeep
‎2007 Dec 06 7:13 AM
now check this code, hope this is clear??
loop at table1.
loop at table2.
move tab2-matno to is_final-matno.
move tab2-vno to is_final-vno.
move tab2-pno to is_final-pno.
move table1-mstat to is_final-mstat.
append is_final to it_final.
endloop.
clear : table1, table2, is_final.
endloop.
Regards
Gopi
‎2007 Dec 06 7:21 AM
thanks for answering but i am not able to understand
table2 can have 100 materials i cant hard code
table1 is having only mstat
if i delare all fields in all internal table then how to write select statement
so can u please be more clear
Message was edited by:
venkat s
Message was edited by:
venkat s
‎2007 Dec 06 7:35 AM
hi try this code,
declare 3rd internal table with all the fields,
loop at table2.
at new mstat.
flag = 1.
endat.
if flag = '1'.
move-corresponding table2 to table3.
append table3.
clear table3.
clear flag.
endif.
endloop.
if it helps reward points...