YATIRIMTESVIK scenario support through Extensibility in DRC Türkiye

This blog post introduces a guide on how to implement the new legal requirement released by GIB (*******) for invoices issued under a valid Investment Incentive Certificate (Yatırım Teşvik Belgesi – YTB) through Developer Extensibility for Document and Reporting Compliance Türkiye in SAP S/4HANA Public Cloud.


Background 
We have already published a Developer Extensibility for Document and Reporting Compliance Türkiye in SAP S/4HANA Public Cloud on how S/4HANA Public Cloud customers can leverage developer extensibility to modify content of XMLs produced during electronic invoice submissions, pertaining to specific business and legal requirements.

Note for: SAP S/4HANA Private Cloud and ECC environments: 

In SAP S/4HANA Private Cloud and ECC environments, the exact same process exists through extensibility, however the BAdi implementation would have to be done for EDOC_ADAPTOR instead of EDOC_ADAPTOR_CLOUD.

What’s New? 
GIB has published a legal requirement pertaining to invoices issued under valid Investment Incentive Certificate which impacts a few companies on 21st November, 2025. In this blog we would aim to address the requirement through the learnings of the previous blog highlighted in the background.

What’s the technical specifications of the requirement? 
Currently system does not automatically determine whether a billing or finance document is YTB-related or not. The customer must explicitly indicate that the invoice belongs to a YTB investment project and provide the necessary values. As part of the legal requirement authority following is an easy requirement with an UBL (Universal Business Language, an ISO standard XML) representation:

New Profile IDsYATIRIMTESVIK – for eInvoicing scenarios EARSIVFATURA – for eArchive scenarios New Invoice Type Codes under each invoicing scenariosYATIRIMTESVIK – for eInvoicing scenarios.SATIS – Sales invoicesISTISNA – Exception invoicesIADE – Refund or Return invoicesEARSIVFATURA – for eArchive scenariosYTBSATIS – consumer/eArchive sales invoice YTBISTISNA – consumer/eArchive exception invoicesYTBIADE – consumer/eArchive refund/return invoicesMapping of new identification tag – ContractDocumentReference <ContractDocumentReference>ID field should be the filled up with the incentive certificate numberschemeID of this would be “YTBNOIssueDate should be filled up with the investment certificate date in DD/MM/YYYY format Adjustments to existing tag – TaxTotal <TaxTotal>The waived VAT amount should be shown in XPath TaxTotal/TaxSubtotal/TaxAmount only if profileID is YATIRIMTESVIK with invoice type value is ISTISNA, or profileID is EARSIVFATURA with invoice type value is YTBISTISNA.Reason codes similar to tax exemption reason codes have been introduced as part of the technical structure from GIB available at their website. These reason codes have to be filled in XPath TaxTotal/TaxSubtotal/TaxCategory/TaxExemptionReasonCode.Subsequently new reason code descriptions have also been introduced as part of the technical structure which should go in the XPath TaxTotal/TaxSubtotal/TaxCategory/TaxExemptionReason corresponding the reason code filled in above step. Adjustments to existing tag – InvoiceLine <InvoiceLine>For YTB related scenarios the XPath tag InvoiceLine/Item/CommodityClassification/ItemClassificationCode should be filled with 01, 02, 03, or 04 in case of the scenario of profile ID of YATIRIMTESVIK/EARSIVFATURA.In case the ItemClassificationCode is 01 (Machine Equipment), and reason code in TaxExemptionReason is 308 as per the legal requirement, then XPath tag InvoiceLine/Item/Name should be filled with machin nameXPath tag InvoiceLine/Item/ItemInstance/Name should be filled with Machine ID.XPath tag InvoiceLine/Item/ItemInstance/ProductTraceID should be filled with the Machine Sequence Number/Equivalent details

How does a sample code looks like using Developer Extensibility?

The prerequisites, roles and BAdI Enhancement Implementation names have already been mentioned in our previous blog (details – Developer Extensibility for Document and Reporting Compliance Türkiye in SAP S/4HANA Public Cloud ).

Let’s illustrate how this can be tailored to suit the above legal requirement.

