cancel
Showing results for 
Search instead for 
Did you mean: 

Message Mapping Help

Former Member
0 Kudos

hi,

Need a slight help on mapping. Trying to map a source field which is 5 characters to a destination field on the target side which is 10 characters. The way the mapping should work is that since the source field is only 5 characters, 5 leading zeroes will be added to the final output when it is mapped to the target destination.

Can u suggest a way to do this. Do i need to write a UDF or can we accomplish this with any standard message mapping functions.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi yes,

with UDF:

+ while (MyString.value.indexOf(' ')>-1)

{

MyStringOutgoing.value =

MyStringOutgoing.value.replace(' ','0')

}

return MyString;+

Regards Mario

Message was edited by:

Mario Müller

Former Member
0 Kudos

hi Bhavesh, Satish, Chandrasekhar, Rajeev, Mario,

Thanks a lot for your responses. This will really help me out,

reg,

Pradip

Former Member
0 Kudos

Hi Pradip,

Make a constant 00000.

Then do this in graphical mapping: use concat function - first argument 00000 and second argument source field

Constant(00000)------->

; concat function -> target field

source field -


>

This may solve your this query.

Thanks,

Rajeev Gupta

Message was edited by:

RAJEEV GUPTA

Message was edited by:

RAJEEV GUPTA

Former Member
0 Kudos

Hi Pradeep,

As I understood that you need to generate the 10 charachters length in the target filed...

Use formatnumber form the arthimetic funcitons..

how to implement:

source field>formatnumber-->targetfiled.

In formatnumber function you need to specify hw zeros you want.

Please let me know ur problem is solved or not?

Thanks and Regards,

Chandu.

Former Member
0 Kudos

Pradip,

Just use format number in the standard functions available. It will only work if your input is in numeric format.

If you want to add directly 5 leading zeros without knowing the length of incoming input then you can concat with 5 zeros.

else UDF will help you.

...Satish

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

Use Standard CONCAT function.

Use A Constant with the 5 Zeroe's and then use Concat to concat this with your Source Field and map output of Concat to the target field.

Regards

Bhavesh