on 07-12-2008 4:10 PM
Example my Purchase order number is like this :
1) KL0000098654------ I need to Convert 10 digit Purchase order
First two Alphabetical Must be there I need to remove two Zeros of left side ( After Alphabetical ) .
2) If the purchase order number begins with the prefixes C, CB, D, F, H, I, K, KK, KN, KY, L, RM, Y, YC and T. The IDOC should not be posted to R3 Back end system.
Is there any Java code for this.
Hi
I am answering your first question.
1) KL0000098654------ I need to Convert 10 digit Purchase order
First two Alphabetical Must be there I need to remove two Zerosof left side ( After Alphabetical ) .
You write a UDF
input the idoc no
String a = String.valueOf(idoc_no);
String b,c,len, result;
len = idoc_no.length;
if (a != "")
{
b = a.substring(0,1); // am storing your first 2 char
c = a.substring(4,len); // am ignoring the 2 zeros and storing the no after the zero
result = b + c; // concatinating the first 2 char and remaining no without the 2 zero
return result
}
Hope this will help you.
Thanks
Saiyog
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The second part can be achieved using conditional receiver determination in the configuration.
BR
Sameer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Answer too your first question, there is slight change in code....
String b,c;
String result="";
int len=a.length(); //a is ithe input idoc number
if (!(a .equals("")))
{
b = a.substring(0,2); // am storing your first 2 char
c = a.substring(4,len); // am ignoring the 2 zeros and storing the no after the zero
result = b + c; // concatinating the first 2 char and remaining no without the 2 zero
}
return result;
2. To answer your second question
if(a.startsWith("C")||a.startsWith("CB")||.........) // put your all other conditions
{
throw new RuntimeException("Mapping Error Occurred."); //Once error occurs IDOC won't be posted
}
else
{
return a;
}
Thanks
Amit
<DO NOT ASK FOR POINTS!>
Edited by: Amit Gupta on Jul 13, 2008 1:13 AM
Edited by: Craig Cmehil on Jul 15, 2008 10:06 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
24 | |
11 | |
9 | |
7 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.