Skip to Content
Product Information
Author's profile photo Ailane Kuhn

Printing an invoice based on existing correspondence type for journal entries with one customer

 

When you post journal entries with one customer account per document to create a simple outgoing invoice in SAP S/4HANA Cloud, you might face some issues when trying to print the invoice within Accounts Receivable. 

The good news is that there’s a workaround available to enable you to print the invoice by maintaining the form based on a pre-delivered template. The form template for FI invoice enables you to cover specific cases for invoices in Financials, such as when you have one customer line item per document or use only G/L account line items with revenue accounts. 

Let’s have a look at the steps below for creating a form template for FI invoice based on a pre-delivered template. 

 

Maintain Form Template 

The first thing you need to do is to get data from correspondence type SAP09. 

To do that, proceed as follows:  

  1. Go to the Maintain Form Template app. 
  2. In the Pre-delivered Templates section, select the FIN_FO_CORR_INTDOC_ENTRY standard form template from the list and copy it to create a custom template.  
    Enter a name for the new form template. For example, you can use FO_CORR_SAP09_FI_INVOICE. The system creates a custom template named YY1_FO_CORR_SAP09_FI_INVOICE. 
  3. Download the template. 
  4. Make the required changes in the local template file via Adobe LifeCycle Designer. Information you might consider changing: you might want to include the customer’s name from the customer line item in the header or even define which fields should be displayed in the form.
    You can find an example on how to adapt the layout of the custom form template in the SAP Knowledge Base Article 3312120.
  5. Test the form template with an XML data file from some correspondence to check how the information will be displayed with the current setting. 
  6. Upload the form template file you’ve changed to the Maintain Form Template app. Make sure the data source remains FDP_FFO_INTDOC_ENT_SRV as defined in the pre-delivered template. 

 

Assign Form Template 

In your configuration environment, use the search function to open the following activity: Maintain the Assign Form Template. Proceed as follows: 

  1. Maintain this configuration activity with the new form template that you created in a previous step. For example, YY1_FO_CORR_SAP09_FI_INVOICE. 
  2. Assign this new form template to Application Object Type FFO_CORR_INTDOC and Output Type INTDOC.  

This way this form can be used for the SAP09 Entry View correspondence. 

For more information about the configuration environment, see Configuration Environment of SAP S/4HANA Cloud.

 

Assign Labels and Company Codes to Correspondence Type Variants 

In your configuration environment, use the search function to open the following activity: Assign Labels and Company Codes to Correspondence Type Variants. Proceed as follows: 

  1. Copy the row for variant S09EN and create a new row. For example, you can create a new row with ID Z09IV for the FI invoice.  
  2. Rename the new entry to FI Invoice.

 

Determine Output Parameter 

In the Output Parameter Determination app, proceed as follows: 

  1. Edit the rules for internal document in the Form Template determination step.  
  2. Add a new row for output type INTDOC and, in the Corr. Identifier column, enter the ID that you created in the previous activity. For example, Z09IV.  
  3. In the Form Template column, enter the name of the custom template which you created previously. 

Make sure you don’t change the existing rows for the internal document. The entry view S09EN and ledger view S09LE are still needed to enable the printing of an internal document. 

Done. You’re now ready to print your invoice based on existing correspondence type in SAP S/4HANA Cloud. 

Here’s an example on how this new correspondence type looks like: 

Here’s an example of a simple invoice printout:

 

For more information about configuring SAP S/4HANA Output Control, see SAP S/4HANA Output Control. 

For more information about the creation of a custom form template based on the internal document, see SAP Knowledge Base Article 3312120.

 

We hope this blog post helps you. Feel free to leave your questions and comments in the space provided below.

 

See you next time,

Ailane

