cancel
Showing results for 
Search instead for 
Did you mean: 

Create Sequential Numbering in Message Mapping

Former Member
0 Kudos

We are using XI 3.0 with R/3 Enterprise.

I am working on a scenario:

Webapp to xi to R/3 to xi to webapp to xi to R/3.

Basically, users log onto web site, request invoice details from R/3, dispaly invoice in webapp, pay amount and post receipt into R/3!

As we are posting an accounting document we have to pass accross the accounting document number.

I have tried the following to generate a number for the externally assigned number:

Constant: 9800000000 and A Counter starting from one( with increments of one) add together and map into obj_key field on accounting document header. When I test the mapping, I get the following:

Debug:Start tag [OBJ_KEY]

Debug:Put value [9.7999995E9]

Debug:Close tag [OBJ_KEY]

Is there an easier way to assign a sequential/incremental number into mapping??

Regards.

Barry Neaves

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

Hi Barry,

have you tried the standard parrtern?

<b>Mapping “Patterns” – Sequence–Number Generation</b>

from:

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/mapping functionality in xi.pdf

Regards,

michal

Answers (1)

Answers (1)

Former Member
0 Kudos

I have implemented a simple function in one of my mappings to generate sequqnce nos. Modify the code according to your requirement

//write your code here

GlobalContainer globalContainer;

globalContainer = container.getGlobalContainer();

Integer count;

Object obj =globalContainer.getParameter("Count");

if (obj==null) count =new Integer(0);

else count = (Integer)obj;

count=new Integer(count.intValue()+1);

String szero="";

String str=count.toString();

for(int i=0;i<5-str.length();i++)

szero=szero.concat("0");

str=szero.concat(str);

globalContainer.setParameter("Count",count);

return str;