2007 Jun 08 11:05 AM
Hi
I have two internal table.one itab1 and itab2 is other one.now i need to ALV report with fields of matnr ,ersda and mtart.
data:begin of itab1 occurs 0,
matnr type mara-matnr,
ersda type mara-ersda,
end of itab1.
data:begin of itab2 occurs0,
matnr type mara-matnr,
mtart type mara-mtart,
end of itab2.
please help me.
Thanks.
Jay
2007 Jun 08 11:10 AM
Hello,
Declare one more table itab3.
data:begin of itab3occurs 0,
matnr type mara-matnr,
ersda type mara-ersda,
mtart type mara-mtart,
end of itab3.
loop at itab1.
read table itab2 with key matnr = itab1-matnr.
if sy-subrc = 0.
itab3-matnr = itab1-matnbr.
itab3-ersda = itab1-ersda.
itab3-mtart = itab2-mtart.
append itab3.
endif.
endloop.
Pass the table itab3 to the ALV.
If useful reward.
Vasanth
Hello,
Declare one more table itab3.
data:begin of itab3occurs 0,
matnr type mara-matnr,
ersda type mara-ersda,
mtart type mara-mtart,
end of itab3.
loop at itab1.
read table itab2 with key matnr = itab1-matnr.
if sy-subrc = 0.
itab3-matnr = itab1-matnbr.
itab3-ersda = itab1-ersda.
itab3-mtart = itab2-mtart.
append itab3.
endif.
endloop.
Pass the table itab3 to the ALV.
If useful reward.
Vasanth
2007 Jun 08 11:10 AM
Hello,
Declare one more table itab3.
data:begin of itab3occurs 0,
matnr type mara-matnr,
ersda type mara-ersda,
mtart type mara-mtart,
end of itab3.
loop at itab1.
read table itab2 with key matnr = itab1-matnr.
if sy-subrc = 0.
itab3-matnr = itab1-matnbr.
itab3-ersda = itab1-ersda.
itab3-mtart = itab2-mtart.
append itab3.
endif.
endloop.
Pass the table itab3 to the ALV.
If useful reward.
Vasanth
2007 Jun 08 11:10 AM
data : begin of ifinal occurs 0,
matnr type mara-matnr,
ersda type mara-ersda,
mtart type mara-mtart,
end of ifinal.
loop at itab1.
ifinal-matnr = itab1-matnr.
ifinal-ersda = itab1-ersda.
read table itab2 with key matnr = itab1-matnr.
ifinal-mtart = itab2-mtart.
append ifinal.
clear : itab2.
endloop.
now pass the ifinal to alv display fm.
regards
shiba dutta
2007 Jun 08 11:12 AM
HI,
y dont u select all the three fields in one shot in this case...
any how
try this
declare another tabel withe all the three records.
select matnr ersda from mara into table itab1.
if not itab1 is initial.
select matnr mtart from mara for all entries in itab1
where matnr = itab1-matnr.
endif.
sort itab2.
loop at itab1.
read table itab2 with key matnr = itab1-matnr binary search.
if sy-subrc eq 0.
itab3-matnr = itab1-matnr
itab3-ersda = itab1-matnr
itab3-mtart= itab1-mtart.
append itab3.
endif.
endloop.
now display the itab3.
reward points if helpful
regards,
venkatesh
2007 Jun 08 11:12 AM
u can create itab3 internal table with these fileds (matnr ,ersda and mtart).
finally move these fileds to itab3 based on matnr.
2007 Jun 08 11:18 AM
Hi,
As suggested,declare third internal table with fields matnr,ersda and mtart.
Once the two internal table asre populated,put a loop to populate itab3.
loop at itab1.
move-corresponding itab1 to itab3.
loop at itab2 where matnr = itab1-matnr.
move-corresponding itab2 to itab3.
append itab3.
endloop.
endloop.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |