ERPClimb logoERPClimb
User Exits
ABAP Developmentintermediate 7 min read

User Exits Part 5: MV50AFZ1 — Delivery User Exit Patterns

Preview · a free account unlocks the full lesson

Key takeaway

Apply delivery user exits in MV50AFZ1: USEREXIT SAVE DOCUMENT PREPARE for checks and changes with LIKP and XLIPS, USEREXIT SAVE DOCUMENT for own tables, batch split items, background delivery creation (VL10) and when the BAdI LE SHP DELIVERY PROC is the better choice.

In this lessonShow sections

Visual overview

User Exits Part 5: MV50AFZ1 — Delivery User Exit Patterns — learning sheetFlow: SE38: display MV50AFZ1 and read the FORM comments → Debug VL02N save; inspect LIKP, XLIPS (with batch split) and UPDKZ → Implement the batch check from the code example in a sandbox and test via VL10. Key ideas: KEY FORMS; ITEMS AND BATCH SPLIT; BACKGROUND AND INTERFACES; LE_SHP_DELIVERY_PROC (CLASSIC BADI). Watch out: For many delivery requirements, SAP's classic BAdI LE_SHP_DELIVERY_PROC offers cleaner methods — check it first.ERPClimb.com / ABAP / LESSON 5/8 / LEARNING SHEETUser Exits Part 5: MV50AFZ1 — Delivery User Exit Patterns1 · HOW IT FLOWS1SE38display MV50AFZ1 and read the FORMcomments2Debug VL02N save; inspectLIKP, XLIPS (with batchsplit) and UPDKZ3Implement the batch checkfrom the code example ina sandbox and test via…2 · KEY IDEAS EXPLAINEDKey FormsUSEREXIT_SAVE_DOCUMENT_PREPARE — checks and finalchanges before save (e.g. block delivery, set a Zfield, validate batches).USEREXIT_SAVE_DOCUMENT — during save; write owntables via update task.Items And Batch SplitXLIPS contains main items and batch splitsub-items (UECHA = higher-level item).For quantity checks use the main item or sum thesplit items — not both.Background And InterfacesVL10 creates many deliveries in one run; the exitruns per delivery.An error message in SAVE_DOCUMENT_PREPARE preventsthat delivery from being created and appears inthe collective processing log.LE_SHP_DELIVERY_PROC (Classic BAdI)Methods such as CHANGE_DELIVERY_HEADER,CHANGE_DELIVERY_ITEM, SAVE_DOCUMENT_PREPARE,SAVE_AND_PUBLISH_DOCUMENT and CHECK_ITEM_DELETION…3 · REMEMBER · WATCH OUTRememberMV50AFZ1 contains the delivery exits of SAPMV50A:USEREXIT_SAVE_DOCUMENT_PREPARE and USEREXIT_SAVE_DOCUMENT are the most…Data: LIKP (header), XLIPS/YLIPS (items new/old with UPDKZ), XVBPA(partners), XVBFA (document flow).Deliveries are often created in background (VL10 collectiveprocessing) and via IDocs — exits must not rely on dialog.!Watch outFor many delivery requirements,SAP's classic BAdILE_SHP_DELIVERY_PROC offers cleanermethods — check it first.4 · IN A REAL PROJECTA batch check in the delivery exit rejected valid deliveries in VL10 runs. The code checked all XLIPS entries,including batch split sub-items whose main item had no batch by design. Restricting the check to main items(UECHA initial) and looking for sub-items fixed it. The collective processing log now showed only real errors…Original ERPClimb learning sheet • Verify against your SAP release and edition

Explanation

Part 4 covered sales orders. Deliveries follow the same user-exit pattern, but with different tables, and considerably more background processing to account for.

MV50AFZ1 contains the delivery exits of SAPMV50A: USEREXIT_SAVE_DOCUMENT_PREPARE and USEREXIT_SAVE_DOCUMENT are the most used. USEREXIT_SAVE_DOCUMENT_PREPARE handles checks and final changes right before save — blocking a delivery, setting a Z field, validating batch assignments. USEREXIT_SAVE_DOCUMENT runs during the save itself, typically writing to your own custom tables through the update task. USEREXIT_MOVE_FIELD_TO_LIKP and its _LIPS counterpart fill header and item fields during creation, and depending on release these FORMs live in MV50AFZ1 or a related include.

On data: LIKP (header), XLIPS/YLIPS (items new/old with UPDKZ), XVBPA (partners), XVBFA (document flow). XLIPS specifically holds both the main delivery items and any batch-split sub-items, where UECHA points to the higher-level item. For quantity checks, use either the main item or the sum of its split items — never both at once, or quantities get double-counted — and deleted items, marked with UPDKZ = 'D', should be skipped entirely.

Free account

Create a free account to keep reading

You have read the opening of this lesson. A free ERPClimb account unlocks the rest of it, every other lesson and topic, and your learning history, so you can pick up exactly where you stopped. No card needed.

  • Full explanation
  • Code example
  • Real project scenario
  • Common mistakes
  • Best practices
  • Interview angle

One tap with Google works too. Every topic keeps its first lesson open to everyone.

Keep exploring

Referenced SAP objects

Reviewed reference pages for the objects this page mentions.

Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.