Showing results for 
Search instead for 
Did you mean: 

Very strange and complex problem

Former Member
0 Kudos

Hi to all,

This is my problem:

I need to post the print output from the SD invoice document into the MM invoice document.

The first thing is to generate the output type in the SD billing with the Storage Mode 3 (print and archive), that will create an entry in TOA01 table.

So then, with a second Output Type in MM, the program will read the entry in TOA01. Will copy the SD ARC_DOC_ID and create through FM ARCHIV_CONNECTION_INSERT an entry in TOA01 for the MM invoice but with the SD document ID.

In that way the same attachment from the SD billing (VF01) will be posted into the MM invoice (MIRO).

For some reason this do not work. When the user attemp to open the attachment in the MM logistic inovice in MIR4, the system send an error message. I do not why and the way to solve this.

The details for this development are the followings:

1. Create a new output type ZPDF and a new custom program (assigned to ZPDF output) in order to post the invoices from CoCo GBXX and NL05 in the MM invoice CoCo NLXX. The MM invoice number is recorder into NAST table into NAST-OBJKY:

The MM invoice number is 510XXXXXXX

2011 is the year.

2. Enter to table RBKP with MM invoice number RBKP-BELNR and get the SD invoice number: RBKP-XBLNR.

MM invoice number: 510560XXXX (comes from the output type ZPDF)

SD invoice number: 0030000XXXX (RBKP-XBLNR).

3. Enter with SD invoice number XBLNR to table TOA01-OBJECT_ID.

And get TOA01-ARC_DOC_ID:

TOA01-ARC_DOC_ID= 4E88A704C9D56FFFE10000000A5E0A2D

(Important: if the program couldn´t find any value in TOA01, finish the process without posting anything)

4. I f the program found a record in point three, go to FM ARCHIV_CONNECTION_INSERT with the following parameters:


u2022 ARCHIV_ID Z0 (always Z0).


u2022 AR_DATE The current date- Example: 13.10.2011


u2022 DEL_DATE (leave blank).

u2022 MANDANT 100

u2022 OBJECT_ID 510560XXXXXXX (RBKP-BELNR - The MM invoice number follows with the document year).

u2022 SAP_OBJECT BUS2081 (always BUS2081)

u2022 DOC_TYPE


Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Problem solved. There where 2 problems:

1. I had 2 different contenent server: Z0 and M0. Shoul be the same.

2. In test system the archive function was not active.

Thanks to all.

Former Member
0 Kudos

Hi Fred,

Your solution looks very complex.

Why don't you create a new message in the MM invoice with a smartform or sapscript that replicates SD invoice form?