cancel
Showing results for 
Search instead for 
Did you mean: 

Remove Reason For Rejection From Sales Order Using BAPI_SALESORDER_CHANGE

Former Member
0 Kudos

Hi

I have a sales order and would like to remove the rejection reason.

I am trying to use BAPI_SALESORDER_CHANGE with the following code:

(0000xxxxxxx is my material #. i just removed the actual #).

*********************************************************

MOVE: '0000050106' TO SALESDOCUMENT.

MOVE: 'U' TO T_HEADER_INX-UPDATEFLAG.

MOVE: 30 to t_order_item_in-ITM_NUMBER,

' ' to t_order_item_in-REASON_REJ,

'0000000000xxxxxxxx' to t_order_item_in-material.

APPEND t_order_item_in.

MOVE: 'U' TO t_order_item_inx-updateflag.

MOVE: 'X' to t_order_item_inx-REASON_REJ,

'X' TO t_order_item_inx-material.

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'

EXPORTING

salesdocument = SALESDOCUMENT

order_header_inx = T_HEADER_INX

tables

RETURN = T_RETURN

ORDER_ITEM_IN = T_ORDER_ITEM_IN

ORDER_ITEM_INX = T_ORDER_ITEM_INX

.

.

WAIT UP TO 5 SECONDS.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'

IMPORTING

RETURN = t_return

.

WAIT UP TO 5 SECONDS.

*********************************************************

can anybody help?

the BAPI returns success messages saying the item was processed successfully but the reason code is still there.

However, if i pass in any other reason code like 02 or 06, it works!.

thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

t_order_item_inx is not appended

Pls append and give a try

Regards

MD

Answers (2)

Answers (2)

Former Member
0 Kudos

Was missing a parameter

Former Member
0 Kudos

Thanks for your help. 😃

I also realized that I forgot to add the SO Item # into the T_ORDER_ITEM_INX-ITM_NUMBER fields.

But now it works.