cancel
Showing results for 
Search instead for 
Did you mean: 

Mass Rejection of Open Sales Order through BAPI_SALESORDER_CHANGE

Former Member
0 Kudos

Hi all,

I'm trying to write a report for mass rejection of open sales order. I use BAPI_SALESORDER_CHANGE. The problem is when there are same materials as different line items of same sales order, bapi throws an error that material already entered.

Eg:

SO:

77997

Items:

000010 H1PST

000020 H1PST

000030 H1SPSN

With the above details if fill the header as well as items and when I execute, it says item already entered in 20. How should I do this?

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi guys,

Thanks for the reply. After some explorations I found out that some one had done some enhancements in VAXX tcodes that will restrict the user not to enter one material more than once unless it is any form of subsidiary material. There was some logical issue with the code that lead to this error. Now all the things are rectified and perfected. Thanks for your support.

Regards,

Ahamed Yashif

jobis
Contributor
0 Kudos

Hi Ahmed,

Why dont you close this question as you have solved your issue..

It will be good for the forum

thanks

jobi

ian_kehoe
Active Participant
0 Kudos

Dear Ahamed,
Having the same material in line items 10 and 20 shouldn't be an issue.
I created a test and was able to apply reason for rejection in an order with the same material in two or more line items.
Try a test sequence of BAPI_SALESORDER_CHANGE and BAPI_TRANSACTION_COMMIT from transaction SE37 with the following fields:
SALESDOCUMENT  77997
ORDER_HEADER_INX-UPDATEFLAG U

ORDER_ITEM_IN-ITM_NUMBER  000010

ORDER_ITEM_IN-REASON_REJ  01

ORDER_ITEM_IN-ITM_NUMBER  000020

ORDER_ITEM_IN-REASON_REJ  01

ORDER_ITEM_IN-ITM_NUMBER  000030

ORDER_ITEM_IN-REASON_REJ  01

ORDER_ITEM_INX-ITM_NUMBER 000010
ORDER_ITEM_INX-REASON_REJ X

ORDER_ITEM_INX-ITM_NUMBER 000020
ORDER_ITEM_INX-REASON_REJ X

ORDER_ITEM_INX-ITM_NUMBER 000030
ORDER_ITEM_INX-REASON_REJ X

I hope this helps.
Regards,
Ian Kehoe

krishna_k19
Contributor
0 Kudos

Hi Yasif ,

    obviously system will through the error , why because already you entered the material in 1st line again you are adding the same . instead of that add the more quantity to the same line item(material) for avoiding the redundancy.

2) if you want to bi-forget the things means you have to follow grid/batch rules , by using schedule lines. i.e 10 line item only material -- H1PST -- schedule line item 1 -batch 80g qty 100, S.Line item 2 - 100g qty 10, ..etc.

Regards,

Krishna

siva_vasireddy2
Active Contributor
0 Kudos

Hi,
you can use Transaction -MASS by updating reason for rejection at the Item Level

This can also be used as background processing