Dear SCN Member,
In order to fully benefit from what SCN has to offer, please register at:
Thank you,
The SCN team
Skip to end of metadata
Go to start of metadata


The purpose of this page is to clarify the customizing of IDCP solution and the use of prenumbered forms in Peru Localization.


In Peru, the use of prenumbered forms is regulated by SUNAT (Superintendencia Nacional de Administración Tributaria), which is the tax authority from Peru. The IDCP solution (program IDPRCNINVOICE) will number the billing documents using the official document numbers provided by SUNAT. The document number comprises up to seven digits. There are no gaps between the digits andor other unauthorized characters. The solution records its document number in the document header.

In order to generate the document numbers, make the settings in Customizing for Cross-Application Components (CA), choosing General Application Functions > Cross-Application Document Numbering > Peru. The numbers are unique, each number is for a unique single document, and they are assigned to Peruvian companies by SUNAT before to printing documents.

If the form was damaged, it is possible to reprint the document on another form. The solution will change the number assigned to the document and marks the old form as void. All documents need to be accounted for. Also, if you print out a document and it is assigned to the wrong form, it is possible to change the document's number too.

The structure of the official number is:

Level 1 - Company
Level 2 - Branch
Level 3 - Type of Document
Level 4 - Legal number by ranges

The structure in the ERP is:

Level 1 - Company Code
Level 2 - Internal Lot number
Level 3 - Official Lot number
Level 4 - Official Lot number (ranges = books)

How to create an invoice in this scenario, print documents, assigning the legal number and performing the accounting update

After the user creates the order, the billing document is created in SD. This will be taken later by the location to assign the legal number.

Usually, when the billing document is created, the system automatically generates a document in Financial Accounting (FI) with all the relevant postings. Where prenumbered forms are used, the system must not generate an FI document until the user print out the billing document. The reason is because a billing document does not become legally binding until you print it out. In order to prevent the system from creating an FI document immediately you create a billing document, you set the posting block for the billing document types concerned.

1 - Run IDCP. Fill the required information.

In the Organizational Data, specify if you want to print billing documents. In the Prenumbered Forms, fill the lot and book of the forms that you want to print the billing documents. In the Print, select it to print out the billing documents.

2 - Press F8 and the second selection screen will appear.

3 - Fill the information required.

In the Prenumbered Forms, fill the official document numbers of the forms that you want to print the system documents on. In the Customers, Creation data and Documents, fill the selection criteria for the system documents that you want to print out. In the Output type, the system only processes one output type in each run of the program. If you leave this field blank, the system uses the output type of the first document. Since each document type is usually associated with a different output type, the output type effectively determines the document type.

About the Posting Status, this group box is only available for billing documents. The most important statuses are 'Posting block', that selects documents that you have created in Sales and Distribution, but not yet printed using this transaction, and 'Accounting document created', that selects two types of billing documents: (a) those that you have created directly in FI and (b) those that you have already printed using this transaction. In both cases, the system creates a accounting document. Therefore, select this indicator only if you want to (a) print billing documents from FI or (b) reprint billing documents.

4 - Press F8 and the result list will appear.

5 - Select the documents that you want to print and choose the green flag button to release (print). If any of the documents are reprints, the Void Document dialog box will appear. Fill the reason for voiding the old prenumbered form, the date, any remarks, and choose the green Check button. If you have selected Check, the system asks you to confirm the printout. You have to choose 'Yes'.

For documents with the status Posting Block, the system creates an accounting document, prints the documents on the prenumbered forms, and records the official document number in the billing document or delivery note. For documents with the status 'Accounting document created', the solution will overwrite the old document number with the new one, and records the original form as void.

IDCP reseting the field Reference (XBLNR) to zeros

This is a common situation when you use IDCP solution for Peru. IDCP solution is using an already assigned number from a different Lot Number. The situation happens when the customer have the same number for different Lot Number. The case is possible because each type of operation (like billing sales, credit note or debit note) has a different Lot Number (Folio) for different areas in the company or in the company's division.

In order to solve this problematic scenario, follow the instructions shown in the SAP KBA 1895971.

Related Content

Related Documents

Related SAP Notes/KBAs

Check the SAP Notes below since they are related to the IDCP solution and its use in Peru's scenario. Some SAP Notes are code corrections and others are related to customizing and documentation. Remember to check if it is valid for your release.

SAP Note 301232: Navigation problems in transaction IDCP
SAP Note 305833: Print jobs from IDCP remain in spool table
SAP Note 308348: Entering official document No. in FI documents
SAP Note 319889: Minor enhancements for printing prenumbered forms
SAP Note 322064: Access transaction IDCP via user menue
SAP Note 328788: Reference field is filled with 0000000000
SAP Note 367455: Transfers in Material Management prenumbered
SAP Note 370227: Delivery Note field filled incorrectly
SAP Note 390165: VR 490 when selecting by Shipment Document
SAP Note 397493: Incorrect authorization checks
SAP Note 427867: Incorrect checks for output type
SAP Note 511819: Bad performance, timeout or DBIF_RSQL_SQL_ERROR
SAP Note 515763: Wrong handling for documents in different company codes
SAP Note 664094: Wrong document selection
SAP Note 756397: Using IDCP for countries that are not officially released
SAP Note 756515: Updating allocation field in FI document
SAP Note 1035173: Last number of Official document number Peru not displayed
SAP Note 1530088: New Format for Document class 14
SAP Note 1640402: Dump due to alphanumeric form type
SAP Note 1748798: IDCP is not working correctly