You are on page 1of 8

SAP Note 2683318

eDocument Italy: AIF Setup

Manual Activities

© 2018 SAP SE or an SAP affiliate company. All rights reserved.


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://www.sap.com/corporate-en/legal/copyright/index.epx#trademark 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.
In particular, 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.
1. Customer Package
Objects to be created below are required to be maintained in customer namespace. In order to transport
them across customer landscape, please create a customer package for objects created in this SAP Note or
choose an existing customer package.

The next steps explain the implementation of AIF Connector; in more detail BAdI
EDOC_INTERFACE_CONNECTOR is used to connect to AIF:

2. Enhancement Implementation ZEI_EDOC_IT_AIF


2.1. Go to transaction SE19.
2.2. Select the New BAdI radio button in the Edit Implementation section and enter
ZEI_EDOC_IT_AIF as the Enhancement Implementation.

2.3. Choose the Change push button.


2.4. In the BAdI Implementations tree view, look for
BAdI Implementation ZEDOC_IT_AIF_PARTNER
with Implementing Class ZCL_EDOC_IT_PART_AIF_CONNECTOR.
2.4.1. If the BAdI Implementation exists, continue with the steps in section 3 and skip section 4.
2.4.2. If the BAdI Implementation does not exist, continue with the steps in section 4 and skip
section 3.

3. Adaptation of BAdI Implementation ZEDOC_IT_AIF_PARTNER


The following steps are only relevant if the BAdI Implementation ZEDOC_IT_AIF_PARTNER already
exists in your system.
3.1. Double-click on the BAdI Implementation ZEDOC_IT_AIF_PARTNER.
3.2. Double-click on the Implementation Class ZCL_EDOC_IT_PART_AIF_CONNECTOR.
3.3. Adapt the Description to AIF interface connector - Italy (Partner Integration and E2E).
3.4. Double-click on the Filter Values sub-tree.
3.5. Check that the filter combination looks as follows (the order might be different). Adjust if
necessary.

Copyright/Trademark
4. Creation of BAdI Implementation ZEDOC_IT_AIF_PARTNER
The following steps are only relevant if the BAdI Implementation ZEDOC_IT_AIF_PARTNER doesn’t
exist in your system yet.
4.1. Choose the Create BAdI Implementation push button.
4.2. Enter as
4.2.1. BAdI Definition: EDOC_INTERFACE_CONNECTOR
4.2.2. BAdI Implementation: ZEDOC_IT_AIF_PARTNER
4.2.3. Implementation Class: ZCL_EDOC_IT_PART_AIF_CONNECTOR
4.2.4. Short Text: AIF interface connector - Italy (Partner Integration and E2E)
4.3. Save and activate your changes.
4.4. When prompted for a package, enter the package created / chosen in step 1.

4.5. Expand the tree of the BAdI Implementation you have just created.
4.6. Double-click on the Filter Values sub-tree.
4.7. In the Filter Values section on the right-hand side, choose the Combination push-button.
4.8. In the Choose Filter dialog, select all three filters:
INTERFACE_TYPE, COUNTRY, and GENERIC_FILTER.
4.9. Choose the Continue push button.
4.10. Double-click on the COUNTRY filter.
4.11. In the Change Filter Value dialog, enter IT as Value 1 and select = as Comparator 1.
4.12. Choose the Continue push button.
4.13. Double-click on the INTERFACE_TYPE filter.
4.14. In the Change Filter Value dialog, enter AIF_PROXY as Value 1 and select = as Comparator 1.
4.15. Choose the Continue push button.
4.16. Double-click on the GENERIC_FILTER filter.
4.17. In the Change Filter Value dialog, leave Value 1 empty and select = as Comparator 1.
4.18. Choose the Continue push button.
4.19. The filter combination you have just created will look like this (the order might be different):

4.20. Save and activate your changes.

4.21. Go to transaction SE24.


4.22. Enter Object Type: ZCL_EDOC_IT_PART_AIF_CONNECTOR.
4.23. Chose the Change push button.
4.24. Choose from the menu Goto -> Sections -> Public Section.
4.25. Choose from the menu Utilities -> More Utilities -> Upload/Download -> Upload.
4.26. Upload file ZCL_EDOC_IT_PART_AIF_CONNECTOR - Public.txt (included in attachment
2683318_Sources.zip to this SAP Note)
4.27. Save and activate your changes.

