on 02-20-2013 7:59 AM
Hi Folks,
Being i don't have much knowledge in Java coding , i need help in writing an UDF for the requirement mentioned below.
"For First Customer line default value should be "0001" for each record type . For each next Customer Line this value should be increased by 1. e.g "0002"
Thanks in advance!!
Regards,
Balu
Hello,
There is already a built-in function for this in message mapping, you can use Statistic function called Index . It also gives you the option to reset the counting per context change or to continue the counting.
Hope this helps,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mark,
Thanks for your help,
And one more query as am having many customers and for the first time occurence of each customer it should be 001 and further occurence it has to be increased by "1" i.e 002 . It should happen for every customer.
Please suggest me if the Index function can satisfy this.
Regards,
Balu
ok understand.
you meas you get maybe today 2 customers sended. With 001 and 002.
And another one tomorrow which should get automatic 003?
In this case you have to store the existing customer numbers somewhere.
Possible solution would to create a RFC function which handle that in a ABAP Table or Number Range Object. So you can use the RFC Lookup function to get the next free customer number for your mapping program... and the RFC handle that it never return the same number twice.
to store a counter/index value from one mapping instance for another one is not possible.
regards,
Robin
Hi,
in a UDF you can use:
for (int i =0; i< input.length; i++)
{
result.addValue(i);
}
input is your UDF input ... so the number of customer Lines.
But why you want to use a UDF? just use the standard COUNTER or INDEX function.
regards,
Robin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.