Symptom
The user merely intends to create an outbound delivery for only a portion of the items in the sales order, instead of including all of the items.
Environment
SAP S/4HANA Cloud Public Edition
Reproducing the Issue
- Create an outbound delivery in VL01N.
- This outbound delivery should only include parts of the items in the sales order.
Resolution
- Create a custom field and enable the Business Scenario "Sales Document Item to Delivery on Header Level" for this custom field in "Custom Fields" app. (Assume the name of this custom field is "Customfield_1".)
- Create a sales order which includes two items (Item A and Item B).
- Maintain the custom field "Customfield_1" for the item A with "A" and maintain the custom field "Customfield_1" for the item B with "B".
- Implement the BAdI LE_SHP_DELIVERY_FINAL_CHECK and prevent the delivery from being created or saved by returning an error message when the the custom field "Customfield_1" is "B".
----------------
Sample Code:
IF documentprocessingmode = 'CREATE'.
IF delivery_document_in-Customfield_1 = 'B'.
message-messagetype = 'E'. " saving of the delivery document will be prevented
message-messagetext = |Error: Test Error|. " Error details
EXIT.
ENDIF.
ENDIF.
---------------- - Create the outbound delivery only with item A.
See Also
KBA 3701562 - FAQ: Delivery split when creating deliveries - SAP S/4HANA Cloud Public Edition
Keywords
outbound delivery, sales order, SAP S/4HANA Cloud Public Edition, VL01N, Custom Fields, LE_SHP_DELIVERY_FINAL_CHECK , KBA , LE-SHP-DL-2CL , Delivery Processing (Public Cloud) , How To
Product
SAP S/4HANA Cloud Public Edition all versions
SAP Knowledge Base Article - Public