SAP Knowledge Base Article - Public

3767112 - How to create an outbound delivery for only parts of the items in a sales order

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

  1. Create an outbound delivery in VL01N.
  2. This outbound delivery should only include parts of the items in the sales order.

Resolution

  1. 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".)
  2. Create a sales order which includes two items (Item A and Item B).
  3. 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".
  4. 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.
    ----------------
  5. 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