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_SALESORDER_CHANGE to update reason for rejection of sales order item

Former Member
0 Kudos

Hi,

The FM BAPI_SALESORDER_CHANGE is not working properly as I am getting below error when try to update the reason for rejection at sales order item level.

The delivery is done for this salesorder. Is it because the reason for rejection field is not as an input field when delivery done?

error in return table is " Field 'ABGRU' cannot be changed, VBAPKOM 000010 ready for input"

Request your suggestions to avoid this error.

Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

>

> Hi,

> The delivery is done for this salesorder. Is it because the reason for rejection field is not as an input field when delivery done?

>

> error in return table is " Field 'ABGRU' cannot be changed, VBAPKOM 000010 ready for input"

>

>

> Thanks

Yes, Most likely.. You can confirm this by trying to change a order without delivery and see if it goes thru (to ensure that you have passed correct parameters)...

you may have to delete the delivery (and if billing document exist, cancel it), before you can reject the line item... it would be safer to raise an error message and let the users manually delete delivery document as long as you don't have large volumes of this scenario..

Please see the SDN thread for how you can avoid this error...

6 REPLIES 6

Former Member
0 Kudos

>

> Hi,

> The delivery is done for this salesorder. Is it because the reason for rejection field is not as an input field when delivery done?

>

> error in return table is " Field 'ABGRU' cannot be changed, VBAPKOM 000010 ready for input"

>

>

> Thanks

Yes, Most likely.. You can confirm this by trying to change a order without delivery and see if it goes thru (to ensure that you have passed correct parameters)...

you may have to delete the delivery (and if billing document exist, cancel it), before you can reject the line item... it would be safer to raise an error message and let the users manually delete delivery document as long as you don't have large volumes of this scenario..

Please see the SDN thread for how you can avoid this error...

0 Kudos

Thanks for the reply Kris.

So manually it's not possible to change the reason for rejection if allready subsequents documents are done.

Is it the same case when we change using BAPI?

0 Kudos

Lot of times you can do things manually that you can never do with BAPI... I have rarely seen the other way around... And as BP pointed out, it doesn't make sense to reject an item with subsequent document like delivery until you can cancel the delivery.

When you are entering a rejection code, you are effectively cancelling your order... If there is a delivery against this order and there is a goods issue, than the goods have been taken out of warehouse... By cancelling the delivery or any other subsequent documents like billing documents, you are effectively returning to status quo

former_member182040
Active Contributor
0 Kudos

Also pass Schedule Lines details

schedule_lines = i_sched

schedule_linesx = i_schedx.



CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = p_vbeln
order_header_in = i_hdr
order_header_inx = i_hdrx
TABLES
return = i_ret
schedule_lines = i_sched
schedule_linesx = i_schedx.

Former Member
0 Kudos

It's not logical to reject a sales order item, if a delivery has been done against that item! To reject the item after delivery has been created, you'd need to reduce the order quantity to the quantity already shipped....thus the item is fully delivered, I'd think. SD item rejection is a method of canceling the entire order item after the order has been input and saved.

0 Kudos

Hi ,

you can close using below FM..

CALL FUNCTION 'SD_ORDER_CREDIT_CANCEL'

       EXPORTING

         ABGRU         =  " Reason

         VBELN         =   " Sales Order

* TABLES

*   TLIPS         =

         exceptions

           error_message = 4.