sexta-feira, 13 de janeiro de 2017

2370720 - FAQ of Argentina's Electronic Invoice RG2758 (Export Scenario)

Symptom

This SAP KBA aims to clarify questions about the implementation and use of the Argentina's Electronic Invoice RG2758 solution that support the legal requirement Resolución General 2758/2011 from AFIP (national tax authority from Argentina). We intend to maintain this SAP KBA updated with new SAP Notes and other future changes regarding the AEI solution. The current SAP's AEI solution is divided in three parts (RG2485, RG2904 and RG2758), which are different general resolutions from AFIP. This SAP KBA is specific for AEI RG2758 solution only. For AEI RG2485 solution, check the SAP KBA 2370680. For AEI RG2904 solution, check the SAP KBA 2370724.
Topic A - Basic processes
Topic B - SAP Notes
Topic C - Common issues
Topic D - PI/XI settings
Topic E - Previous solution
AFIP legal requirement Factura Electrónica: http://www.afip.gob.ar/feSAP Help of Localization Argentina: https://goo.gl/jn5SwmLast update: 09/JAN/2017. New SAP Notes and topics C10, C11 and D.


A - Basic processes and setup of AEI solution
AEI RG2758 solution supports the national legal requirement AFIP Resolución General 2758/2011. Every official document with print character E of export sales must contain a CAE number (Comprobantes Electrónicos Emitidos) and ODN (Official Document Number) before sending to customers. AEI RG2758 solution is only valid for export sales in Argentina and its main include is LJ1AEF04. The communication of AEI solution happens between ERP and PI systems and AFIP systems, and then the AEI documents are sent to AFIP for CAE approval. In order to install the AEI RG2758 solution, implement the SAP Note1659814 and follow its instructions in the content of description and attachments. The processes explained below are valid for all three parts of AEI solution (RG2485, RG2904 and RG2758). In case you do not know which is the AFIP RG (RG2485, or RG2904 or RG2758) that you are currently using, check the log of an AEI document in the AEI Monitor (transaction J1AEXPMONITOR or J1AMONITOR), or check table J_1A_RFC_DEST. 
A1 - SD scenario:
When a SD billing document is created, a validation is run to check if it is applicable for AEI solution, based in the country and the Branch details of table J_1ASNR. If the SD billing document is applicable, then an entry for this document is created in the table J_1ACAE with status 'New', and the AEI document is created. The validations performed while saving the SD billing document are to check the mandatory fields for table J_1ACAE. In case of errors, an information is shown in the SD programs and other details in the AEI Monitor J1AEXPMONITOR.
Once the AEI document is in table J_1ACAE, the user can send it to AFIP via AEI Monitor J1AEXPMONITOR or scheduling a background job. If the validation fails before sending AEI document to AFIP, its status is updated to 'Validation Error'. Once the error is corrected in the SD billing document, user is able to reprocess the AEI document in the AEI Monitor J1AEXPMONITOR.
Once the SD billing document is correct, AEI solution pre assigns an ODN in the field Reference, sets status 'Sent to AFIP' and assigns a RFC lock. The RFC lock prevents the next authorization to take place before the current one is finished. When the AEI document is approved by AFIP, a CAE number (Comprobantes Electrónicos Emitidos) is assigned, the status is changed to 'Approved' and the ODN is updated with a complete format in the table J_1ACAE.
After this process above, the SD billing document is transferred to FI side, creating the FI accounting document. This procedure is automatically if the billing type has been configured to automatically transfer to FI side. In case the AEI document is rejected by AFIP, its status is changed to 'Rejected' and the rejection code is filled in the table J_1A_WS_REJ and the same preassigned ODN is reused for other AEI document. Notice that the SD billing document can be saved in SD side, but it cannot be transferred to FI side before it is authorized by AFIP. And once the AEI document is authorized, the SD billing document and AEI document cannot be cancelled anymore.
A2 - FI scenario:
When a FI accounting document is created, a validation is run to check if it is applicable for AEI solution, based in the country and the Branch details of table J_1ASNR and handled via substitution. If the FI accounting document is applicable, then an entry for the document is created in the table J_1ACAE with status 'New'. The validations performed while saving the FI accounting document are to check the mandatory fields for table J_1ACAE. In case of errors, an information is shown in the FI programs and other details in the AEI Monitor J1AEXPMONITOR.
Once the AEI document is in table J_1ACAE, the user can send it to AFIP via AEI Monitor J1AEXPMONITOR or scheduling a background job. If the validation fails before sending AEI document to AFIP, its status is updated to 'Validation Error'. Once the error is corrected in the FI accounting document, user is able to reprocess the AEI document in the AEI Monitor J1AEXPMONITOR.
Once the FI accounting document is correct, AEI solution preassigns an ODN in the field Reference, sets status 'Sent to AFIP' and assigns a RFC lock. The RFC lock prevents the next authorization to take place before the current one is finished. When the AEI document is approved by AFIP, a CAE number is assigned, the status is changed to 'Approved' and an ODN is filled in the table J_1ACAE.
In case the AEI document is rejected by AFIP, its status is changed to 'Rejected' and the rejection code is filled in the table J_1A_WS_REJ. Notice that the FI accounting document is posted without an ODN, and only after the AFIP approval the ODN is filled in the field Reference. A FI accounting document without ODN can be cancelled, in case it is rejected and the problem cannot be solved, but once the AEI document is authorized, the FI accounting document cannot be cancelled anymore.
A3 - Contingency:
In case AFIP systems are down and the requests are not processed, the users can switch a Company Code and Branch to contingency and these details are in the attachments of the main SAP Notes of each part of AEI solution. If a Branch is in contingency, it is substituted in the SD billing document for a Contingency Branch (also known as Manual Branch), which is read from table J_1ASNR. In case of FI accounting document, if a Branch is set in contingency mode, then a pop-up is given to the user where it is possible to choose to switch to a Contingency Branch or not. When the SD and/or FI document is created with Contingency Branch, the ODN generated is stored in the original document and in the AEI document. This information is also stored in the table J_1ACONTINGENCY with ODN and Branch details. Notice that the table J_1ACON is to manage the contingency maintained at Company Code and Branch level, and it stores the details whether a Branch is in contingency or not.
A4 - Communication:
The AEI solution is adapted to be used with PI system and the steps are given in attachments of the main SAP Note 1659814 of AEI RG2758 solution. This is applicable for PI 7.0 and higher releases and the Java environment to be used must be of version 1.4 or higher. 
A5 - AEI Monitor:
The tool to monitoring the AEI document is accessed via transaction J1AEXPMONITOR in AEI RG2758 solution (and via J1AMONITOR for AEI RG2485 and AEI RG2904 solutions). The AEI Monitor J1AEXPMONITOR displays the status of the AEI documents and the user is able to process them through AFIP or via Contingency. For more details about how to use the AEI Monitor J1AEXPMONITOR, check the attachment AEI_MONITOR.PDF.
A6 - Customizing:
The procedures to perform the customizing of the AEI solution are described in the attached file AEI_RG2758_SETUP.PDF. Also, review the instructions informed in the Description content and attachments of the main SAP Note 1659814 of AEI RG2758 solution.

