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

BAPI_SALESORDER_CHANGE

Former Member
0 Likes
736

Hi All,

I am changing a Sales Doc. using following Module.

I need to change the value of 'Billing Block' as 02 or space (at header level in VA02) depending on some condition.

Code is as follows.

GW_HEADER-COLLECT_NO = gv_vbeln

gw_header-BILL_BLOCK = gv_faksk " 02 or space

gw_item-UPDATEFLAG = 'U'

GW_ITEM-BILL_BLOCK = 'X'

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'

EXPORTING

salesdocument = gv_vbeln

ORDER_HEADER_IN = gw_header

order_header_inx = gw_item

SIMULATION = 'X'

tables

return = gt_return.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'.

now in the return parameter gt_return is getting message 'ORDER_HEADER_IN' is processed successfuly.

But when i am checking in VA02, the screen field is not changed accordingly.

Please help me.

Thanks in Advance,

Subhani.

Hi All,

I am changing a Sales Doc. using following Module.

I need to change the value of 'Billing Block' as 02 or space (at header level in VA02) depending on some condition.

Code is as follows.

GW_HEADER-COLLECT_NO = gv_vbeln

gw_header-BILL_BLOCK = gv_faksk " 02 or space

gw_item-UPDATEFLAG = 'U'

GW_ITEM-BILL_BLOCK = 'X'

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'

EXPORTING

salesdocument = gv_vbeln

ORDER_HEADER_IN = gw_header

order_header_inx = gw_item

SIMULATION = 'X'

tables

return = gt_return.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'.

now in the return parameter gt_return is getting message 'ORDER_HEADER_IN' is processed successfuly.

But when i am checking in VA02, the screen field is not changed accordingly.

Please help me.

Thanks in Advance,

Subhani.

5 REPLIES 5
Read only

Former Member
0 Likes
707

Note that irrespective of what fields we need to change, we have pass the values for the Key Fields like Sales orgn, Dist. Chan, Div... with the update indicators. Try passing the same for the FM and check.

Read only

Former Member
0 Likes
707

Hi,

Can you try commiting using WAIT parameter as space.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

Reward points if it helpful.

Thanks,

Prasanna

Read only

Former Member
0 Likes
707

Field simulation should be blank, not 'X'

Read only

Former Member
0 Likes
707

Hello Subhani,

First, clear the SIMULATION parameter.

When this doesn't work, set a break-point at the IF-block after the COMMIT WORK AND WAIT in the FM BAPI_TRANSACTION_COMMIT and see of the COMMIT is successfully performed.

Hope this helps,

Heinz

Read only

Former Member
0 Likes
707

Done using BDC.