Uploaded by Uyên Nguyễn Lê Thủy

Billing split routine

advertisement
Steps to create a routine for the Billing spilt scenario for down payment Poland
Step 1. Execute Tcode VOFM.
Step 2: Navigate to the path Data Transfer- Billing documents
A screen as shown below will be displayed.
Step 3: Create a routine in the customer namespace (501-999), for ex 999.
Now select this newly created entry and press on save icon
program will be created, in this case RV60C999.
from the menu bar. An include
Step 4: Select the newly created entry and press F5 or the source text icon (
toolbar.
) from the application
The following screen appears.
Step 5: Copy and paste the following code in the include program.
* Identify additional Split criteria
DATA: BEGIN OF zuk,
vbeln TYPE vbak-vbeln,
END OF zuk.
DATA: lt_idpl TYPE TABLE OF idpl_dp.
* Component check for country - Poland
CALL FUNCTION 'J_1BSA_COMPONENT_ACTIVE'
EXPORTING
bukrs
= vbrk-bukrs
component
= 'PL'
EXCEPTIONS
component_not_active = 1
OTHERS
= 2.
IF sy-subrc = 0.
SELECT * FROM idpl_dp INTO TABLE lt_idpl WHERE aubel = vbak-vbeln.
IF sy-subrc = 0.
zuk-vbeln = vbak-vbeln.
vbrk-zukri = zuk.
ELSE.
CLEAR vbrk-zukri.
ENDIF.
ENDIF.
Save and activate this include program.
Important: This copy routine needs to be used at the time of creation of billing document. If in the
below mentioned settings, you are using any other SAP standard routine (example 002), then you need
to copy that piece of code at the beginning of this routine 999.
Step 6: select the routine and activate it.
The check box will be ticked upon the successful activation of the routine.
Step 7: Assign the routine (999) in the copy control for the billing documents.
(A) Copy control: Sales document to billing document
Execute the tcode VTFA or navigate as per the path mentioned below from SPRO.
SPRO -> Sales and Distribution -> Billing -> Billing documents -> Maintain copy controls for Billing
documents -> Copying control: Sales document to billing document.
Select the billing type and the order combination and view its item level details, by double
clicking the item node. For example:- billing type F2 and the sales doc type OR.
The following screen appears.
Now select the relevant item category and click on the details icon (
) or press
(Ctrl+shift+F2). Item category TAD has been selected as an example in the following screen
shots.
Now, assign the routine created in step3 to the Data VBRK/VBRP field and save.
(B) Copy control: Delivery document to billing document
Execute the tcode VTFL or navigate as per the path mentioned below from SPRO.
SPRO -> Sales and Distribution -> Billing -> Billing documents -> Maintain copy controls for Billing
documents -> Copying control: Delivery document to billing document.
Select the billing type and the order combination and view its item level details, by double
clicking the item node. For ex:- billing type F2 and the delivery doc type LF.
The following screen appears.
Now select the relevant item category and click on the details icon (
) or press
(Ctrl+shift+F2). Item category TAN has been selected as an example in the following screen
shots.
Now, assign the routine created in step3 to the Data VBRK/VBRP field and save.
Download