cancel
Showing results for 
Search instead for 
Did you mean: 

When "Data Transfer" Rouitne is excuted while copying from Order to Billing

Former Member
0 Kudos

Hi,

I posed the same question in SD-General, but did not get any response. Thought to try my luck here....

(Please keep in the mind that the Order--> Billing Scenario is discussed below)

While doing the config for copy control from Order to Billing document, we enter the Data Transfer Routine (at ItemCat level) via Data VBRK/VBR

Now, the question is at what point of time this routine is called? e.g. Is the data for the billing document already entered in Billing Tables (VBRK & VBRP) before the transfer routine is called? From the definition of it looks like if this routine is called at some point in between data transfer from Order to Billing, however, I have seen some data transfer routine code, where the data from VBRK/VBRP is referred (with select statement) and then filed ZUKRI in VBRK is manipulated , say, for Billing Split.

If my above understanding is correct, that data transfer routine is executed after the table (VBRK/VBRP) tables are updated, then suppose we are now doing billing split within this routine, that means more rows will be created within these tables (VBRK/VBRP) for the new billings generated out of the billing splits in the routine?

I guess, I am looking for the Life Cycle (various steps 1) while creating Billing from Order. The steps like at what point the billing tables are updated/modified, at what point the various routines like Copy Control, Data Transfer etc are executed.

Thanking all of you in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

the best way to understand the process is to have a look at the coding:

FORM FAKTURAPOSI_AUFTRAGBEZOGEN (LV60AA29) <<<< processing the items

...

perform vbrk_vbrp_fuellen.

perform fakturadaten_auftragbezogen.

...

if tvcpf-grbed ne 0.

bedmodul-nr = tvcpf-grbed.

perform (bedmodul) in program saplv60a.

...

perform vbrk_vbrp_datentransport using rc. <<<<<< data transfer routine is executed here

So yes, VBRK and VBRP are already filled at this point of time but you have the possibility to change fields or initiate a split.

Balazs

Former Member
0 Kudos

Thanks Balazs,

Just a bit more clarification -

Scenario - Billing Split based on manipulation in this routine.

Step 1- The data for the original Billing is already there in VBRK/VBRP

Step 2- The Data Transfer Routine kicks in and, say, two billing documents are generated out of the original one (the one whose data is already in tables VBRK/VBRP)

Step 3- The data for two billings generated in step 2 are stored in VBRK/VBRP and the data for the original billing document (from step 1) is deleted.

Is my above overview/understanding correct?

Former Member
0 Kudos

well, not quite. It is not so simple.

First you will have only 1 line in VBRK (this is important). However if the programm finds different VBRK data (either reads them from the reference documents or is caused by the routine), it creates another line in VBRK (XVBRK in fact). So there is no 'original' invoice, just lines in XVBRK. Check also note 11162.

Balazs

Former Member
0 Kudos

Thanks again.

The VBRK is table and XVBRK is referencing the structure VBRPVB (Reference Structure for XVBRP/YVBRP)...right.

When you say ..... "First you will have only 1 line in VBRK (this is important)." ...means there is already original data in the table .....as I understand in my Step 1.

Now, when you say ... "However if the programm finds different VBRK data (either reads them from the reference documents or is caused by the routine), it creates another line in VBRK (XVBRK in fact). So there is no 'original' invoice, just lines in XVBRK."......, that what I meant in my Step 2. To achieve this, the System is using it's internal structure (XVBRK,...etc).

The scenario is - from one invoice we are splitting to two. Which means we are talking about three invoices altogether...right. First is the original one and second & third are the one which are created from first original invoice, in the routine. By end of day, the System should have ONLY two invoices generated from the Original invoice (via routine), and the Original invoice SHOULD NOT be in the System, Won't this original invoice be deleted from the table VBRK (the one you are saying "First you will have only 1 line in VBRK (this is important).")

Former Member
0 Kudos

hello,

there seems to be a misunderstanding. There are no three invoices involved. Lets say you have two deliveries for which you would like to create two invoices. Hoewever as all the important data are similar system would create only one invoice. Now you implement your copy routine and change fields so that

system will create one invoice to each delivery so in the end you will have two invoices alltogether.

If you already have an invoice (saved on DB into VBRK/VBRP) you cannot split it. First you have to cancel it and invoice its reference document again with your routine active so that you'll get two billing documents.

Balazs

Answers (0)