Skip to Content
Author's profile photo Konrad Thalheim

NRO access from mapping (ESR)

A while ago I discovered SAP Note 2035054 which includes a java code and a documentation of a programmable API to access, read, create and update number range objects (NRO) in SAP’s B2B Addon.

This blog is a short summary of a how to implement this API.

Import the right Libraries

First of all, we need to import the extracted from the PIB2BCONTENT.SCA to the ESR.

Additionally to this you need the EJBJEEArchive as well to get all functions of this API working.

Implementation Example createNewNRO

Let‘s assume we need an UDF which creates a new number range object (NRO) during runtime.

We would like to mass upload updated NROs to the b2b integration cockpit from a XML file. We maintain the XML file with a standard tool like MS Excel and upload it via a file or SOAP channel to the b2b integration cockpit.

Our implementation (message mapping) for this specific use case looks like this:

Due to the tests we created these NROs:

The successful access of NRO API can be reviewed in the log of the specific

Our implementation example of createNewNRO was taken from SAP Note 2035054.

Other code snippets and examples can be found in SAP Note 2035054 for the following UDFs







Because of the execution of the UDFs during runtime, the NRO will be updated with getAndUpdateNumberRangeObjectWithName regardless the mapping program has finished successfully or not. Therefore multiple restarts of your mapping will cause multiple updates of the NRO. So this behavior should be considered by the b2b designers.

To prevent this use the read function of this NRO interface API and update the NRO at the end of the mapping.


This API is a great way to manage NROs within any mapping. It opens a wide range of use for b2b developers in SAP b2b addon.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Manoj Kh
      Manoj Kh

      Hi Konard,

      Thanks for the blog this was much needed with respect to B2B Addon.

      just wanted to know if thier is any way to set a variable in Toolkit to a particular value , because when we are migrating from seeburger to B2B some counters need to have to be set to particular value so thier will be continuity , is thier any way to do this directly in toolkit?



      Author's profile photo Konrad Thalheim
      Konrad Thalheim
      Blog Post Author

      Hi Manoj,

      yes this is possible: I have posted an example for this too: Use Case NRO API Access: Dynamic Counter Variable.

      It is also possible to create the NROs dynamically if they are called the first time. So you just configure your scenarios and will not care for NROs. However we rejected this idea in our migration project, because we would like to know, when the NROs cannot be found. ūüôā

      Kind regards


      Author's profile photo Thirupathi Polsani
      Thirupathi Polsani

      Hi Konrad,


      Thanks for the information.

      Is there anyway we can transport NRO objects from dev to QA.




      Author's profile photo Bhavana C
      Bhavana C

      Hello Konrad,

      I have implemented getNROWithName API in my mapping and mapped to the root node of the target structure for dynamic file name purpose. And also implemented  getAndUpdateNROWithName  API in the same mapping and mapped to the mapping variable. Mapping variable is being used to map many other fields in the target structure. The main requirement here is to have the same NRO number for file name portion & in the payload counter.

      My issue here is, I am getting an error saying that file already exists. This is because of getting the same NRO number for two messages that arrived PI same time and are being processed same time to construct the file name.

      Do you think lock would acquire when these API's are called from mapping while getting NRO? So that it can avoid getting the same NRO number for two messages processed at the same time.


      Author's profile photo Alexander Aigner
      Alexander Aigner


      where did you get this EJBJEEArchive

      I cant seem to find any information on this besides this blog.

      Thanks and best regards,


      Author's profile photo Lakshmana Kumar Vempadapu
      Lakshmana Kumar Vempadapu

      Hi, Where did you get this EJBJEEArchive ? 

      Thank you.

      Author's profile photo Lakshmana Kumar Vempadapu
      Lakshmana Kumar Vempadapu

      FYI - Found that under namespace of standard B2B MAPPING KIT ESR Content. Thank you!