B - SAP Notes of AEI RG2758
All SAP Notes for ERP system are only valid for SAP_APPL versions from 600 to 618 releases and for some specific S4CORE or SAP_FIN versions. In case the transaction SNOTE informs you that a specific SAP Note is obsolete for your system version, disregard the SAP Note but review its textual content and attachments. Check if you followed all the manual instructions and if you implemented the last version of SAP Notes. Notice that some SAP Notes have manual pre and post implementation steps in the description content or in their attachments. The list has SAP Notes to be used in the installation of the AEI solution, correction issues and manual instructions. Notice that some SAP Notes are just valid for specific versions.
1659814 AEI RG2758 Argentina Electronic Invoice Web Service for Export Scenario
1725504 Changing hardcoded messages to text elements
1765002 Same branch having multiple type of sales
1773836 Wrong item details sent in request XML
1783706 Reset CAE status when connection test fails
1784971 Unable to process succesive documents
1792478 Correction to component PERMISO_EXISTENTE
1825031 Credit or debit memo reference not populated
1830095 Unable to process documents in background
1830100 Wrong item tax details sent in request XML
1856119 No BADI BADI_AEI_WS_EXP_2758 implementation
1883819 Archiving Solution For request and response XML
1901450 Error BL001 Campo Permisos PERMISO_EXISTENTE Obligatorio
1903824 Tax Number determination change
1922138 Incoterms are not mandatory fields
1922888 Rejected documents must have error log in red
2002481 Tax Number for One Time Customers
2054417 Incorrect item total amount Pro_total_item is sent in XML for credito notes
2059334 Unable to process credit and debit memo and price adjustment in normal invoices
2060139 Wrong branch determined for rebate agreement
2064616 Corrections to the archiving SAP Note 1883819
2080105 Get Last ODN is not resetting RFC_SENT_LOCK
2086413 Rebate credit notes with negative values in item are rejected
2095304 Error 1570 CUIT_PAIS_CLIENTE invalid
2112000 Payment term description in Spanish
2113730 Wrong tax calculation when processing a multiple documents to AFIP
2133996 Standard toolbar buttons not working properly for AEI Monitor
2155996 Corrections due to change in length of official document type
2156662 Partner functions are not populated for delivery related billing
2260542 Error BAPI_AR_WS_ARCHIVE_XML Attribute
2341615 SD billing documents are released to FI side without AFIP approval and CAE Number
2389743 Error Code 1720 PERMISOS and CMPS_ASOC nodes not sent to AFIP

