on 08-31-2015 9:03 PM
Hi All,
My requirement is to have a global variable that can hold the value and gives an incremented value in next call or you can say I am trying to generate sequence number globally.
Please help me with the UDF to define a Global variable , increment the value and return the variable.
Thanks & Regards,
Nida Fatima
Hi Nida,
in the "Functions" Tab go to Attributes and methods....
just declare a variable there after the comments section like this
int record_count = 0;
or in case you want to store strings etc better declare an arraylist
ArrayList<String> global_variable = new ArrayList<String>();
these variables declared in attributes and methods are accessible globally over multiple udf calls and there value persists and is not lost you can update the variables, increment them etc... in all the udf directly just like a normal variable.
PS: my undertanding is that you need this variable to maintain record count and access that in a udf or for whatever reason but you are looking for a global variable localized to one instance of a "pipeline/per message" I mean as soon as the message mapping is over everything is again set to 0.
Regards
Vinay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nida,
Can you check the below blogs:
Else you can try using Graphical function Index:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nida,
The right approach is to use the Number Range Object(NRO) for this purpose.
The Number Range Objects (NRO) module provides the option of automatically inserting continuous counters into outgoing messages.
Please refer the links for details
http://scn.sap.com/community/b2b-integration/blog/2013/06/03/the-convenience-of-number-range-objects
regards,
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
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.