cancel
Showing results for 
Search instead for 
Did you mean: 

Changing delivery quantity in AII from outbound delivery in ECC issue

Former Member
0 Kudos

We are sending an Outbound Delivery from ECC (DELINF.DELVRY05) to AII which triggers a BusinessDocumentExecutionRequest proxy. This utilizes the function group /AIN/IF_BUS_DOC_INT. The BAdI: Generic Document Business Execution Request as it has the methods preprocess, allow_modification, and postprocess which we are utilizing.

Our problem is: A new outbound delivery created in ECC is correctly processed in AII; however, when we try to update the quantity or even simply send the same information to BusinessDocumentExecutionRequest it is adding another line item to the delivery. We need this to update the line item of the delivery. After spending a great amount of time looking through the code for a possible field which would represent a change in the delivery, I have not been able to find anything. Has anyone encountered this same issue?

If we would like to update the quantity of an item in this delivery, is there a way to do this without having to write custom code? The only possible solution I have been able to think of is to let everything process up to the postprocess method and then execute ROLLBACK WORK, look for a custom attribute (ZACTION_CODE) possibly based off the "QUALF" field from the DELVRY05 (E1EDL18 segment) IDOC, and if the field is equal to "CHG" or "DEL" we process our own code to update/change the delivery header/items ourselves.

Does anyone have any other possible ideas surrounding this issue?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Solution: SAP Note 1638957 - BusinessDocumentExecutionRequest: document item context

In the allow_modification method of the BAdI we set the variable CV_CHG_DOC_ITM_CTX to 'X' (using constant CO_MOD_CHG_DOC_ITM_CTX_ONLY) after the note has been applied. This allows for changes to be made exclusively to the item context attributes.

Keep in mind that the variable CV_ALLOW_MODIFICATION must be = to 'i' which is different than the default 'X' (which prevented the allow_modification method to be called for Inbound and Outbound Deliveries) and requires the SAP Note 1626592 - /AIN/BADI_BUS_DOC_EXEC_REQ: ALLOW_MODIFICATION not called.