Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Leading zeros

Hi,

Source is sending some fields with leading zeros , zeros need to be removed in target system.

In mapping any functions are there ana wat are the functions

Regards,

SB

replied

Hi,

Write a UDF to remove the zeros

public String RemoveLeadingZeroes(String a,Container container){

String str =a;

String res = "";

String temp = "";

String res1 = "";

char ch[] = null;

int count = 0;

if(str != null)

ch = str.toCharArray();

for(int k=0; k<ch.length;k++)

{

if(ch[k] == '0')

count ++;

}

temp = a.substring(count,count+3);

return temp;

}

Above UDF will help u in solving u r issue

Regards,

Jayasimha Jangam

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question