cancel
Showing results for 
Search instead for 
Did you mean: 

12-Digit PO(purchase Order) number to 10 digit PO ( Purchase order)Number

praveenreddy_bk
Participant
0 Kudos

for Example my Purchase order number is like this :

KL0000098654------ I need to Convert to 10 digit Purchase order

First two Alphabetical Must be there I need to remove two Zerosof left side ( After Alphabetical ) .

Is there any Java code for this.

Accepted Solutions (1)

Accepted Solutions (1)

justin_santhanam
Active Contributor
0 Kudos

Praveen,

Write the below code.


String ponum="";
 if (a.length() <11)
{
return a;
}

else if (a.substring(2,4).equals("00"))
{
ponum=a.substring(0,2)+""+a.substring(4,a.length());
return ponum;
}

else
{
throw new RuntimeException("PO Number can't be converted to 10 Digit");
}

raj.

Answers (4)

Answers (4)

Former Member
0 Kudos

First of all take the vlaues in two substrings and then concatinate. But are you sure that there will always tow Alphabets in the begining then do lik this.

Source ( KL0000098654) -


> substring (0..2)

Source ( KL0000098654) -


> substring (4..8) -


> Concatenate -


> Target ( KL00098654)

Regards,

Sarvesh

Former Member
0 Kudos

Hi,

We have the standard funtions in grahical mapping tyr to use them....in ur requirement u can use substring funtion.

Regards,

Phani

former_member194786
Active Contributor
0 Kudos

Hi,

You can take the substrings of the input( first 2 alphabets of the string and den last 8 digits) and then concatenate them. That is a work around. I think it should work.

Thanks and Regards,

Sanjeev Shekhar Singh.

Former Member
0 Kudos

12Hello,

you can use the standard functions concat and substring.

substring1 (0, 2)

substring1(4, 😎

concat substring1 + substring2

The functions are described here (p. 49 and 50):

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9202d890-0201-0010-1588-adb5e89a...

Regards

Patrick