Copyright/Trademark
4.28. Upload file ZCL_EDOC_IT_PART_AIF_CONNECTOR - Protected.txt (included in attachment
2683318_Sources.zip to this SAP Note)
4.29. Save and activate your changes.

5. Class ZCL_EDOC_IT_PART_AIF_CONNECTOR
5.1. Go to transaction SE24.
5.2. Enter Object Type: ZCL_EDOC_IT_PART_AIF_CONNECTOR
5.3. Choose the Change push button.

5.4. Double-click on method IF_EDOC_INTERFACE_CONNECTOR~CANCEL


5.5. Make sure that the method contains the following statement between ‘METHOD…’ and
‘ENDMETHOD’ like this:
METHOD if_edoc_interface_connector~cancel.
INCLUDE edoc_aif_proxy_cancel.
ENDMETHOD.
5.5.1. If the method exists with different coding, adjust it to the one given.
5.5.2. If the method is not implemented yet, create the method implementation as given.
5.6. Save and activate your changes.
5.7. Choose the Back push button.

5.8. For the following methods, continue in the same way as above.
If the method exists with different coding, adjust it to the one given.
If the method is not implemented yet, create the method implementation as given.

5.8.1. IF_EDOC_INTERFACE_CONNECTOR~CLEAN_UP_MESSAGES:
INCLUDE edoc_aif_partner_it_cleanup_ms.
5.8.2. IF_EDOC_INTERFACE_CONNECTOR~ COMMUNICATE_ACTION:
INCLUDE edoc_aif_proxy_communicate.
5.8.3. IF_EDOC_INTERFACE_CONNECTOR~DISPLAY_EDOCUMENT:
INCLUDE edoc_aif_partner_it_display.
5.8.4. IF_EDOC_INTERFACE_CONNECTOR~NAVIGATE_TO_MONITOR:
INCLUDE edoc_aif_xml_it_navigate. "same as for AIF_XML
5.8.5. IF_EDOC_INTERFACE_CONNECTOR~ PULL_MESSAGES:
INCLUDE edoc_aif_partner_it_pull_msg.
5.8.6. IF_EDOC_INTERFACE_CONNECTOR~TRIGGER:
INCLUDE edoc_aif_partner_it_trigger.
5.8.7. GET_PREVIEW_GOVERNMENT_XML:
INCLUDE edoc_aif_partner_it_get_prevw.
5.8.8. MAP_DATA:
INCLUDE edoc_aif_partner_it_map_data.
5.8.9. IF_EDOC_INTERFACE_CONNECTOR~GET_EDOCUMENT:
INCLUDE edoc_aif_partner_it_get_edoc.

6. Adaptation of Existing BAdI Implementation for EDOC_INTERFACE_CONNECTOR


6.1. Go to transaction SE19.
6.2. Select the New BAdI radio button in the Edit Implementation section and enter
ZEI_EDOC_IT_AIF as the Enhancement Implementation.
6.3. Choose the Display push button.
6.4. If there are other BAdI implementation than the one just created, open of each the sub-tree on
the left and double-click on the Filter Values.
6.5. If the filter INTERFACE_TYPE is assigned to AIF_XML and AIF_PROXY,
i.e., the filter values look like this (the order might be different)

Copyright/Trademark
then execute the following steps:
6.5.1. Press the Display <-> Change push button.
6.5.2. Delete these filter values: mark the Combination 1 entry and press the Delete Filter
Combination push button.
6.5.3. In the Filter Values section on the right-hand side, choose the Combination push-button.
6.5.4. In the Choose Filter dialog, select all three filters:
INTERFACE_TYPE, COUNTRY, and GENERIC_FILTER.
6.5.5. Choose the Continue push button.
6.5.6. Double-click on the COUNTRY filter.
6.5.7. In the Change Filter Value dialog, enter IT as Value 1 and select = as Comparator 1.
6.5.8. Choose the Continue push button.
6.5.9. Double-click on the INTERFACE_TYPE filter.
6.5.10. In the Change Filter Value dialog, enter AIF_XML as Value 1 and select = as Comparator 1.
6.5.11. Choose the Continue push button.
6.5.12. Double-click on the GENERIC_FILTER filter.
6.5.13. In the Change Filter Value dialog, leave Value 1 empty and select = as Comparator 1.
6.5.14. Choose the Continue push button.
6.5.15. The filter combination you have just created will look like this (the order might be different):

