ABAP development for Logistics


  • Processing deliveries
    • BADIS
      • Storage location
      • VL0*N: Z fields 
    • New user exit for changes when saving deliveries
    • User exits in delivery processing
    • Additional information
      • 415716 - User exits in delivery processing
      • 751000 - New user exit for changes when saving deliveries

Processing deliveries 

BAPIs: As per the information provided in SAP Note Number 949074 here are the BAPIs released for Delivery creation for use in Standard system:
  • BAPI_OUTB_DELIVERY_CREATE_SLS (Sales Order - Delivery)
  • BAPI_OUTB_DELIVERY_CREATE_STO (Stock Transport Order - Delivery)
  • BAPI_OUTB_DELIVERY_CREATE_NOREF (Delivery without Reference)
Function Modules:
  • RV_DELIVERY_CREATE: For sales order delivery creation. ONLY for Sales Order - Delivery scenario
  • GN_DELIVERY_CREATE: For Stock Transport Order - Delivery scenario, Inbound Delivery, post change delivery etc. All the scenarios EXCEPT Sales Order - Delivery should be created by this Function Module

BADIS

LE_SHP_STORLOC_DETERMINATION

FM: SD_STORAGE_LOCATION_DETERMINE

Extend VL0*N transaction with Z fields

BADI LE_SHP_TAB_CUST_HEAD for header enhancement
BADI LE_SHP_TAB_CUST_ITEM for item

New user exit for changes when saving deliveries

If you make requirement-relevant changes to delivery items (for example, changes to delivery quantities, deletion of items, and so on) in the user exit '..DOCUMENT_PREPARE' in the include MV50AFZ1, incorrect requirements may occur.

This may also be the case if you call the form routine 'BELEG_SICHERN_VORBEREITEN' again in the USEREXIT_SAVE_DOCUMENT_PREPARE after making customer-specific changes.

The correction contained in this note provides a new user exit (form routine USEREXIT_SAVE_DOC_BEFORE_PREP) that allows you to make requirement-relevant changes to deliveries when you save them.

You can then create the actual form routine of the user exit in the MV50AFZ1 include. Note that this form routine is not available in a Support Package, and you must implement it separately.

User exits in delivery processing

LIKP and XLIKP are the header lines of the current delivery. In dialog processing, only the structure LIKP contains the current status up to the start of the saving process. The corresponding internal table XLIKP is reliably filled only during collective processing; in dialog processing only as of the start of the delivery saving process.

The structure YLIKP contains the database status of the delivery header in change mode. The indicator XLIKP_UPDKZAs is filled with 'U' if the header is changed.

The internal table XLIPS contains the current status of the delivery items. The change indicator (XLIPS-UPDKZ) states whether the item is to be inserted, changed or deleted.

Items that were deleted or changed in change mode also appear in table YLIPS, which represents the database status of the respective items.

Determinating the processing status of the delivery

  • The field T180-TRTYP has the value 'H' in creation mode, the value 'V' in change mode and the value 'A' in display mode.
  • The indicator V50AGL-SAMMELGANG (as of Release 4.0) or KZ_SAMMELGANG (up to Release 3.1I) has the value 'X' in collective processing; the indicator SPACE is in the dialog.
  • The indicator KOMMIRUECKMELDUNG is set if a delivery is changed by a pick order verification from Warehouse Management or by importing an IDoc.
  • If goods issue posting or goods receipt posting is active, the indicator V50AGL-WARENAUSGANG is set. In the case of a cancellation, the indicator V50AGL-WARENAUSG_STORNO may be queried.
  • If a delivery document is deleted completely, the field YLIKP_UPDKZ is set to 'D'; T180-TRTYP has the value 'V' in this case.
  • The indicator V50AGL-MULT is set if deliveries are saved that were subsequently split. In this case, the indicator T180-TRTYP has the value 'V'.
  • The indicator V50AGL-SYNCHRON (Release 3.1I: KZ_SYNCHRON) is set if the delivery is to be updated synchronously.

User exits 

  • FORM routine USEREXIT_REFRESH_DOCUMENT (include MV50AFZ1)
    • The FORM routine USEREXIT_REFRESH_DOCUMENT is used for the initialization of your own data areas before the processing of a new delivery document.
    • The data initialization is called on the following occasions:
    • After deliveries have been saved in the dialog (not in the new delivery dialog, except for transaction VL01NO).
    • In the dialog, before returning to the initial screen with functions 'Back' or 'Cancel' (not in the new delivery dialog).
    • In the new delivery dialog, when switching between 'Display' and 'Change' and when reading a new document using the function 'Other Outbound Delivery' or 'Other Inbound Delivery'.
  • FORM routine USEREXIT_DELETE_DOCUMENT (include MV50AFZ1)
    • If delivery is deleted, you can delete your own dependent data using this FORM routine.
  • FORM routine USEREXIT_READ_DOCUMENT (include MV50AFZ1)
    • The exit is used to make your own data available for processing in the delivery.The routine is run exactly once every time the delivery document data is read in change or display mode of the delivery. Exception: The routine is not executed when reading deliveries during the subsequent delivery split and when enhancing deliveries.
  • FORM routine USEREXIT_MOVE_FIELD_TO_LIKP (include MV50AFZ1)
    • The exit is used to provide your own additional fields of the header table LIKP with data.
  • The FORM routine is run exactly once when creating a new delivery. The exit must not be used for the direct output of error messages. However, messages of the type I and E can be included in the delivery creation log using the FORM routine MESSAGE_HANDLING (main program SAPMV50A). 
  • FORM routine USEREXIT_MOVE_FIELD_TO_LIPS (include MV50AFZ1)
    • The routine is used to provide your own additional fields of the table LIPS with data.The routine is run exactly once for each item during the creation of delivery items. 
  • FORM routine USEREXIT_BATCH_DETERMINATION (include MV50AFZZ)
    • You can use the routine to determine the batch, which is to be assigned to the delivery item, in accordance with your own criteria.
  • FORM routine USEREXIT_SAVE_DOC_BEFORE_PREP (include MV50AFZ1)
    • This routine can be used for the final change of all delivery data. At the time of the call, the delivery is complete and consistent; only the document number has not yet been determined in the creation case and the final processing of the requirements has not yet taken place. Therefore, changes to the delivery at this time must be made with particular care because no subsequent checks can prevent possible data inconsistencies.
  • FORM routine USEREXIT_SAVE_DOCUMENT_PREPARE (include MV50AFZ1)
    • This routine is the most powerful exit in delivery processing and can be used for the final change of all delivery data. At the time of the call, the delivery is complete and consistent, only the document number has not yet been determined in the creation case. Therefore, changes to the delivery at this time must be made with particular care because no subsequent checks can prevent possible data inconsistencies.
  • FORM routine USEREXIT_SAVE_DOCUMENT (include MV50AFZ1)
    • The routine is used to save your own data when saving deliveries. Delivery data cannot be changed here anymore since it has already been transferred to the update.

SAP notes

  • 415716 - User exits in delivery processing
  • 751000 - New user exit for changes when saving deliveries

Comments