‎2008 Feb 18 11:41 AM
Hi experts,
I have two internal tables, the first internal having I_S021 MATNR,AUFNR, WEMNG this fields, in my 2nd internal table I_AFPO its contains AUFNR PSMNG WEMNG.
for that i created 2 select quries.
SELECT MATNR AUFNR WEMNG INTO TABLE I_S021 frOM S021 WHERE WERKS = P_WERKS AND
SPTAG between S_SPTAG-low
AND S_sptag-high
AND MATNR in S_MATNR
AND WEMNG GT 0.
SELECT AUFNR PSMNG WEMNG FROM AFPO INTO TABLE I_AFPO FOR ALL ENTRIES in I_S021
WHERE MATNR = i_s021-MATNR
and aufnr = i_s021-aufnr .
i want to know how to make this 2 internal tables into one single consolidated internal table?
any one plz help this, <REMOVED BY MODERATOR>
Mohana
Edited by: Alvaro Tejada Galindo on Feb 18, 2008 2:24 PM
‎2008 Feb 18 11:45 AM
Hi,
create another table say t_final that has fields of both de tables...
loop at I_AFPO.
move-corresponding I_AFPO to t_final.
read table I_S021 with key MATNR = I_AFPO-MATNR aufnr = I_AFPO-aufnr .
if sy-subrc is initial.
move-corresponding I_S021 to t_final.
endif.
append t_final.
endloop.Cheers,
jose.
‎2008 Feb 18 11:45 AM
Hi,
create another table say t_final that has fields of both de tables...
loop at I_AFPO.
move-corresponding I_AFPO to t_final.
read table I_S021 with key MATNR = I_AFPO-MATNR aufnr = I_AFPO-aufnr .
if sy-subrc is initial.
move-corresponding I_S021 to t_final.
endif.
append t_final.
endloop.Cheers,
jose.
‎2008 Feb 18 11:47 AM
Loop at I_S021.
read table I_AFPO with key aufnr = I_S021-aufnr.
if sy-subrc = 0.
move-corresponding I_S021 to i_consolidated.
move-corresponding I_AFPO to i_consolidated.
append i_consolidated.
clear i_consolidated.
endif.
endloop.