cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Problem

Former Member
0 Kudos

Hi

Can any one tell me

there is a mapping field which will fill prefix as ZEROs.

For ex:

Gl Code coming from source : It is dynamically change based on transaction. sample Gl codes:

12001, 23001,4511

In traget side i shoud map this field followed by zeros.

Total string length is 10.

so according to GLcodes i should fill zeros as prefix in target field mapping?

I'm doing graphical mapping..but i'm unable to do it..!

please give me ur suggestions..

thank u

regards

rambarki

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

write a simple userdefined function: prefixZeros

int maxlength = 10;

for( int i = 0 ; a.length() < maxlength ; i++ )

a = "0" + a;

return a;

if you pass 11 it will return 0000000011

cheers,

Naveen

Message was edited by: Naveen Pandrangi

Former Member
0 Kudos

Hi,

This may work.



int maxlength = 10;
for( int i = a.length ; i <= maxlength ; i++ )
a = "0" + a;

return a;

Let me know if it works.

Thanks

Mohan

Former Member
0 Kudos

Thanks friends...

solved the problem.

regards..rambarki

Former Member
0 Kudos

Hi,

I am doing similar mapping.

My question is : You are assuming the maxLength= 10 of the target filed is 10.

Can this made as a variable?

Is there any function, where i can determine maxlength of the target field?

Thanks,

Gowri

Answers (2)

Answers (2)

Former Member
0 Kudos

You can use an advanced function. Refer these threads.

regards

Shravan

Former Member
0 Kudos

try using the standard function "FormatNum" it is an arithmetic function...

it has to be given the property '0000000000' - 10 zeroes....so the total length of the output would be 10 with padded zeroes as you require...

Thanks,

Renjith