on 04-29-2015 6:35 AM
Dear Experts,
I have a requirement wherein its a idoc to file scenario when idocs are triggered at source wherein in a single idoc there are many different SPART(divisions) under each segment.
For particular division alone its adding zeros in front for MATNR(materials) field I wanted to make an conditions either through UDF or graphical mapping wherein it should not disturb other division in a single same xml when reaching the target path.
Please find below screenshot. Kindly help and Many Thanks.
Hi Rajesh,
Try with:
MATNR = MATNR.replaceFirst("^0+(?!$)", "");
Check this thread java - How to remove leading zeros from alphanumeric text? - Stack Overflow
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sahithi,
I tried the same but Getting error which specifies:
Source code has syntax error:
/usr/sap/DPI/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapf066c9a0ee5011e4b51c00226494d57d/source/com/sap/xi/tf/_MM_ITEMMASTER_IDOC_.java:764: missing return statement
}
^
1 error
Code:
public String Getmatnr(String MATNR,String SPART,Container container){
if(SPART.equals("GP"))
{
MATNR = MATNR.replaceFirst("^0+(?!$)", "");
}
else
return MATNR;
Hi Rajesh,
Use if else condition and map it to formatnumber function to add or deleting leading zeros.
Regards,
Suhale Shaik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
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.