Skip to Content

### UDF to create decimal output

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

##### Add comment
10|10000 characters needed characters exceeded

### 2 Answers

• Former Member
Oct 27, 2015 at 01:14 PM

Hi Raj kumar,

Try below mapping  with small UDF.

Code for UDF:

Regards,

Santhi

Capture.JPG (45.7 kB)
Capture.JPG (37.5 kB)
##### Add comment
10|10000 characters needed characters exceeded
• Oct 27, 2015 at 01:14 PM

Hello Raj,

you can divide by 100

Capture.JPG (50.4 kB)
##### Add comment
10|10000 characters needed characters exceeded
• Raghuraman S Former Member

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