Extensibility Billing Document Output
Extensibility Billing Document Output
Extensibility Billing Document Output
3
1 Provide Purchase Order Date in Billing Document Output
1.1 Aim
1.2 Steps to do
This extension field is intended to store the Purchase Order Date with the Billing Document.
Remark: The extension field will only be filled when triggering the output request.
4
Save and publish the extension field.
5
Add the following example code to the Draft:
* This method can be used to set values for output to billing document header
extension fields.
billingdoc_extension_out = billingdoc_extension_in.
billingdocdescr_extension_out = billingdocdescr_extension_in.
*get SO number
select single salesdocument
from i_billingdocumentitem
into @data(lv_salesdocument)
where billingdocument = @billingdoc-billingdocument.
*get PO date
select single customerpurchaseorderdate
from i_salesdocument
into @billingdoc_extension_out-yy1_purchaseorderdate_bdh
where salesdocument = @lv_salesdocument.
Remark: To see the new created extension field in the Billing Document Printout, it is necessary to create a new Form
Template.
6
2 Provide Exchange Rate in Billing Document Output
2.1 Aim
2.2 Steps to do
Note: The fields Absolut Accounting Exchange Rate and Accounting Exchange Rate Is Indirect Quotation
already exist in the Standard Form Data Provider in the Billing Document Node. Please verify if the data is
sufficient.
This extension field is intended to store the Exchange Rate with the Billing Document.
Remark: The extension field will only be filled when triggering the output request.
7
2.2.2 Extend the Form Template with the Extension Field
Within the same App Custom Fields and Logic and tab Custom Field extend the Form Templates for the
Billing Document with the extension field.
8
Add the following example code to the Draft:
if billingdoc-transactioncurrency ne 'SGD'.
*get Exchange Rate
select single accountingexchangerate
from i_billingdocumentbasic
into @data(lv_exchangerate)
where billingdocument = @billingdoc-billingdocument.
if sy-subrc is initial.
billingdoc_extension_out-yy1_exchangerate_bdh = 1 / lv_exchangerate.
endif.
endif.
Remark: To see the new created extension field in the Billing Document Printout, it is necessary to create a new Form
Template.
9
3 Provide Net Amount in Billing Document Output
3.1 Aim
3.2 Steps to do
This extension field is intended to store the Net Amount with the Billing Document.
Remark: The extension field will only be filled when triggering the output request.
10
Save and publish the extension field.
11
Add the following example code to the Draft:
Remark: To see the new created extension field in the Billing Document Printout, it is necessary to create a new Form
Template.
12
4 Provide Created On Date in Billing Document Output
4.1 Aim
4.2 Steps to do
This extension field is intended to store the Created On Date with the billing document.
Remark: The extension field will only be filled when triggering the output request.
13
Save and publish the extension field.
14
Add the following example code to the Draft.
billingdoc_extension_out-yy1_created_on_date_bdh = billingdoc-creationdate.
Remark: To see the new created extension field in the Billing Document Printout, it is necessary to create a new Form
Template.
15
5 Provide Customer Material in Billing Document Output
5.1 Aim
5.2 Steps to do
This extension field is intended to store the Customer Material with the Billing Document.
Remark: The extension field will only be filled when triggering the output request.
16
Save and publish the extension field.
17
Add the following example code to the Draft:
* This method can be used to set values for output to billing document item
extension fields.
billingdocitem_ext_out = billingdocitem_ext_in.
billingdocitemdescr_ext_out = billingdocitemdescr_ext_in.
Remark: To see the new created extension field in the Billing Document Printout, it is necessary to create a new Form
Template.
18
6 Provide Country Of Origin in Billing Document Output
6.1 Aim
6.2 Steps to do
This extension field is intended to store the Country Of Origin with the Billing Document Item.
Remark: The extension field will only be filled when triggering the output request.
19
Save and publish the extension field.
20
6.2.3.1 Select Country of Origin from table MARC:
21
Remark: To see the new created extension field in the Billing Document Printout, it is necessary to create a new Form
Template.
22
7 Provide Commodity Code in Billing Document Output
7.1 Aim
7.2 Steps to do
This extension field is intended to store the Commodity Code with the Billing Document Item.
Remark: The extension field will only be filled when triggering the output request.
23
Save and publish the extension field.
24
* First of all assign existing extension field values to output parameter:
billingdocitem_ext_out = billingdocitem_ext_in.
billingdocitemdescr_ext_out = billingdocitemdescr_ext_in.
*
* Read commodity code for specific product:
SELECT SINGLE commoditycode
FROM c_prodcommoditycodeforkeydate( p_keydate = @billingdoc-
billingdocumentdate )
WHERE product = @billingdocitem-material
AND country = @billingdocitem-DepartureCountry
INTO @billingdocitem_ext_out-YY1_CommodityCode_BDI.
Remark: To see the new created extension field in the Billing Document Printout, it is necessary to create a new Form
Template.
25
8 Provide Tax Code in Billing Document Output
8.1 Aim
8.2 Steps to do
This extension field is intended to store the Tax Code with the Billing Document Item.
Remark: The extension field will only be filled when triggering the output request.
26
Save and publish the extension field.
27
AND billingdocumentitem = @billingdocitem-billingdocumentitem
AND pricingprocedurestep = '850'
INTO @billingdocitem_ext_out-yy1_taxcode_bdi.
Remark 1: The pricing procedure step depends on the pricing scheme and in case of customer pricing scheme the value
could differ.
Remark 2: To see the new created extension field in the Billing Document Printout, it is necessary to create a new Form
Template.
28
9 Provide ATF License in Billing Document Output
9.1 Aim
9.2 Steps to do
This extension field is intended to store the ATF License with the Billing Document Item.
Remark: The extension field will only be filled when triggering the output request.
29
Save and publish the extension field.
30
select single ExtTrdCmplncLicense
from C_TrdCmplncDocItmLicAssgmt
where referencedocument = @billingdocitem-referencesddocument
and referencedocumentitem = @billingdocitem-referencesddocumentitem
into @billingdocitem_ext_out-yy1_atf_license_bdi.
Remark: To see the new created extension field in the Billing Document Printout, it is necessary to create a new Form
Template.
31