Number Range Objects for EDI in SAP Integration Suite (BTP-IS, CPI, PI/PO)

In EDI transactions, every message transmission is wrapped in an interchange envelope, and each envelope requires a unique Interchange Control Number (ICN). These numbers ensure that messages are traceable and prevent duplicate transmissions between trading partners. ICNs are a critical part of the EDI standard and play a key role in maintaining the integrity of the data exchange process.

For example, EDI segments ISA.13 (Interchange Control Number), ST.02 (Transaction Set Control Number) or IEA.02 (Interchange Control Number) are a few segments where unique sequence numbers are required. Not only these Control Numbers, but you can assign a unique number to any element of the message using Number Ranges. Another use case is setting a unique number to part of the generated file name.

In SAP Integration Suite (BTP-IS/CI/CPI) and SAP PI/PO, managing these interchange control numbers efficiently is essential for ensuring seamless EDI communication. This is where Number Range Objects come in. By using number range objects, BTP-IS-CI can generate and assign unique ICNs for every interchange, ensuring that each transmission is properly tracked and handled.

In this blog post, we’ll discuss how to use Number Range Objects in SAP CPI and SAP PI/PO, and explore different methods to retrieve or generate these numbers. The unique number allows us to avoid common issues like duplicates and facilitates traceability of EDI messages.

Steps to Configure a Number Range in SAP Integration Suite (BTP-IS/CI/CPI)

Practical EDI Integration Usecase Scenario

In this scenario, you receive a bulk EDI message containing multiple individual transactions (e.g., multiple purchase orders or invoices bundled together) to SAP Integration Suite. To process these efficiently, you first need to split the bulk message into individual transactions using an EDI splitter in SAP Integration Suite. Once the transactions are split, each one must be acknowledged with a Functional Acknowledgement (FA), such as a 997 in ANSI X12 or CONTRL in EDIFACT, which confirms receipt and validates the syntactical correctness of each transaction. To ensure each FA is unique and traceable, a unique control number must be assigned to each generated FA.

You can copy over the Control Number of the incoming EDI message and assign it to the FA generated. Or you can define a Unique Number Range and assign the Control Number from that. In this example, we will use the latter.

Understand the Pattern of the Number Range

  • The ISA13 element holds the Interchange Control Number, which is a 9-digit numeric value.
  • It is padded with leading zeros if necessary to ensure it is always 9 digits long.

ISA*00* *00* *ZZ*SENDERID *ZZ*RECEIVERID *211013*1200*U*00401*000012345*0*P*>~

In this sample ISA segment, 000012345 is the ICN. If you assign the value as 12345, it becomes an invalid EDI message.

Create a Number Range in the Integration Suite

Go to SAP Integration Suite and select the Option Number Range.

Create a new Number Range by using the option “Add“.

Assign a meaningful name and define the Minumum Value and Maximum Value of the Number Range. Also, configure the Field Length, in this scenario 9 digits.

I will also activate the option “Rotate” so when the number range reaches the maximum value of 999999999, it starts back up from the minimum value, zero.

Configure the EDI Splitter and Configure the Interchange Number Option

Now I have activated the option to “Create Acknowledgment” to Required so EDI splitter generates FAs after splitting the bulk EDI file.

I have set the “Interchange Number” option to “Number Range” and provided the name of the number range object I generated in the above step.

Test the EDI Interface

Let’s trigger the interface with multiple transactions in the incoming EDI message body.

Notice the ISA Control Number of the FA 997 assigned from the Number Range.

The number Range Status will be changed and it will show the next number inline.

 


Steps to Configure Number Range Objects in SAP PI/PO

  • Create the Number Range Object in B2B home.

  • Call the number range in message mapping and map the value to the target field.

  • Configure the receiver adapter modules to call the number range.

Let us look at these three steps in detail.

Step 1: Create the Number Range Object (NRO) in B2B Home

You should be able to access Netweaver B2B Integration Cockpit home using URL http://<host>:<port>/b2bic

 

Go to Number Range Object (NRO) Maintenance under B2B Home

 

Select NRO Maintenance in B2B home
Select NRO Maintenance in B2B home

 

Create New Number Range Object
Create New Number Range Object

 

Provide the essential parameters such as NRO name, minimum value, maximum value, and number range length.
Set Number Range Object (NRO) properties
Set Number Range Object (NRO) properties

 

Step 2: Call the Number Range Object in Message Mapping and Map the Values to Target Field.

The number range should be mapped to the target field as below. Use a Constant to assign with the value in the format ‘$B2B_UEBNR<Number Range Name>$B2B_END_UEBNR’.

 

Assume our number Range Object (NRO) name is OTC377_BSN02.

 

Constant value should be configured as “$B2B_UEBNROTC377_BSN02$B2B_END_UEBNR”.

 

Mapping Number Range Object to target element
Mapping Number Range Object to target element
Number Range Object Mapping format
Number Range Object Mapping format

 

Step 3: Configure the Receiver Adapter Modules to Execute the Number Range Object.

In the receiver communication channel include the module “TransmissionNumberModule” with module key “NRO”.
Configure Receiver Communication Channel with 'TransmissionNumberModule'
Configure Receiver Communication Channel with ‘TransmissionNumberModule’

 

If you have any question about Number Range Objects, please leave a comment below.

Encode Message Payload to Base64 on CPI!

How to use Base64 message encoder in SAP Integration Suite.

Subscribe for more

My First Interface on CPI!

Learn how to develop your first iFlow on SAP Integration Suite within 7 minutes!

Subscribe for more

18 thoughts on “Number Range Objects for EDI in SAP Integration Suite (BTP-IS, CPI, PI/PO)

  1. saritha says:

    Hi,

    I want step by step procedure for B2B Scenario. I saw different types of scenario’s but i am not getting. Please provide the end to end scenario for B2B

    Thanks
    Saritha

    • Isuru Fernando says:

      Hi Reddy,

      I have provided the output in message log screen shots. You cannot view the queue of NRO objects in graphical mapping.

      Cheers!
      isuru

  2. Raghu says:

    Hi Fernando,
    Thanks for sharing your knowledge.
    What is the usage of Rotate Option in NRO Creation and in which cases we need to enable this Rotate Option.
    Any idea,Please share the details if you came across this option.

    Thanks & Regards
    Raghu.

    • Isuru Fernando says:

      Hello Raghu,
      If this option is activated, the number range will restart from the minimum value again after the range is fully utilized. That is, range will reset to the mimium value when the maximum value is reached.
      Use cases depend on the functionality of the NRO. You can activate this option if resetting the NRO automatically is fine. Else, you need to manually maintain the ranges again.

      Cheers!
      Isuru

  3. srija says:

    I used NRO same it was shown here but when i test it instead of getting value i’m getting what ever given in constant. Can you please tell where i’m going wrong in maintaining.

      • Michael says:

        What do you mean correctly configured? I added the module in the receiver modules as modulekey “NRO” and before the callSAPadapter. But still getting the constant instead of the number (which is issued, because I it is increased)

  4. Abdulahan says:

    Hello.
    We sometimes get an error: “transmission number module was not able to acquire lock”.
    What could be the problem?
    Thanks.

  5. Neha says:

    Hello,

    for one NRO i am using default length as 6 and the max value as 999999 but still i am unable to get leading zeroes. Need your guidance!

Leave a Reply

Your email address will not be published. Required fields are marked *