on 05-10-2006 9:38 AM
Hi All,
I have scenario where a sequence number when mapping is done. Consider the example:
In the source message I have one header and 10 line items in the message. The line item in the target message has a field called sequence number. When i map the source message to the target message each of the target line items hould have a sequence number in the order 1, 2, 3..10.
How can this be done? Is there a feature in XI which lets us have a global variable which can be incremented for each line item or a java class which can generate new sequence number for each line item or something.
I'm using message mapping. Java mapping is not used.
Could you please help me?
Thanks,
Sandeep
Hi,
yes, there is a global variable concept in XI which u can use for your Sequence Number concept.
If you are on SP14 and above, just take a lookat this blog and the GLOBAL Variables Section
/people/sap.user72/blog/2005/10/01/xi-new-features-in-sp14
Regards,
bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sandeep
There is a function "Counter". You select this and specify your starting value and incremental value. In your scenario you add one more field to your structure in lineitems and add this counter to that field. So the starting value you give as '0' and increment it by '1'.
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sandeep.
try with this
/******UDF*******/
for(int i = 1 ; i<=a.length; i++)
result.addValue(i+"");
Create queue mapping...assume "a" is String array.
Cheers!
Samarjit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sandeep,
use Message Mapping function <i>index()</i>. Or X-Path funktion <i>position</i>, if you want to use XSLT.
Regards,
Udo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can definetly do using global container or container in message mapping.you can check this out as one of the mapping pattern...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sandeep,
u can follow these steps to generate a sequence no using global container.
-> define a global variable by clicking the JAVA_SECTION_TOOLTIP icon on the design tab of source message type of ur message mapping.
enter the following in the GlobalVariables Section
Integer counter =0;
-> define a user defined function (<b>SeqGen</b> let's say)
write the following code in it.
Integer seq = 0;
GlobalContainer globalContainer = container.getGlobalContainer();
a = globalContainer.getParameter("counter");
seq = globalContainer.getParameter("counter");
seq = seq + 1;
globalContainer.setParameter("counter",seq);
return a;
now use this user defined function (SeqGen)in all ur mappings to the sequence no of ur line items.
Hope this helps.
Anil
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.