6.5.16. Save and activate your changes.

7. Define eDocument Interface Version


Note, this step is only necessary, if you have not activated the interface versions with SAP Note 2614498.
7.1. Execute transaction SM30.
7.2. Enter EDOINTVERSIONV in the Table/View field.
7.3. Choose the Edit/Maintain push button.
7.4. You should find the following entries is the table.
7.4.1. If the entries are available, make sure that the values in column Active From is not empty, but
choose a date from when you want to use SAP eDocument for Italy Electronic Invoicing
solution, e.g., today’s date.

Interface ID Version Version Description Active From


<choose as
IT_INV_IN_DELETE_REQUEST 1 Proxy Version 1.0 described
above>
IT_INV_IN_DELETE_RESPONSE 1 Proxy Version 1.0 <ditto>

IT_INV_IN_PULL_REQUEST 1 Proxy Version 1.0 <ditto>

IT_INV_IN_PULL_RESPONSE 1 Proxy Version 1.0 <ditto>

IT_INV_OUT_SEND_REQUEST 1 Proxy Version 1.0 <ditto>

Copyright/Trademark
IT_INV_OUT_SEND_RESPONSE 1 Proxy Version 1.0 <ditto>

IT_NOTIF_INOUT_DELETE_REQUEST 1 Proxy Version 1.0 <ditto>

IT_NOTIF_INOUT_DELETE_RESPONSE 1 Proxy Version 1.0 <ditto>

IT_NOTIF_INOUT_PULL_REQUEST 1 Proxy Version 1.0 <ditto>

IT_NOTIF_INOUT_PULL_RESPONSE 1 Proxy Version 1.0 <ditto>

IT_NOTIF_IN_SEND_REQUEST 1 Proxy Version 1.0 <ditto>

IT_NOTIF_IN_SEND_RESPONSE 1 Proxy Version 1.0 <ditto>

7.5. Save your changes.

8. Assign AIF Interfaces and Version


Check if values are in system if not please update the view.
8.1. Execute transaction SM30.
8.2. Enter EDOINTAIFV in the Table/View field.
8.3. Choose the Edit/Maintain push button.
8.4. Choose the New Entries push button
8.5. Insert the following entries (if they do not exist yet):

Interface ID Version AIF AIF Interface AIF Direction


Namespace Version
IT_INV_IN_DELETE_REQUEST 1 /EDOIT INVINDEL 1 Outbound
IT_INV_IN_DELETE_RESPONSE 1 /EDOIT INVINDELR 1 Inbound
IT_INV_IN_PULL_REQUEST 1 /EDOIT INVINPULL 1 Outbound
IT_INV_IN_PULL_RESPONSE 1 /EDOIT INVINPULLR 1 Inbound
IT_INV_OUT_SEND_REQUEST 1 /EDOIT INVOUT 1 Outbound
IT_INV_OUT_SEND_RESPONSE 1 /EDOIT INVOUTR 1 Inbound
IT_NOTIF_INOUT_DELETE_REQUEST 1 /EDOIT NOTIDEL 1 Outbound
IT_NOTIF_INOUT_DELETE_RESPONSE 1 /EDOIT NOTIDELR 1 Inbound
IT_NOTIF_INOUT_PULL_REQUEST 1 /EDOIT NOTIPULL 1 Outbound
IT_NOTIF_INOUT_PULL_RESPONSE 1 /EDOIT NOTIPULLR 1 Inbound
IT_NOTIF_IN_SEND_REQUEST 1 /EDOIT NOTIOUT 1 Outbound
IT_NOTIF_IN_SEND_RESPONSE 1 /EDOIT NOTIOUTR 1 Inbound

8.6. Delete the following entries (if they do exist):


Interface ID Version AIF AIF Interface AIF Direction
Namespace Version
IT_NOTIFICATION_DELETION_REQ 1 /EDOIT NOTIDEL 1 Outbound
IT_NOTIFICATION_PULL_REQUEST 1 /EDOIT NOTIPULL 1 Outbound

9. Define eSOA Service Names


9.1. Execute transaction SM30.
9.2. Enter EDOSOASERV in the Table/View field.
9.3. Choose the Edit/Maintain push button.
9.4. Choose the New Entries push button
9.5. Insert the following entries incl. the description (by scrolling to the right):

