public String padZeros(String input){
String output ="";
if(input.matches(".*\\d.*")){
output =String.format("%018d",Integer.parseInt(input));
} else {
output = input;
}
return output;
}
The above UDF will help. Please pass the MATNR value as string in the above method.