Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Doubt in internal table

Former Member
0 Likes
450

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
427

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.

2 REPLIES 2
Read only

Former Member
0 Likes
428

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.

Read only

Former Member
0 Likes
427

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.