FIELD-SYMBOLS:
<lfs_cs_doc_data> TYPE edo_tr_inv_ubl_format_req,
<fs_invoice_tab> TYPE edo_tr_e_doc_turkey_invoic_tab,
<fs_invoice_el> TYPE edo_tr_e_doc_turkey_invoice_el,
<fs_payment_means_tab> TYPE edo_tr_payment_means_tab,
<fs_add_doc_ref> TYPE edo_tr_additional_document_tab.

ASSIGN COMPONENT ‘DOC_DATA’ OF STRUCTURE cs_output_data TO FIELD-SYMBOL(<lv_data>).
IF <lv_data> IS ASSIGNED.
IF iv_edoc_type = ‘TR_BINV’. “Turkey Basic eInvoice
IF iv_interface_id NE ‘TR_GETSTATUS_REQ’.
ASSIGN COMPONENT ‘PARAMETERS’ OF STRUCTURE cs_output_data TO <lv_data>.
IF <lv_data> IS ASSIGNED.
ASSIGN cs_output_data TO <lfs_cs_doc_data>.
IF <lfs_cs_doc_data> IS ASSIGNED.
ASSIGN <lfs_cs_doc_data>-parameters-package-elements TO <fs_invoice_tab>.
IF <fs_invoice_tab> IS ASSIGNED.
LOOP AT <fs_invoice_tab> ASSIGNING <fs_invoice_el>.
* This is just a sample implementation, you can decide on the conditional assignment based on your business needs.
<fs_invoice_el>-element_list-invoice-profile_id-base-base-content = ‘YATIRIMTESVIK’.
<fs_invoice_el>-element_list-invoice-invoice_type_code-base-base-content = ‘SATIS’.
” Filling up ContractDocumentReference
<fs_invoice_el>-element_list-invoice-contract_document_reference =
VALUE #( ( id-base-base-content = ‘1234567890’
id-base-base-scheme_id = ‘YTBNO’
issue_date-base-content = ‘19990912’ ) ).
” Filling up TaxTotal
<fs_invoice_el>-element_list-invoice-tax_total =
VALUE #( ( tax_subtotal =
VALUE #( ( tax_amount-base-content = ‘123.40’
tax_amount-base-currency_id = ‘TRY’
tax_category-tax_exemption_reason_code-base-base-content = ‘308’
tax_category-tax_exemption_reason-base-base-content = ‘Delivery of Investment Goods under Incentive Scheme 13/d’ ) ) ) ).
” Filling up InvoiceLine
LOOP AT <fs_invoice_el>-element_list-invoice-invoice_line ASSIGNING FIELD-SYMBOL(<lfs_invoice_line>).
<lfs_invoice_line>-item-commodity_classification = VALUE #( ( item_classification_code-base-base-content = ’01’ ) ).
READ TABLE <lfs_invoice_line>-item-commodity_classification ASSIGNING FIELD-SYMBOL(<lfs_comm_class>)
WITH KEY item_classification_code-base-base-content = ’01’.
IF sy-subrc IS INITIAL.
<lfs_invoice_line>-item-name-base-base-content = ‘Machine Name’.
<lfs_invoice_line>-item-item_instance = VALUE #( ( serial_id-base-base-content = ‘9999999999’
product_trace_id-base-base-content = ‘7878787878787878’ ) ).
ENDIF.
ENDLOOP.
ENDLOOP.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.

*Disclaimer – This is just a sample code; actual business conditions are not depicted through this.

Result: 

When you display the XML file of the electronic document in the eDocument Cockpit(EDOC_COCKPIT) corresponding to the above invoicing scenario, you will see that the mentioned tags populated. Please note that based on actual submission of this document to authorized service provider, error handling and troubleshooting can be tackled.

Conclusion 
With recent enhancements to the Türkiye Document and Reporting Compliance solution, SAP has made it significantly easier to cater to targeted and industry specific legal requirements in electronic document outputs. 

This improvement gives you more flexibility and helps ensure compliance with Türkiye’s legal requirements. This blog is the first of the many blogs coming up to demonstrate legal requirements in an easy consumable way

 