C - Common Issues of AEI RG2758
C1 - Rejection 'This document cannot be processed; AFIP is branchoffice or is invalid': When you post a FI accounting document with payment term Due Immediately, you cannot get approval from AFIP. Check if the SAP Notes 211200021559961792478188381920024812019110202530420601392064616208010520839132086413209530421035332113730213399621566622225065 and2335302 are already implemented in your system. In case these SAP Notes are already applied in your system, review the list of the topic B.
C2 - Rejection 'The description of payment terms could not be determined': In AEI Monitor J1AEXPMONITOR, user face a rejection when is trying to get AFIP approval of a FI accounting document using Special G/L. The error message is 'The description of payment terms could not be determined' and 'Error while validating the built data'. Check if the SAP Note 2335302 is already implemented in your system. In case this SAP Note is already applied in your system, review the list of the topic B and the topic above (C1).
C3 - SD billing documents are released to FI side without AFIP approval and CAE number: When user creates a SD billing document, the FI accounting document is being generated automatically, and it is not following the correct procedure informed in the SAP Note 1659814 for SD billing document scenarios. Since the process does not involve AEI Monitor J1EXPAMONITOR and AFIP, these documents are generated directly without obtaining the CAE number approval. Check if the SAP Note 2341615 is already implemented in your system. In case this SAP Note is already applied in your system, review the list of the topic B.
C4 - Rejection 'Issuing date should not exceed 5 days to the posting date': Since the day was already exceed the maximum of five days to the posting date, the rejection occurs. This is the system standard behavior and it is according to AFIP requirements.
C5 - Rejection 'The official document type is not defined as from AFIP': In order to correct this issue, check if the SAP Note 2153090 is already implemented in your system. Read the content of the SAP Note in order to confirm if there are prerequisites and manual steps. In case this SAP Note is already applied in your system, review the list of the topic B.
C6 - AEI RG2758 solution in S/4HANA: The Argentina's Electronic Invoice solution is supported in SAP S/4HANA On Premise 1511. For more details, check the links below:
Feature Scope Description of SAP S/4HANA: https://goo.gl/ohGq6RLocalization Best Practices SAP S/4HANA: https://goo.gl/0n0wMRSAP Help of Localization Argentina: https://goo.gl/jn5Swm
C7 - Intercompany scenario: You se standard SD customizing with intercompany invoices. The FI accounting document is default determined by the solution, but the AEI document does not appear in the AEI Monitor J1AEXPMONITOR. The intercompany scenarios are out of the scope of Localization Argentina. If you want this functionality, you can submit the idea to ASUG Argentina, that is the channel to request such kind of change, or check it with Custom Development Team.
C8 - Law 'Liquidación de Tabaco Verde' in AEI RG2758 solution: This AFIP legal requirement is valid for tobacco providers companies in Argentina. This requisite is not be covered by Localization Argentina as it is an industry specific legislation and it is not in the scope of AEI solution. Submit the idea to ASUG Argentina, that is the channel to request such kind of change, or check it with Custom Development Team.
C9 - Rejection 'Communication failure while calling BAPI': Also the error 'System failure' and 'Call to messaging system failed'. Check if the SAP Notes 163047816598141949572 and 2250734 are already implemented in your system. In case these SAP Notes are already applied in your system, review the list of the topic B.
C10 - Rejection 'Code 1666 Description: Campo Cmp.Items invalido(sin ocurrencia)': In order to correct this issue, check if the SAP Notes 2054417 and 2059334 are already implemented in your system. In case these SAP Notes are already applied in your system, review the list of the topic B.
C11 - Rejection 'Cód. 505 Descripción Error general (lockeo)': In order to solve this scenario, use the button Get Last ODN in AEI Monitor J1AEXPMONITOR. You should then be able to use it to reset the status of the document locked in status I and try to resubmit it to AFIP. If you keep seeing the same error, review the list of SAP Notes in the topic B.
C12 - Rejection 'Code 1812 Description: Campo Cmp.Items.Pro_bonificacion invalido. El valor debe ser menor o igual a Pro_precio_uni * Pro_qty': In order to correct this issue, check if the SAP Notes 2059334208010520864132103533215599621566622225065 and 2231599 are already implemented in your system. In case these SAP Notes are already applied in your system, review the list of the topic B.
C13 - Message 'Last ODN approved by AFIP is not the same with table J_1ACAE. Do you wish to update ODN in table J1ACAE?': Also the other messages 'Último ODN aprobado por AFIP no es coherente con la referencia en la tabla J_1ACAE. Desea actualizar ODN en tabla J_1ACAE?', 'No hay doc.disponibles p.actualiz.números ODN'. In order to correct the situation, check if the SAP Note 1819381is already implemented in your system. In case this SAP Note is already applied in your system, review the list of the topic B.
C14 - Rejection 'Code 1640 Description: Campo Incoterms invalido: El mismo es obligatorio para comprobantes tipo 19, tipo de operación 1 (Productos) y debe ser alguno...': As mentioned in the SAP Note 1922138, Incoterms are only mandatory when the official document type is 19. Check SAP Note 1659814 that informs you about the need to implement a BADI in order to fill the Permisos and Incoterms data for export scenarios. Review the Incoterms customizing of the attachment SETUP_AEI_WS_EXPORT.DOCX. SAP does not provide sample codes to implement this solution. Define your own solution to fill these fields via BADI_AEI_WS_EXP_2758. Also, check if the Unit of Measures are correctly maintained in table J_1A_UOMCODE.
C15 - Rejection 'Code 1720 Description: Campo Permisos:Obligatorio para Tipo_expo:1, Cmp.Cbte_Tipo:19 , Cmp.Permiso_existente:S': In order to correct this issue, check if the SAP Note 2389743is already implemented in your system. In case this SAP Note are already applied in your system, review the list of the topic B.

