The purpose of this page is to clarify the understanding of how the validation of the barcode numbers occurs in the SAP system.
Having a wider knowledge about the way the validation occurs can help you to avoid issues with the user and also implement new validations according to your company requirements.
In the following sections you will be able to understand better these validations and how they can be changed.
What validations are available and how to use them
Currently there are two possible validations for BARCODE, it depends on your current release of the SAP systems. If you have the solution of note 784748 implemented or if you did not implement the solution.
The validation occurs when you enter the Barcode value in transaction FB02. The module bankreferenz INPUT checks if the country of the company code of the accounting document is Brazil ( by calling function J_1BSA_COMPONENT_ACTIVE ) and if so it calls the Barcode function J_1B_BARCODE_CONVERT using the Barcode data from Rf05L-BRCDE.
In function J_1B_BARCODE_CONVERT the first validation done is to check if the barcode contains only numbers. If not, it issues message 8b798 ( The bar code number contains invalid characters ).
Then the program checks if the BADI BOLETO_BARCODE has active implementations.
If not it continues to function CONVERT_TO_BARCODE.
Function can be accessed by se37. The localization function calls the CONVERT_BARCODE function sending the barcode data and the document amount. Inside this function there will be a set
of validations to see if it's filled correctly.
The first validation checks if the barcode is not in blanks and also if it has only numbers. If not it issues error message 8b798.
Then it checks the length of the barcode and how it's filled. It compares the value in the barcode with the amount in the accounting line item. If it differs the system issues error message
8b797 ( Amount in bar code is incorrect; amount in line item can be used instead ).
There is one validation for old procedure and one for new procedure.
The error message 8b797 is customizable via SM30 with view V_T100C.
The area of the message is 8B.
In the new screen you'll be able to add the message number on the left and choose the behaviour you need ( warning, error or disabled ).
2 - After note 784748 activation:
The validation should occur in your own implementation for method VALIDATE. It's indeed stated in the note 78748 as you can see in the excerpt below: As the sample BAdI implementation BOLETO_BARCODE_BR does not provide any validation on the barcode it is strongly recommended to create your own implementation with a validation logic. Copy the BAdI implementation BOLETO_BARCODE_BR and add your checking logic to the VALIDATE method. If you do not require additional validation on the barcode and only require to save the barcode whatever that is entered, you can use BAdI implementation BOLETO_BARCODE_BR without making any changes.
The BADI can be accessed via se18:
The relevant method is VALIDATE.
Here you have to add your own logic to validate the Barcode. It may differ according to the banks within the country.
The method validate is called from method CONVERT.
SAP Note 784748 - Changes in Boleto Amount