Sub topic 14
Troubleshooting Incomplete or Blocked Document Flows
This chapter assumes you can read a document flow in the SAP GUI (VA03, ME23N) and browse tables in SE16N. It also assumes you know the order-to-cash and procure-to-pay chains from the earlier chapters. The ABAP examples need only basic SELECT syntax.
Two Kinds of Problem
Problems with a document flow fall into two groups:
- A follow-on document cannot be created. The next step stays blocked, so the link never comes into existence.
- The flow looks wrong. A document exists but is missing from the display, or it appears under an unexpected predecessor.
The two groups need different checks. In the first, the link is absent because the process stopped. In the second, the link may be present while a status, a cancellation or a different table hides it. Decide which group you are in before you open any configuration.
A Diagnostic Order
Work from the cheapest check to the most expensive one. Document blocks and statuses take seconds to read. Copy control and account determination need configuration access and often a consultant.
Sales-Side Blockers
The table lists the usual causes in sales and distribution, with where to look.
| Symptom | Likely cause | Where to check |
|---|---|---|
| No delivery can be created | Delivery block (header `LIFSK` or schedule line), credit block, incomplete data, or a confirmed quantity of zero | VA02 header, incompletion log, VKM1 for credit |
| Item is skipped in the delivery due list | Item rejected, or the item category is not relevant for delivery | VA03 item, item category configuration |
| No invoice from a delivery | Goods issue not posted, billing block, or the item is not relevant for billing | VL03N, VF04 log |
| Invoice exists but has no accounting document | Posting to accounting failed, for example from account determination or a closed posting period | VFX3, then VKOA and OB52 |
| Document type not offered as a follow-on | Copy control entry missing for the source and target type | VTAA, VTLA, VTFA, VTFL |
Two details trip people up. The billing block can sit on the header (FAKSK) or on a single item or schedule line, so a header that looks clean does not guarantee billable items. The incompletion log also depends on the incompletion procedure assigned to the document type or item category. A field that is mandatory in one document type may be optional in another.
Reading Blocks and Status in Tables
When the GUI is unclear, or you need to check many documents, read the fields directly. This report shows the header blocks of one sales order.
REPORT z_check_order_blocks.
PARAMETERS p_order TYPE vbeln_va OBLIGATORY.
SELECT SINGLE vbeln, auart, lifsk, faksk
FROM vbak
WHERE vbeln = @p_order
INTO @DATA(ls_header).
IF sy-subrc <> 0.
WRITE: / 'Order not found'.
ELSE.
WRITE: / 'Order', ls_header-vbeln, 'type', ls_header-auart.
WRITE: / 'Delivery block:', ls_header-lifsk.
WRITE: / 'Billing block:', ls_header-faksk.
ENDIF.A blank value means no header block. The overall status fields live in different places depending on the release. In SAP ECC they are in VBUK and VBUP. In SAP S/4HANA they were moved into the document tables themselves, and the old tables remain only as compatibility views. Check which release you are on before you choose a table.
Finding Gaps with VBFA
An incomplete flow often means a delivery that was never invoiced. You can search for that gap instead of opening each document. This query lists delivery items of one order that have no billing document as a follower.
REPORT z_find_unbilled_deliveries.
PARAMETERS p_order TYPE vbeln_va OBLIGATORY.
SELECT d~vbeln, d~posnn
FROM vbfa AS d
WHERE d~vbelv = @p_order
AND d~vbtyp_n = 'J'
AND NOT EXISTS ( SELECT i~vbeln
FROM vbfa AS i
WHERE i~vbelv = d~vbeln
AND i~posnv = d~posnn
AND i~vbtyp_n = 'M' )
INTO TABLE @DATA(lt_unbilled).
IF lt_unbilled IS INITIAL.
WRITE: / 'Every delivery item has an invoice link.'.
ELSE.
LOOP AT lt_unbilled INTO DATA(ls_item).
WRITE: / 'No invoice for delivery', ls_item-vbeln, 'item', ls_item-posnn.
ENDLOOP.
ENDIF.Category J is a delivery and M is an invoice. A cancelled invoice still counts as a follower, but its cancellation document carries category N. So a delivery item with an invoice and a cancellation shows no gap here, even though it is effectively unbilled. Compare the invoice quantities with the delivered quantities before you trust the result.
Purchasing Gaps
The purchase order history (EKBE) is written when a follow-on document is posted, not when it is entered. Most "missing history" cases come from that rule:
- Parked invoices. An invoice parked in MIR7 has no EKBE entry until it is posted.
- Goods-receipt-based invoice verification. If the PO item has the indicator set, MIRO refuses an invoice for quantities that have no goods receipt. Post the receipt first.
- Blocked invoices. An invoice that exceeds a tolerance is posted with a block. It shows in the history but cannot be paid until you release it in MRBR.
- Delivery completed or final invoice indicators. These flags on the PO item stop further receipts or invoices. Check them when MIGO or MIRO rejects a quantity that looks valid.
For a quick look, select by purchase order and separate the movement types with VGABE: 1 for goods receipt, 2 for invoice receipt and 3 for subsequent debit or credit. If you see receipts but no value 2 rows, the invoice was never posted. If you see value 2 rows with no matching receipt, check the invoice verification setting above.
Accounting Gaps
The link from a business document to its financial posting is stored in the reference fields of BKPF. A billing document that is not released to accounting has no BKPF row. In that case, check the billing document header status RFBSK before you look in BKPF.
REPORT z_billing_without_fi.
PARAMETERS p_from TYPE fkdat OBLIGATORY.
SELECT vbeln, fkart, fkdat, rfbsk
FROM vbrk
WHERE fkdat >= @p_from
AND rfbsk <> 'C'
AND fksto = @space
INTO TABLE @DATA(lt_blocked).
LOOP AT lt_blocked INTO DATA(ls_bill).
WRITE: / ls_bill-vbeln, ls_bill-fkart, ls_bill-fkdat, ls_bill-rfbsk.
ENDLOOP.
IF lt_blocked IS INITIAL.
WRITE: / 'No uncleared billing documents found.'.
ENDIF.Status C means the posting to accounting is complete. Any other value on a non-cancelled invoice deserves a look in VFX3. The error log there normally names the cause, such as a missing G/L account in the account determination or a closed posting period.
When the Flow Is Not Missing, Just Different
Some flows only look incomplete:
- Cancelled documents. A cancelled invoice stays in the flow, and its cancellation document appears next to it. The original invoice is not removed.
- Returns. A return order is a new flow that references the original invoice. It appears in the flow of the invoice, not as a gap.
- Collective processing. One invoice can combine several deliveries, so one document can have several predecessors.
- Authorization. A user without display rights for a follow-on document may see a shorter flow than a colleague.
A Short Checklist
- Name the missing step: delivery, goods receipt, invoice or accounting document.
- Open the predecessor and check its status and every block field.
- Open the incompletion log, if the object supports one.
- Read the due-list or collective-run log (VF04, VL10, VFX3, MRBR).
- Only then check copy control, item category and account determination.
Exercise
A billing document exists for a delivery, but searching BKPF with AWTYP = 'VBRK' and its number returns no rows. Which field do you check first, and in which transaction do you look for the cause?
Show answer
Check the billing document status RFBSK in VBRK. A value other than C means the posting to accounting is not complete. Open VFX3 to read the error log, which usually points to account determination or a closed posting period.
Exercise
A purchase order shows goods receipts in EKBE, and the user says the invoice was entered yesterday. EKBE has no row with VGABE = 2. Give two likely reasons.
Show answer
The invoice may be parked (MIR7) and not yet posted, or the posting may have failed. EKBE is written only when the invoice is posted, so an entered but unposted invoice leaves no history entry.
Exercise
Why does the NOT EXISTS query for unbilled deliveries miss a delivery whose invoice was cancelled?
Show answer
The cancelled invoice still has a VBFA link of category M from the delivery, so the delivery looks billed. The cancellation document is a separate row with category N. You must compare invoiced and delivered quantities to find the real gap.