cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Document xxxxxx does not exist - Intercompany sales - RD04

aravindrawat
Participant
0 Kudos
31,642

Hi,

We are currently implementing the Intercompany Sales process. Most of the flow is working as expected, but we’re encountering an issue during the creation of the AP invoice from message type RD04.

Although the IDoc is being generated, it fails with the error: "Document xxxxxx does not exist." The value "xxxxxx" is being pulled from the PO Number field in the sales order. However, in our process, no purchase order is being created in MM.

Here’s a brief overview of the steps we’re following:

  1. Sales order

  2. Delivery

  3. End customer invoice

  4. Intercompany invoice – RD04 – IDoc triggered to post vendor invoice

Since there is no MM purchase order in this flow, we’re unsure what the RD04-generated IDoc is supposed to match against on the MM side.

We would appreciate any insights or experiences from others who have implemented Intercompany Sales (not just standard Intercompany flow) and have successfully posted the vendor invoice without a corresponding PO.

Thanks in advance for your support!

Accepted Solutions (0)

Answers (1)

Answers (1)

Ndubuisi_PALMER
Explorer
0 Kudos

Hello

 Root Cause

RD04 is used in the Intercompany Billing (IV invoice) scenario to post the Accounts Payable invoice in the purchasing company code.
However, RD04 expects some form of reference to create the FI document — most commonly a Purchase Order (PO).

If your process does not include an MM PO, but still uses RD04, this can cause the error because:

  • The IDoc (type INVOIC) looks for a document reference (usually from field E1EDK02 with qualifier “001” – Purchase Order).
  • If this reference is filled (e.g. with the SO PO number), but there’s no corresponding MM document in the receiving system, the posting fails.

 Clarifications for Your Process

You're doing:

  1. Sales Order (Company A to End Customer, with internal partner)
  2. Delivery
  3. End-customer Billing (Company A)
  4. Intercompany Billing (Company B to Company A)
  5. RD04 sends IDoc from SD Billing in Company B to create AP invoice in Company A (vendor: Company B)

In this case:

  • There is no PO, but RD04 still tries to post an MM invoice (MIRO-like logic) using the reference in the IDoc.
  • If the IDoc includes a PO number (e.g., copied from the Sales Order field), but no PO exists in Company A, the system will not find a match and gives the error: “Document xxxxxx does not exist.”

Solution Options

Option 1: Use FI Posting Instead of MM Posting

Change the processing logic of RD04 to post a direct FI invoice (FB60 style) instead of an MM invoice. This can be done by:

  • Adjusting partner profile (transaction WE20) for RD04 to trigger function module IDOC_INPUT_INVOIC_FI instead of IDOC_INPUT_INVOIC_MM.
  • This tells the system to bypass the PO requirement and create a vendor invoice directly.

This approach is preferred when no PO exists.

Option 2: Custom Mapping or Enhancement

If your system still attempts MM processing and you want to keep the standard flow:

  • Create a dummy PO automatically to support the invoice posting.
  • Or, implement a user exit / BAdI in IDoc processing to remove or adjust the reference segment (E1EDK02) that points to a non-existent PO.

Option 3: Align Document References

Ensure that the IDoc does not contain a PO number in the segment if one doesn’t exist.
In transaction WE19, test the IDoc by removing the reference segment and see if the system accepts it for FI posting.

Best regards