on 03-21-2013 11:39 AM
Hi Friends,
I need incremental number as global set and get parameter code.
Please let me know incremental four digit number 0001, 0002,0003...
We have to set initial value at global and use increment whenever file triggers at file name.
example, scenario... IDOC to file , have to write file name by using variables.
Regards,
Deva
Deva,
You need to define
Maintain number range object in PI. This is defined using Tcode - SNRO. Where you need to provide Number lengh domain - for e.g. NUM4 if you want your number as 4 digit long.
Add interval starts with 0001 & To number as 9999.
Create a Z RFC which is in turn calling standard RFC 'Number_Get_Next'. This standard RFC takes Number Range object created in above step as parameter & Quanatity value - which is nothing but increment value which 1 in our case. So its value will be 0001 in your case.
Import this ZRFC in PI. Call this in RFC Lookup function. This will return next number than before each time when RFC is called.
Each time when a new instance will call this will return the next number to the number of the last instance of the mapping call.
Regards,
Ashish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Deva,
If you are using NFS file transport protocol, incremental number to file name can be done by selecting "Add counter" in File construction mode, use step 1, format 0000.
Thanks,
Pranav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Guys,
Thanking for your valuable information.
In this case, what is the approach for incremental value for same mapping? can we achieve by graphical mapping ? need udf ?
Regards,
Deva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Globalcontainer does work within the same context for the persistence but not across messages because it treat as different session context . So doing globalcontainer does not help at all for your requirement.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Guys,
Can you able to tell me java code in mapping as Global Container method ?
sample as :
public String setGlobalContainer(String globalContainerName,String globalContainerValue,Container container){
GlobalContainer gc = container.getGlobalContainer();
gc.setParameter(globalContainerName,globalContainerValue);
return globalContainerValue;
Regards,
Deva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Deva,
You can not use GlobalContainer for incrementing purpose.
Please check this link:
http://help.sap.com/javadocs/pi/SP3/xpi/com/sap/aii/mappingtool/tf7/rt/GlobalContainer.html
Its used for storing values in same message mapping.
So in your case if file has been triggered once and globalcontainer sets the value as 1 , you cant increment the value to 2 for next file.
Please check the options provided by Baskar and Ashish.
Regards,
Beena
You can handle using datbase table in the mapping. Your dba can create sequencer in the table. YOu do jdbc lookup to get the next value in the mapping and use it for the filename. This is an another approach.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
10 | |
9 | |
7 | |
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.