D - PI system with AEI solution
D1 - Customizing details:
In case you face issues with PI system and AFIP, we suggest you to check the instructions of SAP Notes 1630478 and 2335190, and the attachments related to PI customizing from SAP Note 1659814. These contents introduce the technical flow involving this mapping. It makes easier to understand the checkpoints that are proposed afterwards. Also, in the ERP, go to AEI Monitor J1AEXPMONITOR with any Company Code and then execute. In the next screen, select one document and click in 'Check RFC Connection'. This calls BAPI_AR_WS_CONN_TEST, which communicates with PI through a RFC sender channel. In the PI, Mapping MM_Request_FEDummy is initiated. In this mapping, BAPI_AR_WS_LOOKUP_TOKEN_SIGN is called by communication channel CC_Rcvr_RFC_Lookup_TokenSign.
This BAPI uses the value of the following three variants CUIT_COMP_CODE, WS_SERVICE and GEN_TIME to see if there is an already valid token and sign in ERP. Notice that token and sign given by AFIP webService(WSAA) has a validity of 12 hours. Once there is one, it is saved in table J_1A_WS_TKN_SIGN during those 12 hours. PI uses the same token and sign without the need to consult WSAA. When there is no valid Token and Sign (because 12 hours expired or because table is empty), BAPI returns an N as answer to PI, like the following below. When it happens, PI calls WSAA to get a token and sign through a SOAP receiver channel CC_Rcvr_SOAP_WSAA. Once it gets them, it saves them in the ERP, using the same BAPI.

<?xml version="1.0" encoding="UTF-8"?>
<rfc:BAPI_AR_WS_LOOKUP_TOKEN_SIGN.Response
xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
<RETURN>N </RETURN><RET_SIGN></RET_SIGN><RET_TOKEN></RET_TOKEN>
</rfc:BAPI_AR_WS_LOOKUP_TOKEN_SIGN.Response>

Check the following points to narrow down the problem:

D1.1 - Keystore entries for each Company Code are entered exactly the same between the NWA keystore view and FixValues in the mapping.

D1.2 - Certificate chain for WSAA are not expired, and imported into the TrustedCAs in a completely right order. Refer to the following question in attachment PI_FAQ.ZIP in SAP Note 1659814.

D1.3 - Application user (default as PIAFUSER) is assigned with role SAP_XI_ADMINISTRATOR_J2EE, which makes sure the accessibility to the keystore views. A useful try may be to move the Certificate entries to TrustedCAs, and also replace the Constant for keystore view with TrustedCAs in the mapping.

D1.4 - If problem still occurs, try to collect the inspector trace on receiver channel CC_Rcvr_SOAP_WSAA according to SAP Note 1514898.
D2 - AFIP certificate renewal:
In order to renew the certificates from AFIP, access your PI system, go to transaction SXMB_IFR in the ABAP Stack of the PI and navigate to the ESR tools. Then logon to 'Netweaver Administrator (NWA)', navigate to Configuration Management > Certificates and Keys. In this screen you should use the Import button.
D3 - Error 'Could not parse XMBMessage':
The following error is shown in the AEI Monitor J1AEXPMONITOR 'Error The message was successfully transmitted to endpoint com.sap.engine.interfaces.messaging.api.exception.MessagingException: XIMessage creation failed (inbound). Reason: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Could not parse XMBMessage. Reason: java.io.IOException: invalid content type for SOAP: TEXT/HTML using connection SOAP_http://sap.com/xi/XI/System. Error The message status was set to FAIL'. Go to the transaction SXMB_ADM > Integrationn Engine Configuration and check if your server is configured as hub with the same URL or not. More details in the following link: https://scn.sap.com/thread/1353221
D4 - Problem 'Error while getting token and sign from WSAA':
The situation happens in PI system and it generates issues in the statuses of AEI documents in AEI Monitor J1AEXPMONITOR. In case you have your AFIP certificates in the Key Storage View 'WSAA_Certificates', move these certificates to the 'TrustedCAs' store and retest your scenario.

E - Previous AEI solution
Argentina's AEI J1ACAE solution (also known as Facturador Plus) is not supported and enhanced since 2012 and no legal updates are developed anymore for it. This solution is outdated and it was replaced by AFIP's RG2485, RG2904 and RG2758 laws. Review the main SAP Notes 16598141558532 and 1537823. The new solutions bring process automation to make the invoicing faster and precise. SAP recommendation is to migrate to the new solutions. New legal changes and requirements will be updated only in the new solutions of AEI (RG2485, RG2904 and RG2758). If you need help with the previous AEI J1ACAE solution, request a consulting service.








Read more...

Keywords

