cancel
Showing results for 
Search instead for 
Did you mean: 

Using Right-justified and left zero-filled condition in message mapping of

Former Member
0 Kudos

Hi,

My Interface is outbound Interface.

Suppose source field named 'MobNumber' is mapped with Target field named 'MobileNumber'.Condition is AS IS(Right-justified and left zero-filled).

How should i do this mapping?

Thanks,

Sanghamitra

Accepted Solutions (1)

Accepted Solutions (1)

former_member854360
Active Contributor
0 Kudos

Use this code for your requirement.

public static String zerofill(String str)
	{
			final int fieldLength=30;
			char filler='0';
			str=str.trim();
			int i=str.length();
			while(i<fieldLength)
			{
				str=filler+str;
				i++;
			}
						return str;
	}

Answers (2)

Answers (2)

anupam_ghosh2
Active Contributor
0 Kudos

Hi Sanghamitra,

Similar question ahs been answered earlier in this thread

just replace the filler variable by zero in my post

One small request, if you think your questions are being answered correctly and properly, please kindly, if possible, close down the threads. This way forum members/users who later look up for solutions to similar problem, they know for sure that the problem was finally solved, with the solutions provided in the thread.

regards

Anupam

Edited by: anupamsap on Aug 3, 2011 11:27 AM

former_member463616
Contributor
0 Kudos

Hi,

You can use FormatNum standard function and you can provide it as many zero's are you required.

Regards,

P.Rajesh