cancel
Showing results for 
Search instead for 
Did you mean: 

Padding(adding) Zeros or spaces to Target Field in mapping.

Former Member
0 Kudos

Hi,

1) I am getting emp number "1234567" as a interger, its lenth must be 10 digits before i sent to R3, whenever i get number with lessthan 10 digits i want add zeros to left side of Empnumber to make it 10 digits.

does it possible to solve this problem with Standard mapping funtiong? if so can u please help me out.

If it is not possible with standard mapping function please give me the Java UserDefinedFuntion code.

2) I am getting emp name "dhanush venna" as a istring, its Maximum lenth is 30, when ever i get name with lenth less than 30 , i want to add spaces at right side of the EmpName,

does it possible to solve this problem with Standard mapping funtiong? if so can u please help me out.

If it is not possible with standard mapping function please give me the Java UserDefinedFuntion code.

thanks

dhanush

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Sorry i dont have time to search the UDF,iam giving the links for all YDF check them.

http://flickr.com/photos/8764045@N06/

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/be05e290-0201-0010-e997-b6e...

Example 1

http://www.flickr.com/photo_zoom.gne?id=544183191&size=o

http://www.flickr.com/photo_zoom.gne?id=544183195&size=o

http://www.flickr.com/photo_zoom.gne?id=544183225&size=o

http://www.flickr.com/photo_zoom.gne?id=544183233&size=o

Example 2

http://www.flickr.com/photo_zoom.gne?id=545133789&size=o

http://www.flickr.com/photo_zoom.gne?id=545133791&size=o

http://www.flickr.com/photo_zoom.gne?id=545133801&size=o

http://www.flickr.com/photo_zoom.gne?id=545133807&size=o

http://www.flickr.com/photo_zoom.gne?id=545133811&size=o

http://www.flickr.com/photo_zoom.gne?id=545138911&size=o

http://www.flickr.com/photo_zoom.gne?id=545138913&size=o

http://www.flickr.com/photo_zoom.gne?id=545138915&size=o

http://www.flickr.com/photo_zoom.gne?id=545138917&size=o

http://www.flickr.com/photo_zoom.gne?id=545138947&size=o

http://www.flickr.com/photo_zoom.gne?id=545138951&size=o

http://www.flickr.com/photo_zoom.gne?id=545005958&size=o

Example 3

http://www.flickr.com/photo_zoom.gne?id=549186611&size=o

http://www.flickr.com/photo_zoom.gne?id=549186651&size=o

http://java.sun.com/j2se/1.5.0/docs/api/

/people/krishna.moorthyp/blog/2006/07/29/documentation-html-editor-in-xi

/people/sap.user72/blog/2006/02/06/xi-mapping-tool-exports

http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm

http://help.sap.com/saphelp_nw04/helpdata/en/22/e127f28b572243b4324879c6bf05a0/content.htm

/people/stefan.grube/blog/2005/12/30/test-user-defined-functions-for-the-xi-graphical-mapping-tool-in-developer-studio

http://help.sap.com/bp_bpmv130/Documentation/Operation/MappingXI30.pdf

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d046c490-0201-0010-84b6-9df523cb...

Regards,

Phani

Reward Points if Helpful

Former Member
0 Kudos

Hi,

for 2) try this

if (str.length()<30) // because your max length is 30

{

int j=30-str.length();

for(int i =0;i<j;i++)

str="0"+str;

}

return str;

Regards,

Balaji.M

bhavesh_kantilal
Active Contributor
0 Kudos

For 1 --> Use standard function FORMATNUM.

Regards

Bhavesh