cancel
Showing results for 
Search instead for 
Did you mean: 

Conversion from Indian Rupees to Dollars

Former Member
0 Kudos

Hi,

In my scenario I have to covert indian rupees to USD.

For this I am creting 1 user defined function.

Can u tell me the package which to be be importing.

Thanks,

SrinivasaP

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

There is no need to import anything

public String convertRupeetoDollor(String a,Container container){

return String.valueOf(Integer.parseInt(a)*45);

}

You can specify value.

If you want to use current value of conversion rate you can use external web service Currency Converter

Regards,

Sai

Former Member
0 Kudos

Hi,

where is hte conversion rate going to come. If thats saved somewhere in SAPt hen you wil have to make a RFC call to get this data and htne use the jabva code given above.

Regards

Vijaya

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

You would need to use value mapping for this.

As this way you can avoid hardcoding conversion rate inn your coding.

Regards,

Bhavesh

Former Member
0 Kudos

Hi,

Your UDF by default imports

java.lang.*;

java.io.*;

java.lang.reflect.*;

java.util.*;

If you are using methods from other than the above said packages then you have to explicitly import those classes.

Regards,

Sudheer.

Shabarish_Nair
Active Contributor
0 Kudos

i am not sure if u need any additional package here.

try this udf;

Double temp = 0;

Double dollar = 50;
assume it to be 50

temp =Double.parseDouble(a<i>);

temp = temp * dollar;

result.addValue(temp.toString());