Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_PO_CHANGE cannot change delivery date

former_member220801
Participant
0 Kudos

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?

4 REPLIES 4

Former Member
0 Kudos

Former Member
0 Kudos

Hi,

Can you set parameter DELETE_IND = 'U' in order to update record?

ashish

Former Member
0 Kudos

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.

0 Kudos

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!