‎2007 Oct 22 8:13 PM
Hi All,
I have an internal table itab1 and in this I have the po numbers, now I need to maintain another internal table that will have the details of the PO's that are stored in itab2 such as material no, price, line item no. and po number.
so can you please tell me how to do this.
data: begin of it_tab2 occurs 0,
ebeln like ekko-ebeln,
end of it_tab2
Thanks
Rajeev
Message was edited by:
Rajeev Gupta
‎2007 Oct 22 8:54 PM
Hi,
Please try somthing like this.
data: begin of it_tab2 occurs 0,
ebeln like ekpo-ebeln,
ebelp like ekpo-ebelp,
matnr like ekpo-matnr,
netpr like ekpo-netpr.
data: end of it_tab2.
loop at it_tab1.
select ebeln ebelp matnr netpr
into (ekpo-ebeln, ekpo-ebelp, ekpo-matnr, ekpo-netpr)
from ekpo
where ebeln = it_tab1-ebeln.
it_tab2-ebeln = ekpo-ebeln.
it_tab2-ebelp = ekpo-ebelp.
it_tab2-matnr = ekpo-matnr.
it_tab2-netpr = ekpo-netpr.
append it_tab2.
endselect.
endloop.
Regards,
Ferry Lianto
‎2007 Oct 22 8:17 PM
You'll have to add the material number to the second table and then retrieve the material number form EKPO.
Rob
‎2007 Oct 22 8:22 PM
Hi Rob,
Thanks for the reply,
But what I need is to retrieve the information of PO's in an internal table, so basically if in itab2 PO # is 12345, then I need to get the materials associated with that PO (12345), item no. and price of the materials in the PO in the other internal table.
If you get my point ...please try to explain in detail.
Thanks
Rajeev
‎2007 Oct 22 8:26 PM
‎2007 Oct 22 8:54 PM
Hi,
Please try somthing like this.
data: begin of it_tab2 occurs 0,
ebeln like ekpo-ebeln,
ebelp like ekpo-ebelp,
matnr like ekpo-matnr,
netpr like ekpo-netpr.
data: end of it_tab2.
loop at it_tab1.
select ebeln ebelp matnr netpr
into (ekpo-ebeln, ekpo-ebelp, ekpo-matnr, ekpo-netpr)
from ekpo
where ebeln = it_tab1-ebeln.
it_tab2-ebeln = ekpo-ebeln.
it_tab2-ebelp = ekpo-ebelp.
it_tab2-matnr = ekpo-matnr.
it_tab2-netpr = ekpo-netpr.
append it_tab2.
endselect.
endloop.
Regards,
Ferry Lianto
‎2007 Oct 23 12:17 AM
Hi,
Give the first select to select all PO Numbers from EKKO and store them in internal table I_EKKO
Then to get the details:
SELECT EBELN EBELP NETPR
FROM EKPO
INTO TABLE I_EKPO
FOR ALL ENTRIES IN I_EKKO
WHERE EBELN = EKKO-EBELN.
Hope it helps,
Reward if it is useful.
Thanks,
Srinivasa Rada