2007 Oct 22 3:25 PM
Hi Gurus,
Actually I need to update the price in some of the selected PO's as price of the materials have changed, so basically the functional folks will be sening me an input file with material no's and the changed price, and now I need to chnage the price of the materials in some of the existing PO's. I have made a selection criterion and based on that all the PO numbers those are required to be change are stored in it_tab2 with field ebeln and all the material no's and the updated price are stored in it_tab1 with field names material and price and now I have to use BAPI_PO_CHANGE to change the PO price, so can you please help me out how to use this BAPI to achieve what is required and moreover the exiting pO's may have multip;e line items with different material no's ,,,,please don't paste the sample code, please try to solve this problem using my own table and fields. I will really appreciate your efforts:
Thanks
Rajeev
Hi Gurus,
Actually I need to update the price in some of the selected PO's as price of the materials have changed, so basically the functional folks will be sening me an input file with material no's and the changed price, and now I need to chnage the price of the materials in some of the existing PO's. I have made a selection criterion and based on that all the PO numbers those are required to be change are stored in it_tab2 with field ebeln and all the material no's and the updated price are stored in it_tab1 with field names material and price and now I have to use BAPI_PO_CHANGE to change the PO price, so can you please help me out how to use this BAPI to achieve what is required and moreover the exiting pO's may have multip;e line items with different material no's ,,,,please don't paste the sample code, please try to solve this problem using my own table and fields. I will really appreciate your efforts:
Thanks
Rajeev
2007 Oct 22 3:33 PM
Check these links which contain sample program for how to use this bapi.
http://www.sap-img.com/abap/sample-abap-code-on-bapi-po-change.htm
Hope this helps.
ashish
2007 Oct 22 3:37 PM
Thanks for the reply Aashish, But I mentioned in my post not to post sample code, as I have very less time to go through it. Although I appreciate your efforts but it wil be gr8 if you can solve this problem by using your own code and not by the sample one....Hope you will understand!!! t
Thanks
Rajeev
2007 Oct 22 3:35 PM
Hi Rajeev,
I've used same BAPI to change delivery date as follows (with multiple lines).. may be same code works in price as well... i do understand you don't like code pasting..but have a look following code ..it may help you... because in my program it's working..
data : it_bapimeposchedule like bapimeposchedule occurs 0 with header line.
data : it_bapimeposchedulx like bapimeposchedulx occurs 0 with header line.
data : it_bapiret2 like bapiret2 occurs 0 with header line. "Error table
data : d_date type char10.
write itb1-umdat dd/mm/yyyy to d_date. "delivery date
it_bapimeposchedule-po_item = itb1-delps.
it_bapimeposchedule-sched_line = itb1-delet.
it_bapimeposchedule-delivery_date = d_date.
append it_bapimeposchedule.
it_bapimeposchedulx-po_item = itb1-delps.
it_bapimeposchedulx-sched_line = itb1-delet.
it_bapimeposchedulx-po_itemx = 'X'.
it_bapimeposchedulx-sched_linex = 'X'.
it_bapimeposchedulx-delivery_date = 'X'.
append it_bapimeposchedulx.
call function 'BAPI_PO_CHANGE'
exporting
purchaseorder = itb1-delnr
tables
return = it_bapiret2
poschedule = it_bapimeposchedule
poschedulex = it_bapimeposchedulx.
call function 'BAPI_TRANSACTION_COMMIT'.
Message was edited by:
sapsudha rao
2007 Oct 22 3:41 PM
Hey thanks very much for the reply. but I have few questions for you before going any further.
I need to change the PO price of only few PO's, so how can I acheive this, I mean as per your coding you are changing the date of all the POs.
so can you please explain me in detail. please go through to my question once again..
thanks a lot!!!
Rajeev
2007 Oct 22 3:44 PM
For whichever PO, you want to change data, get all those into an internal table.
LOOP AT IT_PO.
Populate BAPI data.
CALL BAPI to change PO.
Call COMMIT WORK to commit changes.
ENDLOOP.
Hope this will help you.
ashish
2007 Oct 22 3:44 PM
Ok...put this whole code in form ..with in loop call this form..hope you understand
loop at itb1.
perform price_update
using itb1-delnr itb1-delet itb1-umdat itb1-delps .
endloop.
Message was edited by:
sapsudha rao
2007 Oct 22 3:49 PM
Hey Aashish thanks for the reply man, but whatever you have told me If I done it before. I have selected all the po's that are needed to be change in it_tab2 and thw material no. and the price are in it_tab1, and then I know after this I have to call Bapi_PO_change, but my question was can you please tell me how to do it, I mean how to use this BAPI change with my table and fields.
Thanks
Rajeev
2007 Oct 22 3:53 PM
I am using code mentioned above i none of the replies.
data : it_bapimeposchedule like bapimeposchedule occurs 0 with header line.
data : it_bapimeposchedulx like bapimeposchedulx occurs 0 with header line.
data : it_bapiret2 like bapiret2 occurs 0 with header line. "Error table
data : d_date type char10.
LOOP AT ITB1.
write itb1-umdat dd/mm/yyyy to d_date. "delivery date
it_bapimeposchedule-po_item = itb1-delps.
it_bapimeposchedule-sched_line = itb1-delet.
it_bapimeposchedule-delivery_date = d_date.
append it_bapimeposchedule.
it_bapimeposchedulx-po_item = itb1-delps.
it_bapimeposchedulx-sched_line = itb1-delet.
it_bapimeposchedulx-po_itemx = 'X'.
it_bapimeposchedulx-sched_linex = 'X'.
it_bapimeposchedulx-delivery_date = 'X'.
append it_bapimeposchedulx.
call function 'BAPI_PO_CHANGE'
exporting
purchaseorder = itb1-delnr
tables
return = it_bapiret2
poschedule = it_bapimeposchedule
poschedulex = it_bapimeposchedulx.
call function 'BAPI_TRANSACTION_COMMIT'.
ENDLOOP.
Hope this helps.
ashish
2007 Oct 22 3:58 PM
Hi Rajeev,
Actually here bit confusion... first of all I've sent my Code which I'm using in my program (for delivery date change ) again Ashish pasted same code... I din't understand whose replies you are following....please let me know by that I can reply back how to use my code in your program...
Sudha
2007 Oct 22 4:03 PM
Hey Sudha this one is for you.
I have tried to modify my code according to yours, just let me know is it fin e?
loop at it_tab1.
if it_tab1-matnr = poitem-MATERIAL.
move: it_tab1-price to poitem-PRICE_UNIT.
move: 'X' to poitem-PRICE_UNIT.
append poitem.
endif.
endloop.
but I haven't used the PO number anywhere, can you leae tell mw how to select the desired po's from the whole bunch of PO's , all the PO's that I need to change are stored in ITAB2 with field ebeln.
Thanks
Rajeev
2016 Jul 11 10:03 AM
2007 Oct 22 4:31 PM
Hi Rajeev,
At last I found we can't use BAPI_PO_CHANGE for price changing....But I found one more FM to do your job...please try this fm...this may help you..
ME_UPDATE_PO_PRICE
Regards
Sudha
2007 Oct 22 4:34 PM
Hey thanks for the reply Sudha....can you explain me this in lil bit detail...I mean how this FM work.
Thanks
Rajeev
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |