Mexico CFDI 3.3 invoice in SAP S/4HANA Cloud
The e-invoice in Mexico is the final document in an regular OTC process. CFDI 3.3 document is the only valid invoice document for the fiscal Mexican authorities.
In this blog post we will see how to prepare the system to trigger the electronic invoices document for the customers using the standard functionality for Mexico localization in SAP S/4HANA Cloud.
We will start with the first steps of configuration of the localization for e-inoice for Mexico.
Configure Value Mapping.
With the role of Configuation Expert (BR_CONF_EXPERT_BUS_NET_INT) open the app of Configure Value Mapping.
This process steps show you how to create the required value mapping for generate the electronic invoices.
Blart, payment document types
CFDI_PAYMETHOD Assign SAT(Mexican fiscal authorities) Payment Method codes. Those are the relation between SAP payment terms and SAT payment method codes (all the SAT codes catalog you can find it in the web page of the SAT).
CFDI_PAYMNT_MEANS Means of payment. Relation between payment method from SAP S/4HANA Cloud and payment means of the SAT authorities.
CFDI_TAXES_ASSIGN Assign SAT Tax types and factor types. You need to assign all the tax types you will be use in SAP S/4HANA Cloud and the relation with the SAT tax type.
CFDI_USAGE Use of CFDI for correponding customer. Assign the corresponding CFDI usage at your customers, according at the type of transaction (This information is available in SAT catalog of CFDI in SAT government portal).
Note: In case you need to create your own logic for filling CFDI_USAGE per customer, you can implement the localization BADI for Mexico Usage of CFDI, this BADI is called during the maping of the XML, which is triggered when you submit an eDocument from the Mexico eInvoice processes of the eDocument Cockpit.
DOC_TYPE Document type. Identify for the SAT authorities what kind of transaction (incoming or egress) represent the document types used in SAP S/4HANA Cloud.
FORMA_PAGO Method of payment of the transaction.
PRODUCT_CODE Assign Product/Service codes to material numbers. It is the relation between the SAP products or services codes in your SAP S/4HANA Cloud system between the SAT codes, provided in the SAT catalog that you can download from SAT portal.
SERVICE_PROVIDER Assign service provider for a company code. Assign the name of your PAC (authorized supplier by the SAT to certified the e-invoice) provider for your company code.
TIPO_RELACION Relation type based on related document type. Relation between CFDI (SAT) documents and SAP S/4HANA Cloud documents.
UNIT_OF_MEASURE Value mapping for UOM with SAT description. Assign the relation between the unit of measures in SAP S/4HANA Cloud and SAT unit of measures (available in the SAT catalog mentioned above).
After you end all those previous steps, you can trigger you e-invoice documents, below show you how after invoice document is generated in billing in the create billing documents app, the invoice document is trigger to e-document cockpit.
In e-document cockpit we can see our invoice document, in preview status to be submitted to the PAC.
Once the invoice it´s submitted if everything was configured correct and the connection with the PAC it´s in place, you will see the status change in green color and the message “accepted by the authorities” that means your document have all the fiscal requirements and the XML document obtain the fiscal stamp and it´s a valid document as the image below..
The image below is the xml sample of the invoice triggered above.
Additional you can see the representative printing version of the XML obtained.
We saw from functional perspective all the previous requirement to configure the value mappings to obtain e-invoice document in Mexico will all the requirements needed by fiscal authorities, using the standard functionality of SAP S/4HANA Cloud. Please follow all the steps and follow our best practices to obtain the reach the goal in SAP S/4HANA Cloud.
Please feel free to contact me by direct message or an e-mail, thanks.
Thank you Victor, it’s a great information.
Muchas gracias Victor,
¿cómo podría ponerme en contacto contigo para hacerte unas cuestiones?, tenemos un cliente en México y no termino de entender algunas cosas.
Un saludo y gracias!
Hi Rogelio you can contact me posting your questions on the customer community or send your questions directly here, thanks.
Thanks Victor - good article. My global company is in the process of moving to S4 HANA by the end of 2022. As our Mexico business has grown, we have outgrown the company that we use to interface the SAT with. Can you list some recommend companies to look at for this as we move forward? It sounds like from your article, that we will still need a Certified 3rd party for CFDI 3.3 on HANA.
Thanks so much,
Yes you will need a PAC (Certified supplier by the tax Authorities), i can listed you some supplier as options EDICOM, PEGASO, ekomercio, that you have time to evaluate and talk with them.
Thank you very much Victor.
We currently send billing doc data from SAP to a 3rd party, who uses a "black-box" solution to add custom customer data, before sending to the PAC (currently MasFactura).
There are a lot of individual billing doc customizing that our customers in Mexico keep asking for, and I hope it will be more straight forward in HANA to accommodate them. Has this been your experience as well?
When we go to HANA for our Mexico operations, we would eliminate that middle-man, and our outputs would go directly to a PAC. BTW - what does PAC stand for? I know it's not Political Action Committee LOL.
Yes Scott, we have an standard solution in S/4HC for Mexico, to avoid as many workarounds possible. But you can contact me through an e-mail if you want to have more details and we can talk later.
Strange question, but how close is the configuration in S4C to S4H OP?
If you use the standard functionality in OP version is pretty close.
Please let me know if the xml contains the status which gets updated in CFDI??
If you are talk at the status of the invoice, only completed documents can trigger to create the CFDI in other case the xml is not generated.
Quisiera tu apoyo con lo siguiente:
Actualmente estamos implementando S/4 HANA Cloud, el PAC es Pegaso y usaremos CPI. Tengo las siguientes preguntas:
1. La forma de enviar y recibir informacion es por el Idoc MXCFDIREQ001 y MXCFDIRESP001 respectivamente? o que otra opcion existe?
2. Debemos activar alguna nota o servicio para poder tener acceso a esta funcionalidad?
Regarding your comments, those forms that you mentioned are not necessary if you will be use CPI, throught cpi you will be use a standard iflow, so isn't longer needed use idocs.
How should we maintain email id in BP for Proof of Payment and Invoice .
I have a faced some problems during configuration of mexico invoice, I hope there is a standart solution in S4HC which can help me. We Bill our Clients from Projects and for some clients we have a really big item description wich we need to add to xml and to client pdf. In their old system (not cloud) you can see that the field description permit them to add a large description for billing item:
By standart configuration SAP brings in xml a Material description, which is defined in Material master data or also can be changed in project in billing part
The problem is that this field has a limit and doesn permit us to add all information we needed.
The maximum what i can add in cloud is:
Is there any standart solutions which can help us to add large texts in Descriptions.
The only way that you can see this kind of large texts is implementing a logical in the Badi e-document México, to send this large descriptions to your xml file, as an instance based on your customer an material type, create your variant.
Hope those coments can guide you.
Thank you for your reply=) It's guide us but not too much to be honest.
We have checked the Badi's SAP offers us to Mexico e-invoice and from what we can see no one can solve our Problem. Because:
and the last one is:
3. Mexico: Custom Data Filling . Which permits us to fill this 3 fields but it doesnt helps us bacause it doesnt change the description of material in xml and doesnt bring the text to every item in xml.
Honestly it is really strange for me that we have this problem at all, because i think it is pretty comon to add more then 60 letters to the description of Item.
I really hope that i just couldn't find the rigth Badi and you can help me with it, otherwise I really don't know how we can solve this problem for our clients.
I am not quite familiar with the differences between the OnPrem solution and what we have in S/4HANA Cloud however from the technical point of view and talking specifically about e-Invoices (e- documents generated by SD documents), the logic found in the backend system pulls the description of the item from a field called VBRP-ARKTX (Short Text for Sales Order Item) which has a length of 40 characters and drags into a new field ITEM-DESCRIPTION which is a string field (can hold way more than 40 characters) so maybe your problem is exactly here! My suggestion to you is the following:
I hope that somehow any of my suggestions helps you with your project.
Thanks a lot,
Thank you for your reply=))
I've checked the option with Addendas, but from what I can see Addenda appears below all items and it is just one field. What i mean it doessn't appears below the item and can't be fiffrerent if any item has it's own description. For example as you can see at this picture, I have different description for Items and unique description for all items in Addenda also as i mentioned before it is in the end of xml =(
I would like to use the badi, Victor suggested, but I don't understand what badi he means, because all I see don't solve my problem.
To open an incident to SAP - I think it will be my next step=))
Thank you =)
Sorry for not replying to you sooner but the BADI Victor refers to is exactly the one you have used in order to create the addenda. As I said, the addenda is a section of the CFDI file where the mexican tax authority (SAT) allows companies to exchange information agreed between both parties ( buyer and supplier ) and this section is the last one in the CFDI file. Everything that comes prior to this section is created by the standard logic in S/4HANA Cloud and cannot be modified ( except for some really specific date such as withholding taxes ). This addenda solution I suggested is just a workaround because the standard is limited to those 40 characters I mentioned before).
Those "conceptos" nodes you can see are the items found in your billing document and you could ask to your developer to add the item line number as an ID and right next to the ID, inform the long description of your item - for instance:
Unfortunately you will not be able to affect what comes prior to the addenda because, as I said, it's pretty much standard logic and there's no functionality available so far to modify the description of the goods.
i have another question about Addenda node in XML. Do you know if it is possible remove this node from our XML?
We have a different SAP Cloud systems and I can see that in one system when we create XML the Addenda node doesn't appears. It makes me belive that it is possible to remove it, but i can't find how=((
In case if you know how we can do this, i have the next question. Is it possible to remove it just for one company code in the same SAP System?
Yes it´s possible, looks like you activate the foreign trade complement (or in spanish Complemento de Comercio Exterior), in e-invoice configuration settings for Mexico and looks your parameters in foreign trade for your customer.
Thank you Victor=)
I was checking the configuration we have in Manage your solution.
If you refer with activate the foreign trade complement - to this 103449 - Assign Complement Types to Customers
We have nothing activated:
and there is another step 103804 - Define Fixed Values and Value Mappings for the Foreign Trade Complement , but i dont think you reffer to this one.
Are there any other options how we can delete Addenda node from XML?