​ This blog post introduces a guide on how to implement the new legal requirement released by GIB (*******) for invoices issued under a valid Investment Incentive Certificate (Yatırım Teşvik Belgesi – YTB) through Developer Extensibility for Document and Reporting Compliance Türkiye in SAP S/4HANA Public Cloud.Background We have already published a Developer Extensibility for Document and Reporting Compliance Türkiye in SAP S/4HANA Public Cloud on how S/4HANA Public Cloud customers can leverage developer extensibility to modify content of XMLs produced during electronic invoice submissions, pertaining to specific business and legal requirements.Note for: SAP S/4HANA Private Cloud and ECC environments: In SAP S/4HANA Private Cloud and ECC environments, the exact same process exists through extensibility, however the BAdi implementation would have to be done for EDOC_ADAPTOR instead of EDOC_ADAPTOR_CLOUD.What’s New? GIB has published a legal requirement pertaining to invoices issued under valid Investment Incentive Certificate which impacts a few companies on 21st November, 2025. In this blog we would aim to address the requirement through the learnings of the previous blog highlighted in the background.What’s the technical specifications of the requirement? Currently system does not automatically determine whether a billing or finance document is YTB-related or not. The customer must explicitly indicate that the invoice belongs to a YTB investment project and provide the necessary values. As part of the legal requirement authority following is an easy requirement with an UBL (Universal Business Language, an ISO standard XML) representation:New Profile IDsYATIRIMTESVIK – for eInvoicing scenarios EARSIVFATURA – for eArchive scenarios New Invoice Type Codes under each invoicing scenariosYATIRIMTESVIK – for eInvoicing scenarios.SATIS – Sales invoicesISTISNA – Exception invoicesIADE – Refund or Return invoicesEARSIVFATURA – for eArchive scenariosYTBSATIS – consumer/eArchive sales invoice YTBISTISNA – consumer/eArchive exception invoicesYTBIADE – consumer/eArchive refund/return invoicesMapping of new identification tag – ContractDocumentReference <ContractDocumentReference>ID field should be the filled up with the incentive certificate numberschemeID of this would be “YTBNO”IssueDate should be filled up with the investment certificate date in DD/MM/YYYY format Adjustments to existing tag – TaxTotal <TaxTotal>The waived VAT amount should be shown in XPath TaxTotal/TaxSubtotal/TaxAmount only if profileID is YATIRIMTESVIK with invoice type value is ISTISNA, or profileID is EARSIVFATURA with invoice type value is YTBISTISNA.Reason codes similar to tax exemption reason codes have been introduced as part of the technical structure from GIB available at their website. These reason codes have to be filled in XPath TaxTotal/TaxSubtotal/TaxCategory/TaxExemptionReasonCode.Subsequently new reason code descriptions have also been introduced as part of the technical structure which should go in the XPath TaxTotal/TaxSubtotal/TaxCategory/TaxExemptionReason corresponding the reason code filled in above step. Adjustments to existing tag – InvoiceLine <InvoiceLine>For YTB related scenarios the XPath tag InvoiceLine/Item/CommodityClassification/ItemClassificationCode should be filled with 01, 02, 03, or 04 in case of the scenario of profile ID of YATIRIMTESVIK/EARSIVFATURA.In case the ItemClassificationCode is 01 (Machine Equipment), and reason code in TaxExemptionReason is 308 as per the legal requirement, then XPath tag InvoiceLine/Item/Name should be filled with machin nameXPath tag InvoiceLine/Item/ItemInstance/Name should be filled with Machine ID.XPath tag InvoiceLine/Item/ItemInstance/ProductTraceID should be filled with the Machine Sequence Number/Equivalent detailsHow does a sample code looks like using Developer Extensibility?The prerequisites, roles and BAdI Enhancement Implementation names have already been mentioned in our previous blog (details – Developer Extensibility for Document and Reporting Compliance Türkiye in SAP S/4HANA Public Cloud ). Let’s illustrate how this can be tailored to suit the above legal requirement. FIELD-SYMBOLS:
<lfs_cs_doc_data> TYPE edo_tr_inv_ubl_format_req,
<fs_invoice_tab> TYPE edo_tr_e_doc_turkey_invoic_tab,
<fs_invoice_el> TYPE edo_tr_e_doc_turkey_invoice_el,
<fs_payment_means_tab> TYPE edo_tr_payment_means_tab,
<fs_add_doc_ref> TYPE edo_tr_additional_document_tab.

