Skip to Content

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 com.sap.aii.nro.interface.filter.jar 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

createNewNumberRangeObject

getNumberRangeObjectWithName

setDeleted

getAndUpdateNumberRangeObjectWithName

updateNumberRangeObject

Limits


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.

Summary

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.

To report this post you need to login first.

3 Comments

You must be Logged on to comment or reply to a post.

  1. Manoj K

    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?

    Br,

    Manoj

    (0) 
    1. Konrad Thalheim 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

      Konrad

      (0) 

Leave a Reply