10-25-2007 4:09 AM
I tried to use BAPI_PO_CHANGE to change the delivery date, although I get "Standard PO xxxxxxxxxx changed" (i have called BAPI_TRANSACTION_COMMIT), i find that the PO hasn't been changed.
My codes:
write sy-datum dd/mm/yyyy to d_date. "delivery date
it_bapimeposchedule-po_item = '00010'.
it_bapimeposchedule-sched_line = '0001'.
it_bapimeposchedule-delivery_date = d_date.
append it_bapimeposchedule.
it_bapimeposchedulx-po_item = '00010'.
it_bapimeposchedulx-sched_line = '0001'.
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 = '1234567890'
tables
return = it_bapiret2
poschedule = it_bapimeposchedule
poschedulex = it_bapimeposchedulx.
call function 'BAPI_TRANSACTION_COMMIT'.
Can any experts advise how to get this function work properly to change delivery date?
10-25-2007 4:11 AM
10-25-2007 4:13 AM
Hi,
Can you set parameter DELETE_IND = 'U' in order to update record?
ashish
10-25-2007 4:13 AM
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.
10-25-2007 4:36 AM
actually, i think we capture the code from the same source, but I am trying to update delivery date of a single item. The parameters set in function are the same. I just want to know whether you can have your delivery date update successfully. Thanks!