cancel
Showing results for 
Search instead for 
Did you mean: 

UDF to create decimal output

former_member593220
Participant
0 Kudos

Hi Experts,

I have a requirement in mapping that in source side I have two inputs LIFNR and KRATE and logic is as follows..

Condition 1 : If LIFNR = 9000 then KRATE value will be mapped to target field RATE

Condition 2 : If LIFNR = 2500 then PI need to check value of KRATE, in that case if KRATE value is more than 4 digits then KRATE value should mapped to RATE field with a decimal point after 4th digit

For example: as per second condition If LIFNR = 2500 and KRATE value is 123456 then target value should be "1234.56" 

This is my requirement, can any please suggest me how I can achieve this requirement using UDF.

Thanks in Advance..!

--

Regards

Raj

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member186851
Active Contributor
0 Kudos

Hello Raj,

you can divide by 100

Former Member
0 Kudos

Hi Raghuraman,

it will not work if Krate is more than 6 digits.  If Krate is always 6 digits then it will suit.

Regards,

Santhi

former_member186851
Active Contributor
0 Kudos

Ya Santhi,But if he its going to 6 digits always then fine else your logic is fine.

Former Member
0 Kudos

Hi Raj kumar,

Try below mapping  with small UDF.

Code for UDF:

Regards,

Santhi