Copyright/Trademark
SOA Service Name Logical Port
IT_INVOICE_DELETE EDO_IT_RECEIVE_INVOICE_DELETE
IT_INVOICE_PULL EDO_IT_RECEIVE_INVOICE_PULL
IT_INVOICE_SEND EDO_IT_SEND_INVOICE
IT_NOTIF_DELETE EDO_IT_RECEIVE_NOTIF_DELETE
IT_NOTIF_PULL EDO_IT_RECEIVE_NOTIF_PULL
IT_NOTIF_SEND EDO_IT_SEND_NOTIF

SOA Service Name SOA Service Description


IT_INVOICE_DELETE Italy - Receive Invoice Delete Service
IT_INVOICE_PULL Italy - Receive Invoice Pull Service
IT_INVOICE_SEND Italy - Send invoice
IT_NOTIF_DELETE Italy - Notification Delete Service
IT_NOTIF_PULL Italy - Notification Pull Service
IT_NOTIF_SEND Italy - Send Notification

10. Define eDocument Interfaces


10.1. Execute transaction SM30.
10.2. Enter EDOINTV in the Table/View field.
10.3. Choose the Edit/Maintain push button.
10.4. Choose the New Entries push button
10.5. Maintain SOA Service Name entries as described below and save:
Interface ID I/ SOA Service Name Interface Description
O
IT_INV_IN_DELETE_REQUEST O IT_INVOICE_DELETE Delete Incoming
Invoice (Request)
IT_INV_IN_DELETE_RESPONSE I IT_INVOICE_DELETE Delete Incoming
Invoice (Response)
IT_INV_IN_PULL_REQUEST O IT_INVOICE_PULL Pull Incoming Invoice
(Request)
IT_INV_IN_PULL_RESPONSE I IT_INVOICE_PULL Pull Incoming Invoice
(Response)
IT_INV_OUT_SEND_REQUEST O IT_INVOICE_SEND Send Outgoing
Invoice (Request)
IT_INV_OUT_SEND_RESPONSE I IT_INVOICE_SEND Send Outgoing
Invoice (Response)
IT_NOTIF_INOUT_DELETE_REQUEST O IT_NOTIF_DELETE Delete Inbound or
Outbound
Notification
(Request)
IT_NOTIF_INOUT_DELETE_RESPONSE I IT_NOTIF_DELETE Delete Inbound or
Outbound
Notification
(Response)
IT_NOTIF_INOUT_PULL_REQUEST O IT_NOTIF_PULL Pull Inbound or
Outbound
Notification
(Request)
IT_NOTIF_INOUT_PULL_RESPONSE I IT_NOTIF_PULL Pull Inbound or
Outbound
Notification
(Response)
IT_NOTIF_IN_SEND_REQUEST O IT_NOTIF_SEND Send Outcome
Notification
(Request)
IT_NOTIF_IN_SEND_RESPONSE I IT_NOTIF_SEND Send Outcome
Notification
(Response)

Copyright/Trademark
11. Implement BAdI methods to send an email with attached XML and PDF files to customers
and send an email with attached XML file to vendors in case of rejection

11.1. Implement the BAdI EDOC_PARTNER_CONNECTOR method TRIGGER to create and send an
email for the rejection.

If you want to use the SAP Business Communication Service for sending the email you can use
11.1.1. in the BAdI method TRIGGER:
For process 'ITINVOUT', add the call to method
IO_EDOCUMENT-> SEND_EMAIL_TO_CUST.
For process 'ITINVIN', add the call to method
DATA: LO_EDOCUMENT_IT TYPE CL_EDOCUMENT_IT.
LO_EDOCUMENT_IT ?= IO_EDOCUMENT.
LO_EDOCUMENT_IT ->SEND_EMAIL_TO_VENDOR.

11.1.2. in the BAdI method CHANGE_EMAIL_TO_CUSTOMER:


You can change the email for both, customer or vendor, before sending.
You can find the rejection reason for incoming invoices in DB table EDOITINVIN.

If you want to connect to your own email system, you can find the information on the supplier’s
email address and the rejection reason, in parameter IO_EDOCUMENT->ms_edoitinvin.

11.2. Activate the BAdI implementation.

Copyright/Trademark

You might also like