Symptom
Using BADI 'LE_SHP_MODIFY_HEAD' to change the delivery date of outbound deliveries which are created through scheduled jobs is not working. The dates remain unchanged after delivery created.
The BADI 'LE_SHP_MODIFY_HEAD' only works for manually created outbound delivery.
Environment
SAP S/4HANA Cloud Public Edition
Reproducing the Issue
- Create custom logic with BADI 'LE_SHP_MODIFY_HEAD' to change the delivery date as current system date during outbound delivery creation.
- Create a sales order with schedule lines containing past confirmation dates.
- Execute the delivery creation job using the job template SAP_LCM_LE_RVV50R10A_T in app Schedule Delivery Creation.
- Observe that the outbound delivery generated by the job reflects the past dates from the sales order's schedule lines instead of current system date.
Resolution
Implement custom logic with BADI 'LE_SHP_SAVE_DOCUMENT_PREPARE' to modify delivery dates during creation. Example code can be referred as below:
move-corresponding delivery_document_in to delivery_document_out.
move-corresponding delivery_document_items_in to delivery_document_items_out.
IF documentprocessingmode = 'CREATE'.
DELIVERY_DOCUMENT_OUT-PICKINGDATE = 'YYYYMMDD'.
DELIVERY_DOCUMENT_OUT-TRANSPORTATIONPLANNINGDATE = 'YYYYMMDD'.
DELIVERY_DOCUMENT_OUT-LOADINGDATE = 'YYYYMMDD'.
DELIVERY_DOCUMENT_OUT-PLANNEDGOODSISSUEDATE = 'YYYYMMDD'.
DELIVERY_DOCUMENT_OUT-DELIVERYDATE = 'YYYYMMDD'.
ENDIF.
Keywords
Outbound delivery, Schedule line date, Delivery date, Past date, Background job, SAP_LCM_LE_RVV50R10A_T, rvv50r10a, LE_SHP_SAVE_DOCUMENT_PREPARE, LE_SHP_MODIFY_HEAD, BADI implementation. , KBA , LE-SHP-DL-2CL , Delivery Processing (Public Cloud) , Problem
SAP Knowledge Base Article - Public