Professional Documents
Culture Documents
Manual Activity
You make the following settings in Customizing for Cross-Application Components under General
Application Functions eDocument General Settings
Note: For S/4 HANA maintain interface type as “Standard”, instead of “AIF Proxy”.
Version
Interface ID Version Description Active From Direction Interface Desc
Interface
eDoc. Ve eDoc. Source Process Directi Descriptio
Process rs Interface ID Type Type Step on n
Outbo Cancel
GRINV 1 GR_CANCEL_REQUEST GR_INV und Request
GR_INV_C Outbo Cancel
GRINV 1 GR_CANCEL_REQUEST R und Request
CANA_R Inboun Cancel
GRINV 1 GR_CANCEL_RESPONSE GR_INV ESP d Response
GR_INV_C CANA_R Inboun Cancel
GRINV 1 GR_CANCEL_RESPONSE R ESP d Response
FI_INVOI SENDED Outbo Send
GRINV 1 GR_SEND_REQUEST GR_INV CE OC und Request
SD_INVO SENDED Outbo Send
GRINV 1 GR_SEND_REQUEST GR_INV ICE OC und Request
GR_INV_C FI_INVOI SENDED Outbo Send
GRINV 1 GR_SEND_REQUEST R CE OC und Request
GR_INV_C SD_INVO SENDED Outbo Send
GRINV 1 GR_SEND_REQUEST R ICE OC und Request
You need to configure Application Interface Framework for the solution to work.
Maintain values in AIF Fix Values Mapping for the Transaction Keys related to VAT relevant items.
1) Go to below SPRO path
SPRO -> IMG -> Cross-Application Components -> General Application Functions-> SAP
Application Interface framework -> Interface Development -> Define Fix Values
2) Enter Namespace as /EDOGR
3) If Fix Value GR_TKEY_VAT_RELEVANT does not exist, then go to step 4, else go to step 5
4) Click New Entry button and enter below details and Save
Name: GR_TKEY_VAT_RELEVANT
Description: eDocument Greece: Transaction Keys Relevant for VAT
SPRO -> IMG -> Cross-Application Components -> General Application Functions -> SAP
Application Interface framework -> Interface Development -> Define Fix Values -> Define Fix
Value Table
Note: All valid transaction keys which are used in transaction posting for the invoice line
items which are VAT relevant can be maintained in this customization.
The following steps explain how to fill or change fields of the request after the AIF mapping; in more
detail method SET_OUTPUT_DATA of BAdI EDOC_ADAPTOR can be used to fill additional fields of the
electronic invoice or to change existing ones.
1) Go to transaction SE19.
2) Select the New BAdI radio button in the Create Implementation group box and enter
ES_EDOCUMENT as the Enhancement Spot.
11) Expand the tree of the BAdI Implementation you have just created.
12) Double-click on the Filter Val. sub-tree.
© 2020 by SAP AG. All rights reserved.
SAP and the SAP logo are registered trademarks of SAP AG in Germany and other countries.
13) Double-click on the Filter Val. option and create a filter with the value COUNTRY = GR.
1) Go to transaction SE24.
2) Enter Object Type ZCL_EDOC_ADAPTOR_GR
3) Chose the Change push button
4) Double-click on the method IF_EDOC_ADAPTOR~IS_RELEVANT to implement it.
You can leave the code empty.
This method is used in case you have a special functionality for which the eDocument
should be or should not be created.
5) Save and activate your changes.
6) Choose the Back push button.
7) Double click on the method IF_EDOC_ADAPTOR~SET_OUTPUT_DATA to implement it.
You can leave the code empty.
This method is used in case you need to change the eDocument data after the mapping
and before sending. This has been described in detail in next section.
8) Save and activate your changes.
9) Choose the Back push button.
**Only to implement the custom logic for changing request data, follow the below instruction else no
need to implement this method logic**
You can implement the method SET_OUTPUT_DATA to fill or change the content of any field in the
request that you need, after the standard AIF mapping.
In particular, you have to implement this method to fill certain fields that cannot be filled during the AIF
mapping because they are customer-dependent (every customer will decide where to store the values
for these fields in the system). Therefore, you will need to implement this method to fill the fields as
explained below.
3) The fields must be filled depending on the source type of the eDocument.
To extract the data based on the source document type, you can implement a logic like this:
CASE io_source->mv_source_type.
WHEN 'FI_INVOICE'.
ASSIGN ls_fi_invoice TO <ls_source_data>.
* get data of source document
io_source->get_data( IMPORTING es_data = <ls_source_data> ).
******* implement your busisness logic here TO GET the VALUE FROM the SOUR
CE DATA
******* STRUCTURE ls_fi_invoice OR ANY CUSTOMER TABLE IN your SYSTEM
WHEN 'SD_INVOICE'.
ASSIGN ls_sd_invoice TO <ls_source_data>.
* get data of source document
io_source->get_data( IMPORTING es_data = <ls_source_data> ).
******* implement your busisness logic here TO GET the VALUE FROM the SOUR
CE DATA
******* STRUCTURE ls_sd_invoice OR ANY CUSTOMER TABLE IN your SYSTEM
WHEN 'INV_VERIF'.
ASSIGN ls_mm_invoice TO <ls_source_data>.
* get data of source document
io_source->get_data( IMPORTING es_data = <ls_source_data> ).
******* implement your busisness logic here TO GET the VALUE FROM the SOUR
CE DATA
******* STRUCTURE ls_mm_invoice OR ANY CUSTOMER TABLE IN your SYSTEM
WHEN 'SRC_FILE'.
ASSIGN ls_src_data_file TO <ls_source_data>.
* get data of source document
io_source->get_data( IMPORTING es_data = <ls_source_data> ).
******* implement your busisness logic here TO GET the VALUE FROM the SOUR
CE DATA
******* STRUCTURE ls_src_data_file OR ANY CUSTOMER TABLE IN your SYSTEM
ENDCASE.
To fill the data in the electronic document based on the eDocument type, you can implement a logic
like this:
* Fill the field in the output structure with the value that has been selecte
d
CASE iv_edoc_type.
WHEN 'GR_INV'.
ASSIGN cs_output_data TO <fs_invoice>.
******* IMPLEMENT YOUR BUSISNESS LOGIC HERE TO GET THE PREVIOUSLY SELECTED VA
LUE
******* AND ASSIGN IT TO THE TARGET FIELD IN <FS_INVOICE>
WHEN 'GR_INV_CR'.
ASSIGN cs_output_data TO <fs_invoice>.
******* IMPLEMENT YOUR BUSISNESS LOGIC HERE TO GET THE PREVIOUSLY SELECTED VA
LUE
******* AND ASSIGN IT TO THE TARGET FIELD IN <FS_INVOICE>
WHEN 'GR_INVI_IM'.
ASSIGN cs_output_data TO <fs_invoice>.
******* IMPLEMENT YOUR BUSISNESS LOGIC HERE TO GET THE PREVIOUSLY SELECTED VA
LUE
******* AND ASSIGN IT TO THE TARGET FIELD IN <FS_INVOICE>
WHEN 'GR_INV_SUM'.
ASSIGN cs_output_data TO <fs_invoice>.
******* IMPLEMENT YOUR BUSISNESS LOGIC HERE TO GET THE PREVIOUSLY SELECTED VA
LUE
******* AND ASSIGN IT TO THE TARGET FIELD IN <FS_INVOICE>
WHEN 'GR_EXPENSE'.
ASSIGN cs_output_data TO <fs_exclass>.
******* IMPLEMENT YOUR BUSISNESS LOGIC HERE TO GET THE PREVIOUSLY SELECTED VA
LUE
******* AND ASSIGN IT TO THE TARGET FIELD IN <fs_exclass>
ENDCASE.
If you need to create eDocuments from Invoice, you will need to fill the following fields of the request
after the AIF mapping using the method SET_OUTPUT_DATA of the BAdI EDOC_ADAPTOR.
Default mapping has been provided for the below mandatory fields for the standard solution to work.
You need to implement your custom logic if standard logic does not meet your requirement.
Remark: For standard solution to work, default mapping has been provided in,
Class: CL_EDOC_MAP_GR~ FILL_PAYMENT_METHODS, where
Payment Type = ‘5’
Payment Amount = TOTAL GROSS VALUE from Invoice Summary Section
To modify the data in Payment Method Details, you can implement logic like this:
METHOD if_edoc_adaptor~set_output_data.
lt_invoice[] = ls_output_data-invoice[].
ls_output_data-invoice = lt_invoice[].
cs_output_data = ls_output_data.
ENDIF.
ENDMETHOD.
© 2020 by SAP AG. All rights reserved.
SAP and the SAP logo are registered trademarks of SAP AG in Germany and other countries.
2) VAT Exemption Category (Mandatory Implementation is Obsolete)
Remark: For standard solution to work, default mapping has been provided in,
Class: CL_EDOC_MAP_GR~ FILL_INVOICE_DETAILS_*, where
If VAT Category = ‘7’, then
VAT Exemption Category = ‘1’.
To modify the value of VAT Exemption Category, you can implement logic like this:
METHOD if_edoc_adaptor~set_output_data.
lt_invoice[] = ls_output_data-invoice[].
ls_output_data-invoice = lt_invoice[].
cs_output_data = ls_output_data.
ENDIF.
ENDMETHOD.
Below is the list of allowed VAT classification type which can be submitted to myDATA.
Code Description EN Description EL
VAT_361 Purchases and Expenses Αγορές & δαπάνες στο
Domestic εσωτερικό της χώρας
VAT_362 Purchases and Expenses Αγορές & εισαγωγές επενδ.
(Assets) Αγαθών (πάγια)
VAT_363 Other Purchases and Λοιπές εισαγωγές εκτός
Expenses (Assets) επενδ. Αγαθών (πάγια)
VAT_364 EU Purchases of Goods Ενδοκοινοτικές αποκτήσεις
αγαθών
VAT_365 EU Services Provision Ενδοκοινοτικές λήψεις
Article 14.2.a υπηρεσιών άρθρ. 14.2.α
VAT_366 Other recipients acts Λοιπές πράξεις λήπτη
Remark: For standard solution to work, default mapping has been provided in,
Class: CL_EDOC_MAP_GR~ FILL_INVOICE_DETAILS_*, where
For each expense classification line item against a VAT Category, insert a VAT
classification line item with,
Classification Type = ‘VAT_366’,
Classification Category = Same as expense classification line item
Amount = Same as expense classification line item
Id = Id from expense classification line item + 1
To modify the value of VAT Classification Type you can implement logic like this:
METHOD if_edoc_adaptor~set_output_data.
lt_invoice[] = ls_output_data-invoice[].
ls_output_data-invoice = lt_invoice[].
cs_output_data = ls_output_data.
ENDIF.
ENDMETHOD.
Remark: Consider below data type and corresponding change in logic if it is a case of submission of the
expense classification for the matched Invoices through Summary Report.
METHOD if_edoc_adaptor~set_output_data.
ENDIF.
ENDMETHOD.
Below is the list of allowed Invoice Detail Type for invoice type 1.5 which can be submitted
to myDATA.
Code Description
1 Settlement of 3rd party sales
2 Income from 3rd party sales
Remark: For standard solution to work, default mapping has been provided in,
Class: CL_EDOC_MAP_GR~ FILL_INVOICE_DETAILS_*, where
If Invoice Type = ‘1.5’, then
Invoice Detail Type = ‘2’.
To modify the value of Invoice Detail Type, you can implement logic like this:
METHOD if_edoc_adaptor~set_output_data.
lt_invoice[] = ls_output_data-invoice[].
ls_output_data-invoice = lt_invoice[].
cs_output_data = ls_output_data.
ENDIF.
ENDMETHOD.
**Only applicable for ECC. Standard BAdI implementation is available in S/4 HANA**
Customer Package
The next steps explain the implementation of AIF Connector; in more detail BAdI
EDOC_INTERFACE_CONNECTOR is used to connect to AIF:
➢ Go to transaction SE19.
➢ Select the New BAdI radio button in the Create Implementation group box and enter
ES_EDOCUMENT as the Enhancement Spot.
➢ Expand the tree of the BAdI Implementation you have just created.
➢ Double-click on the Filter Val. sub-tree.
➢ In the Filter Values group box on the right-hand side, choose the Combination push-
button.
➢ In the Choose Filter dialog, select the lines for both INTERFACE_TYPE and COUNTRY.
➢ Choose the ok button.
➢ Double-click on the COUNTRY filter.
➢ In the Display Filter Value dialog, enter GR as Value 1 and select = as Comparator 1.
➢ Go to transaction SE24.
➢ Enter Object Type ZCL_EDOC_INTF_CONN_GR
➢ Chose the Change push button
➢ Go to Interfaces tab and Insert Interface IF_EDOC_INTF_CONN_IMPL. Entry should look
like this,
➢ Double-click on method
IF_EDOC_INTF_CONN_IMPL~GET_INTERFACE_FOR_PREVIEW
➢ Insert the following statement between ‘METHOD…’ and ‘ENDMETHOD’:
METHOD IF_EDOC_INTF_CONN_IMPL~GET_INTERFACE_FOR_PREVIEW
INCLUDE EDOC_GR_INTERFACE_FOR_PREVIEW.
ENDMETHOD.
➢ Double-click on method
IF_EDOC_INTERFACE_CONNECTOR~COMMUNICATE_ACTION
➢ Insert the following statement between ‘METHOD…’ and ‘ENDMETHOD’:
METHOD IF_EDOC_INTERFACE_CONNECTOR~COMMUNICATE_ACTION.
INCLUDE EDOC_INTF_CONN_COMMUNICATE.
ENDMETHOD.
➢ Save and activate your changes.
➢ Choose the Back push button.
➢ Double-click on method
IF_EDOC_INTERFACE_CONNECTOR~NAVIGATE_TO_MONITOR
➢ Insert the following statement between ‘METHOD…’ and ‘ENDMETHOD’:
METHOD IF_EDOC_INTERFACE_CONNECTOR~NAVIGATE_TO_MONITOR.
INCLUDE EDOC_INTF_CONN_NAVIGATE.
ENDMETHOD.
➢ Save and activate your changes.
➢ Choose the Back push button.
**Only to implement the custom logic for matching, follow the below instruction else no need to
implement the BADI**
Standard matching logic is based on the fields Series, AA, invoice date, Vat Number between the ‘Greece
Incoming eBooks’ and data received from tax authorities for incoming invoice data (Buyer invoice).
Below are the places where the BADI methods needs to be implemented with custom logic.
Using above pattern along with invoice date, vat number the standard logic has been written to match
the incoming documents to the Greece incoming eBooks.
Add ‘Total gross amount’ as a part of matching logic along with other parameters
Implement the BADI ‘ES_EDOCUMENT_GR’ and follow below steps to add additional matching logic.
1. While pulling invoices from Tax Authority system (Triggered while running the
EDOC_MESSAGE_HANDLING report).
• IV_SERIES
• IV_AA
• IV_CUSTOMER_VAT_ID
• IV_VENDOR_VAT_ID
• IV_INVOICE_DATE
• IV_TOTAL_GROSS_AMOUNT
• IV_TOTAL_PAYABLE_AMOUNT
By using above fields find the unique EDOC_GUID from the tables EDOGRINV, EDOCUMENT and
return CV_MATCHED_EDOCUMENT_ID.
*Form the reference field pattern using IV_SERIES, IV_AA or you can use your own pattern followed
while creating the Greece Incoming eBooks.
• IV_COMPANY_CODE
• IV_DOCUMENT_NUMBER
• IV_DOCUMENT_YEAR
• IV_LEGALDOC
• IV_CUSTOMER_VAT_ID
• IV_VENDOR_VAT_ID
• IV_INVOICE_DATE
*Find the total gross amount using document number and find the eDocument to update.
Sample Code:
Data : lv_total_gross_amount type edoc_gr_amount.
SPLIT iv_legal_doc AT '-' INTO lv_series lv_aa. “( you can use custom split logic If the identifier is
“different)
SELECT edogrinv~edoc_guid FROM edogrinv INNER JOIN edocument ON edogrinv~edoc_guid EQ
edocument~edoc_guid INTO cv_matched_edocument_id
WHERE edogrinv~series = lv_series AND edogrinv~numbr = iv_aa AND
edogrinv~invoice_date = iv_invoice_date AND
edogrinv~vendor_vat_reg_id = iv_vendor_vat_id AND
edogrinv~ total_gross_amount = lv_total_gross_amount
( document~proc_status = 'CREA' OR edocument~proc_status =
'MATCH_ERR' ) AND edocument~edoc_type = 'GR_INV_MD'.
The entries for the Invoice Type, Income Classification, Income Category, Expense Classification and the
Expense Category can be maintained referring the attached Excel sheet (Invoice and Classification type
Mapping).
You can maintain the entries for the Greece Specific views as mentioned below.
Remark: The following restrictions are to be followed for maintaining the view
If TAX TYPE is ‘Withholding Tax ‘, then only Withhold Tax Category is allowed.
Remark: The following restrictions are to be followed for maintaining the view
If TAX TYPE is ‘VAT’, then only VAT Category is allowed.
If TAX TYPE is ‘Withholding Tax’, then only Withhold Tax Category is allowed.
If TAX TYPE is ‘Fees’, then only Fee Percentage Category is allowed.
If TAX TYPE is ‘Other Taxes’, then only Other Tax Percentage Category is allowed.
If TAX TYPE is ‘Stamp Duty’, then only Stamp Duty Percentage Category is allowed.
TAX TYPE ‘Excluded’ OR ‘Deductions’ is not allowed.
Remark: Tax codes those are created with VAT relevant transaction keys should be maintained
for VAT Category only.
VAT relevant transaction keys are maintained in the AIF customizing,
SPRO -> IMG -> Cross-Application Components -> General Application Functions -> SAP
Application Interface framework -> Interface Development -> Define Fix Values -> Define Fix
Value Table.
Document Compliance uses the SAP Cloud Platform Integration to communicate with external systems via
web services. For that, you do the following:
• Connect your back-end system and Application Interface Framework with SAP Cloud Platform
Integration.
• Set up of SAP Cloud Platform Integration for connecting to the external systems.
The prerequisite to access the SAP Cloud Platform Integration implementation for a given local version is
to have an SDN account that enables you to access SAP Cloud Platform Integration. To find the Integration
package, do the following.
1. Access the SAP Cloud Platform Integration page using this link: https://api.sap.com/.
2. Choose Integration.
3. Choose All.
4. Search for the integration package you’re looking for. If you don’t know the exact name of the
integration package, search for eDocument and a list of integration packages for eDocument is
displayed and you can choose the one you’re interested in.
5. Go to Documents and open the integration documentation. The document guides you through the
settings you do in SAP Cloud Platform Integration to enable eDocuments for your local version.
Once you access the SAP Cloud Platform Integration catalog page, you find the eDocument: electronic
Invoice for Greece package. By clicking on this package, you are directed to the page specific for
eDocument Greece. On this page, click on the Documents icon to find the Greece Electronic Tax Register
Books (e-Books): Setting Up SAP Cloud Platform Integration. This document guides you through all the
necessary settings you need to make in SAP Cloud Platform Integration to enable the Full eDocument
solution for Greece.
No part of this publication may be reproduced or transmitted in any form or for any purpose without
the express permission of SAP SE or an SAP affiliate company.
SAP and other SAP products and services mentioned herein as well as their respective logos are
trademarks or registered trademarks of SAP SE (or an SAP affiliate company) in Germany and other
countries. Please see http://global12.sap.com/corporate-en/legal/copyright/index.epx for additional
trademark information and notices.
Some software products marketed by SAP SE and its distributors contain proprietary software
components of other software vendors. National product specifications may vary.
These materials are provided by SAP SE or an SAP affiliate company for informational purposes only,
without representation or warranty of any kind, and SAP SE or its affiliated companies shall not be liable
for errors or omissions with respect to the materials. The only warranties for SAP SE or SAP affiliate
company products and services are those that are set forth in the express warranty statements
accompanying such products and services, if any. Nothing herein should be construed as constituting an
additional warranty.
SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this
document or any related presentation, or to develop or release any functionality mentioned therein.
This document, or any related presentation, and SAP SE’s or its affiliated companies’ strategy and
possible future developments, products, and/or platform directions and functionality are all subject to
change and may be changed by SAP SE or its affiliated companies at any time for any reason without
notice. The information in this document is not a commitment, promise, or legal obligation to deliver
any material, code, or functionality. All forward-looking statements are subject to various risks and
uncertainties that could cause actual results to differ materially from expectations. Readers are
cautioned not to place undue reliance on these forward-looking statements, which speak only as of their
dates, and they should not be relied upon in making purchasing decisions.