ASSIGN COMPONENT ‘DOC_DATA’ OF STRUCTURE cs_output_data TO FIELD-SYMBOL(<lv_data>).
IF <lv_data> IS ASSIGNED.
IF iv_edoc_type = ‘TR_BINV’. “Turkey Basic eInvoice
IF iv_interface_id NE ‘TR_GETSTATUS_REQ’.
ASSIGN COMPONENT ‘PARAMETERS’ OF STRUCTURE cs_output_data TO <lv_data>.
IF <lv_data> IS ASSIGNED.
ASSIGN cs_output_data TO <lfs_cs_doc_data>.
IF <lfs_cs_doc_data> IS ASSIGNED.
ASSIGN <lfs_cs_doc_data>-parameters-package-elements TO <fs_invoice_tab>.
IF <fs_invoice_tab> IS ASSIGNED.
LOOP AT <fs_invoice_tab> ASSIGNING <fs_invoice_el>.
* This is just a sample implementation, you can decide on the conditional assignment based on your business needs.
<fs_invoice_el>-element_list-invoice-profile_id-base-base-content = ‘YATIRIMTESVIK’.
<fs_invoice_el>-element_list-invoice-invoice_type_code-base-base-content = ‘SATIS’.
” Filling up ContractDocumentReference
<fs_invoice_el>-element_list-invoice-contract_document_reference =
VALUE #( ( id-base-base-content = ‘1234567890’
id-base-base-scheme_id = ‘YTBNO’
issue_date-base-content = ‘19990912’ ) ).
” Filling up TaxTotal
<fs_invoice_el>-element_list-invoice-tax_total =
VALUE #( ( tax_subtotal =
VALUE #( ( tax_amount-base-content = ‘123.40’
tax_amount-base-currency_id = ‘TRY’
tax_category-tax_exemption_reason_code-base-base-content = ‘308’
tax_category-tax_exemption_reason-base-base-content = ‘Delivery of Investment Goods under Incentive Scheme 13/d’ ) ) ) ).
” Filling up InvoiceLine
LOOP AT <fs_invoice_el>-element_list-invoice-invoice_line ASSIGNING FIELD-SYMBOL(<lfs_invoice_line>).
<lfs_invoice_line>-item-commodity_classification = VALUE #( ( item_classification_code-base-base-content = ’01’ ) ).
READ TABLE <lfs_invoice_line>-item-commodity_classification ASSIGNING FIELD-SYMBOL(<lfs_comm_class>)
WITH KEY item_classification_code-base-base-content = ’01’.
IF sy-subrc IS INITIAL.
<lfs_invoice_line>-item-name-base-base-content = ‘Machine Name’.
<lfs_invoice_line>-item-item_instance = VALUE #( ( serial_id-base-base-content = ‘9999999999’
product_trace_id-base-base-content = ‘7878787878787878’ ) ).
ENDIF.
ENDLOOP.
ENDLOOP.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.*Disclaimer – This is just a sample code; actual business conditions are not depicted through this.Result: When you display the XML file of the electronic document in the eDocument Cockpit (EDOC_COCKPIT) corresponding to the above invoicing scenario, you will see that the mentioned tags populated. Please note that based on actual submission of this document to authorized service provider, error handling and troubleshooting can be tackled.Conclusion With recent enhancements to the Türkiye Document and Reporting Compliance solution, SAP has made it significantly easier to cater to targeted and industry specific legal requirements in electronic document outputs. This improvement gives you more flexibility and helps ensure compliance with Türkiye’s legal requirements. This blog is the first of the many blogs coming up to demonstrate legal requirements in an easy consumable way   Read More Technology Blog Posts by SAP articles 

#SAP

#SAPTechnologyblog

You May Also Like

More From Author