11-22-2008 8:20 AM
Hi.
Now, I have one PR which generates a lot of PO.
Each PR number has one or more PO number.
ITAB_EBAN has field BANFN, EBELN.
ITAB_EKPO had fields EBELN, EBELP, BANFN.
How do i insert the ekpo-ebelp into the itab_eban from itab_ekpo for each eban-banfn? One line of eban-banfn record maybe have a lot of ekpo-ebeln and ekpo-ebelp. So what should i do in order to make sure the record is displayed correctly? By duplicate the row of data inside itab_eban, so that each eban-banfn can have many ekpo-ebeln or ekpo-ebelp?
Thanks in advance.
11-22-2008 10:34 AM
Hi ,
Do the following...............
ITAB_EBAN has field BANFN, EBELN.
ITAB_EKPO had fields EBELN, EBELP, BANFN.
loop at ITAB_EKPO.
ITAB_EBAN-BANFN = ITAB_EKPO-BANFN .
ITAB_EBAN-EBELN = ITAB_EKPO-EBELN .
Append ITAB_EBAN.
endloop.
delete duplicates
Sort ITAB_EBAN by banfn descending ebeln descending.
Delete adjacent duplicates from itab_eban comparing banfn ebeln.
We will now have unique values for banfn/ebeln in itab_eban
Regards
Byju
11-22-2008 8:31 AM
U can instead copy the data to item table from header table....because ulitmately you will require ebeln ebelp combination....
One more option u can declare a third internal table ....loop at item table .....loop at header table where ebeln.....append the required fields to the third table..
data : itab3 ............
loop at itab_ekpo.
loop at itab_ebafn where ebeln = itAb_ekpo-ebeln.
move -
append itab3.
endloop.
endloop.
Edited by: kashyap joshi on Nov 22, 2008 9:31 AM
11-22-2008 8:36 AM
11-22-2008 10:17 AM
LOOP AT ITAB.
move-corresponding itab to itab1.
append itab1.
ENDLOOP..
11-22-2008 10:34 AM
Hi ,
Do the following...............
ITAB_EBAN has field BANFN, EBELN.
ITAB_EKPO had fields EBELN, EBELP, BANFN.
loop at ITAB_EKPO.
ITAB_EBAN-BANFN = ITAB_EKPO-BANFN .
ITAB_EBAN-EBELN = ITAB_EKPO-EBELN .
Append ITAB_EBAN.
endloop.
delete duplicates
Sort ITAB_EBAN by banfn descending ebeln descending.
Delete adjacent duplicates from itab_eban comparing banfn ebeln.
We will now have unique values for banfn/ebeln in itab_eban
Regards
Byju