Assigned Tags

      4 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Eric Van Zundert
      Eric Van Zundert

      Hi Ailane,

      Thanks for sharing this blog. This is very useful. We started with version 1708 and missed this functionality since. Especially for inter company charges. Many different GL line items, this was not doable via SD. Also SD process belongs to sales, not to finance. Also we didn't want to have cross charges mixed with 'real revenue' in SAP Analytic Cloud. Till your blog the organization created an FI invoice and the output was created manually in word (copy relevant information in the word document).

      Eric

       

      Author's profile photo Jiri Zezula
      Jiri Zezula

      Hello Ailane,

      thank you for blog post.

      I would like to add, that Form Data Provider (FDP) FDP_FFO_INTDOC_ENT_SRV supports extensibility on Item level.

      - FDP can be extended using 'Data Source Extensions'. Many associations are available.
      - FDP supports also 'Custom Fields' extensibility from Business Contexts (‘FINS_CODING_BLOCK’, ‘FINS_JOURNAL_ENTRY_ITEM’).

      I'd like to mention, that FDP contains 'Notes' posted on both Header and Item level in Manage Journal Entries (#AccountingDocument-manage) as well.

      As result, both Extensions and Notes can be rendered in PDF.

      Best Regards,
      Jiri
       
      Author's profile photo Ravi HM
      Ravi HM

      Hi Ailane,

      Greetings!!

      Thanks for your blog which is helpful to prepare the Customer Invoice Print.

      I would like to get your response for my below queries :

      1. We have binded the below mentioned field, but the system does not shows the entered data "$.InternalDocumentNode.toAccountingDocument.to_Item.C_OplAcctgDocItemCorrespncType[*].InvoiceReference" .
      2. Is there any relevant field was available to display description of  Payment Terms Name.
      3. Whether we can display the G/L details in the descending order based on the Account Code.

      Looking forward to seek your response.

      Thanks & Regards,

      Vidya

       

      Author's profile photo Steffen Riemann
      Steffen Riemann

      Dear Vidya

      Thank you for your feedback and we are glad if this blog helped.

      With regards to your question about the invoice reference, please check the example YY1_FO_CORR_SAP09_FI_INVOICE.xdp attached to the KBA 3312120 (https://launchpad.support.sap.com/#/notes/3312120). This example uses FormCalc script to determine FI invoice related information and assigns the data to corresponding elements in the form template. The element txtCustomMessage for example determines the customer line item with posting key 01 (Invoice) and retrieves data like customer no and customer's VAT registration number. In a similar way you can also retrieve the invoice reference.
      To ensure that you retrieve the invoice reference from the correct line item, you can also download the XML data from the Fiori App "Create Correspondence" and use this for example for the preview in Adobe LiveCycle Designer. To do so, please refer to the SAP Help https://help.sap.com/docs/SAP_S4HANA_CLOUD/918bca53037f408f91a2295d04ac16bc/46bcf6ed75d644e88ba04d298482ca0b.html?locale=en-US and follow the instructions to use the "Download XML" button.
      Please also note, you can only use the invoice reference which is directly stored in the customer line item of the journal entry to be printed. For example, if you would like to print a credit memo, you need to retrieve the data from the credit memo line item and you can print the reference to the associated invoice. However, if you print the journal entry for the associated invoice, the information about the credit memo is not available.

      The payment term description is unfortunately not available in the form data neither. However, you can access the payment terms such as net due days and cash discount terms and based on that it is possible to print payment terms on the invoice. Please check the example example YY1_FO_CORR_SAP09_FI_INVOICE.xdp. The FormCalc script for element txtCustomMessage also creates a description for payment terms (txtPaymentTerms, txtCashDiscount1).

      To display the G/L details in a specific order you might use the FormCalc script features as well. Please check the FormCalc Script for the element rowLineItem. This script processes the journal entry items and selects which data shall be displayed in the table of invoice items and which items are needed to show the tax information. This script could be modified to bring the G/L items into a special order.

      I hope this helps to complete the custom form.

      Best regards
      Steffen Riemann