cancel
Showing results for 
Search instead for 
Did you mean: 

Formatting the field on the form

Former Member
0 Kudos

Hi All,

I have a field matnr which is displayed on the adobe form with the leading zeros. Eg 000000000001003800, However I want this field to get displayed in the internal format such as 100-3800. How to get this resolved. Has anybody worked on the same before.

Regards,

Sanjay.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Sanjay,

Try this approach...

Create the following 2 java script functions in the docReady event if that field is getting pre populated by the time the form is displayed.

function trimNumber(str) {

while (str.substr(0,1) == '0' && str.length>1)

{

str = str.substr(1,9999);

}

return str;

}

function formatYourWay(str) {

//implement to get it in the format of "100-3800"

return str;

}

on docReady event of the filed use the following code.

this.rawValue = formatYourWay(trimNumber(this.rawValue));

Thanks!

Surya.

Former Member
0 Kudos

Hi Surya,

There is a standard function module to convert the material number into the internal format CONVERSION_EXIT_MATN1_OUTPUT. How can I use this FM in the docready event.

Regards,

Sanjay.