Application Development and Automation 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: 
Read only

Problem in using BAPI_SALESORDER_CHANGE

former_member201364
Participant
0 Likes
1,398

Hi,

We are using BAPI_SALESORDER_CHANGE for updating the delivery block information present in Shipping tab of sales order header.

We are updating the below parameters and then calling the bapi.

ls_header-DLV_BLOCK = 'Z1'.

ls_head_update-updateflag = 'U'.

ls_head_update-DLV_BLOCK = 'X'.

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'

EXPORTING

SALESDOCUMENT = gs_vbak-vbeln

ORDER_HEADER_IN = ls_header

ORDER_HEADER_INX = ls_head_update

behave_when_error = ' '

int_number_assignment = ' '

TABLES

RETURN = lt_return.

But during execution we could see the messages in parameter return as below

ORDER_HEADER_IN has been processed successfully

No data was changed

But we want to update the delivery block with Z1 which is not happening.

Please let us know if we missed anything.

Thanks in advance,

Poornima

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,243

Call BAPI "BAPI_TRANSACTION_COMMIT" after the sales order change BAPI.

Also check whether "Z1" is configuared as Delivery block in ur system. because by default system accepts

01.....09.

9 REPLIES 9
Read only

Former Member
0 Likes
1,244

Call BAPI "BAPI_TRANSACTION_COMMIT" after the sales order change BAPI.

Also check whether "Z1" is configuared as Delivery block in ur system. because by default system accepts

01.....09.

Read only

Former Member
0 Likes
1,243

for chnaging the delivery block you can use exit MV45AFZZ and change the block.

Read only

abdul_hakim
Active Contributor
0 Likes
1,243

Hi

Call the BAPI BAPI_TRANSACTION_COMMIT after the sales order change BAPI.

Cheers,

Hakim

Read only

Former Member
0 Likes
1,243

Hi,

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'.

Read only

0 Likes
1,243

Hi,

I'm already using

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'.

But no luck.

Thanks,

Poornima

Read only

0 Likes
1,243

HI,

Check the tcode VA03 with the sales ordernumber before changing and after changing the sales order with delivery block.

Refer to this link..

Read only

Former Member
0 Likes
1,243

Hi,

use 'COMMIT WORK' after BAPI.

Thanks,

Krishna..

Read only

Former Member
0 Likes
1,243

Check for Return value is "S" and sy-subrc eq 0. Then Do ' Commit_work' with wait for few seconds

Read only

0 Likes
1,243

you may refer note no 178338.