cancel
Showing results for 
Search instead for 
Did you mean: 

Sequence Number Generation with Global Container

Former Member
0 Kudos

Hi ALL,

Can any plz send me the steps of using global container for generation seqence number's

And also if possible send me the code.

Thanks & Regards

Rupash

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

hi..

There are two ways the sequence number can be generated.

1. Use Advanced User–Defined function to generate the

sequence number all at once.

2. Use Simple User–Defined function to generate the sequence

number for each occurrence separately, keeping track of the

sequence number value previously generated.

PLz chk this link..:

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8a57d190-0201-0010-9e87-d8f327e1...

refer the page No. 64..It is help ful.

Regards

MAnas

reward with points

Former Member
0 Kudos

Hi,

if the system restarts then just you have to put the last generated value to a flat file, from where the value will be read when the system starts again.

for writing/reading value to/from file you can use FileOutputStream and FileInputStream classes.

--Sankar Choudhury

Former Member
0 Kudos

Hi Rupash,

When you use the UDF's as suggested above.

They will work untill you restart the system.

In any case if you restart the system, again it will start generating from Intitial "1".

So if you do not want to Re-initiaze the value , then you need to create UDF by calling RFC lookup and by creating one Ztable in ABAP stack and you need updating everytime the mapping occurs with +1.

Regards

Deepthi.

Former Member
0 Kudos

Hi Rupesh,

chack this code:

public String seqNumber(Container container)

{

int i;

GlobalContainer global=container.getGlobalContainer();

String getnum=(String)global.getParameter("a");

if(getnum==null){

global.setParameter("a","1"); i=1;

}

else{

i=Integer.parseInt(getnum); i++;

global.setParameter("a",String.valueOf(i));

}

return String.valueOf(i);

}

**Reward points if helpful

--Sankar Choudhury

former_member859847
Active Contributor
0 Kudos

Hi Krishna,

Inorder to generare sequential num, we have an option in message mapping i.e java selections.

it consits of three parts.

1.global container

2.local variable

3.clan-up section.

where you have to write java code to generare sequential num.

generate one file with intial seq num,next time it will capture the previous seq num from file( file will be avialable in xi server ).

warm regards

mahesh.

Former Member
0 Kudos

Hi,

Wat is ur requirement. U can generate the sequence no using UDF also.

refer the below link

Global container:

http://www.erpgenie.com/netweaver/xi/mapping1.htm

Thnx

Chirag