J_1A_WS_DOMESTIC, EXCHANGE_RATE, VBRK, BL001, BKPF-XMWST, BKPF, XMWST, Argentina, FOREIGN_TO_LOCAL_CURR_AMT, field, sucursal, sociedade, J1ACAE, J1_ACAE, J1A_CAE, REBZJ, BSEG-ZTERM, BSEG, ZTERM, SOAP Foult, SOAP, Foult, J_1A_WS_AEI_BILLING_CHECK, Function BAPI_AR_WS_CONN_TEST not found, fm BAPI_AR_WS_CONN_TEST not found, domestic, domestico, pesos, pessos, ars, pes, factura, factura electronica, eletronica, eletrónica, electronic, eletronic, cliente eventual, argent, argentine, argentinean, J_1A_WS_BRANCH_DETERMINATION, law, laws, requisite, requisites, J_1A_WS_AEI_UPDATE_TASK, aduana, J_1A_WS_BUILD_BILLING_DATA, 8A137, F-22, J_1A_WS_CAE001, Tierra del Fuego, Land of Fire, S4HANA, SAP/4HANA, on-premisse, on premise, Administración Federal de Ingresos Públicos, RECE, faturador, xmlToString, jar, wsaaClass, LJ1AETOP, J_1A_WS_MONITOR_FORMROUTINE, J1AWS_BG, J1AWS_ARCH, J1AWS_APP, J1AWS_PRES, J_1A_WS_MONITOR, J_1A_WS_REMOTE_CALL, token & Sign, token and sign, Argentinean, Argentinian, J_1A_WS_EXPORT_MONITOR_FORM, RV_INVOICE_DOCUMENT_ADD, J_1A_WS_EXP_REMOTE_CALL, J_1A_WS_EXPORT_MONITOR_LOG, J_1A_WS_EXPORT_MONITOR_MOD_PAI, BADI_SD_BILLING_ITEM AEI_WS_BILLING_CHK, BADI_SD_BILLING, AEI_WS_BILLING_CHECK, INVOICE_DOCUMENT_CHECK, VBRK_VBRP_DATA_TRANSFER, J_1A_WS_POST_BTE_CHEC_1025, J_1A_WS_POST_BTE_UPDATE_1030, SAPLJ1AE, J_1ACON, J_1ACONT, J_1A_AFIP, J_1A_ARCH, J_1BBRANCV, J_1A_ODN, J_1A_WS_BUILD_CASH_DISC_DATA, J_1A_WS_UPD_CASH_DISC, J_1A_WS_REJ, J_1A_RFC_DEST, J_1A_WS_TKN_SIGN,  J_1A_WS_BRANCH, J_1ASNR, J_1A_CURCODE, J_1A_UOMCODE, BAPI_AR_WS_LOOKUP_TOKEN_SIGN, KTOSL, J_1AUOMCODE, TRIBUTOS, ALICIVA, IMPORTEOTROSTRIBUTOS, DATA_RETRIEVAL_SD, DATA_RETRIEVAL_FI, DATA_RETRIVAL_FI, TOT_DOC_AMOUNT, TOT_TAX_AMOUNT, STCD1, SETTLEMENT, REBATE AGREEMENT, KOAID, UNIT_PRICE, WA_J_1A_WS_DOMESTIC-CUST_CUIT, DATA_RETRIEVAL_SD, LT_KONV, WA_ITEM_AMT-DISCOUNT_AMOUNT, GET_ITEM_DETAILS, J_1A_WS_CAE008, J_1A_WS_CAE 008, Incoterm, Incoterms, PERMISO, EXISTENTE, PERMISO_EXISTENTE, rg 2758 LJ1AEF04, 1720, Obligatorio, Tipo_expo:1, Cmp.Cbte_Tipo:19, Cmp.Permiso_existente:S, Regime, Cbte_Tipo, Comprobante, Tipo, Error 1720, Cmps_asoc, MM_Request_FEXAuthorize, namespace. , KBA , XX-CSC-AR-LO , Logistics

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP ONE Support launchpad (Login required). 

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.

Fonte: https://apps.support.sap.com/sap/support/knowledge/preview/en/2370720

Nenhum comentário:

Postar um comentário