Ansicht
Dokumentation

IDFB_COMPUTE_CHECKNUM_SE_001 - Generate Payment Reference Number (Sweden, Modulus 10)

IDFB_COMPUTE_CHECKNUM_SE_001 - Generate Payment Reference Number (Sweden, Modulus 10)

ABAP Short Reference   Vendor Master (General Section)  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

This function module generates the payment reference number in a format suitable for use in Sweden.

The payment reference number can be up to 25 digits long, including the check digit.

To calculate the payment reference number, the system uses the billing document number as the basis, to which it adds a check digit as follows:

  1. It multiplies the last digit in the billing document number by 2, then the second-last digit by 1.
Then it starts again, multiplying the third-last digit by 2, the fourth-last by 1, and so on, until it has multiplied all of the digits in the billing document number by 2 or 1.
  1. If any of the numbers consist of two digits, it splits them up into their component parts.
  2. It adds up all the numbers.
  3. It subtracts this number from the nearest multiple of 10; this is the check digit.

Example

Assume the system wants to generate a payment reference number for the billing document number 97172177:

  1. It multiplies each digit in the document number by 2 or 1, starting from the end of the document number:
7 × 2 = 14
7 × 1 = 7
1 × 2 = 2
2 × 1 = 2
7 × 2 = 14
1 × 1 = 1
7 × 2 = 14
9 × 1 = 9
  1. It then breaks the two-digit numbers into their component parts, so the three 14s become 1 and 4.
  2. It adds all of the numbers together: 1 + 4 + 7 + 2 + 2 + 1 + 4 + 1 + 1 + 4 + 9 = 36
  3. Then it subtracts this number from the next multiple of 10: 40 - 36 = 4

The check digit is therefore 4, and the payment reference number is 971721774.

Notes

Further information





Parameters

C_VALUE
I_CHECK_CORRECT

Exceptions

NUMBER_NOT_CORRECT
NUMBER_NOT_VALID
NUMBER_TOO_LONG
NUMBER_TOO_SHORT

Function Group

IDFB

ABAP Short Reference   General Data in Customer Master  
This documentation is copyright by SAP AG.

Length: 2217 Date: 20240523 Time: 080339     sap01-206 ( 37 ms )