cancel
Showing results for 
Search instead for 
Did you mean: 

Currency Problem?

Former Member
0 Kudos

hi

I have made UIDropDown and bind to the simple type currency.But i am getting option in my dropdown as British Pound ,Indian Rupee ,US Dollar.While i need INR,USD to be compatible with the currency keys in my R/3

(I think so).How can i get these currency keys in my drop down?

Please help me

Regards

Nidhideep

Accepted Solutions (1)

Accepted Solutions (1)

sridhar_k2
Active Contributor
0 Kudos

Hi Nidhideep,

I think if you use Simple type Currency, it will give you all the Currencies, whatever is there in the R/3.

If you specifically looking for R/3 values, then get it from back end only. Programmatically you can set all the currencies to Drop Down List Box.

// To get the Selected Value

String selectedValKey = wdContext.currentContextElement().getCurrency();

// To get the Selected Text

IModifiableSimpleValueSet dropValueSet = dateAttributeInfo.getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();

String selectedValue = (String)dropValueSet.getText(selectedValKey.trim());

messageManager.reportSuccess("Selected Val Key : "selectedValKey "Text is : "+selectedValue);

If you not looking for this functionality, reply me back.

Regards,

Sridhar

Former Member
0 Kudos

hi

Sridhar ,in your fuctionality user will have to write the currency which he can type usd or USD this will cause problem as it will not be standard.Please tell me how to access R/3 values and how to represent those values in Drop down in Webdynpro.

Regards

Nidhideep

sridhar_k2
Active Contributor
0 Kudos

Hi Nidhideep,

I had a requirement to use Currency. Where i had created a simple type, Base type is currency. and the Selected Currency (US Dollar) from Drop Down and i will send the same (USD) to back end. It is working fine for me.

You can cross check with R/3 Table Name : TCURT. from SE11 Transaction Code. It will give most of the Currencies which are mentioned in Web Dynpro Simple Type.

Can you tell me your exact requirement?

Regards,

Sridhar

Former Member
0 Kudos

hi

Sridhar ,my exact requirement is that user insert a currency through drop down ,when i make drop down UI element and bind it to simple type Currency the option that i get are Indian Rupee,US Dollar which are long text in R/3 .While actual key values are inr and USD.So if i insert long text in my R/3 through Webdynpro will actaully my key values i.e.USD or INR get inserted.If that is the case then my problem is solved.Please reply.

Regards

Nidhideep

Former Member
0 Kudos

Hi,

As stated previously, you can get the value of attribute and set this as input to the BAPI

String curr=wdContext.currentContextElement.get<attribute>();

Set this as input

Regards,

Saravanan K

sridhar_k2
Active Contributor
0 Kudos

Hi Nidhideep,

If you want to send keys (USD,INR..)to R/3 use below code.

// Below Code returns USD,INR...

String currency = wdContext.currentContext().getCurrency();

//If you want to US Dollar,Indian Rupee.. use my above code

Regards,

Sridhar

Former Member
0 Kudos

hi

sridhar i am not getting you .

This code :String currency = wdContext.currentContext.getCurrency();

Is valid when i make user to type on my input field ,and thats is not the case.As i want user to select USD(from dropdown)and this get inserted into my R/3.

How to get values like USD,INR in my dropdown?

Please help me

Regards

Nidhideep

Former Member
0 Kudos

Hi,

I hope you bind this currency attribute to the dropdown

String currency = wdContext.currentContext.getCurrency();

Print this string currency

as

wdComponentAPI.getMessageManager().reportSuccess(currency);

Wat you get?

Regards,

Saravanan K

sridhar_k2
Active Contributor
0 Kudos

Hi Nidhideep,

String currency = wdContext.currentContext.getCurrency();

The above statement will give you result, like USD,INR...

You can check with

wdComponentAPI.getMessageManager().reportSuccess("Currecny "+currency );

Here,You can bind context variable to any control like Input Field, DropDownKey...It will give corresponding value.

In your case it will give you Selected Value as USD.

Regards,

Sridhar

Former Member
0 Kudos

hi

I have solved my problem .Thanx for so much support.

Regards

Nidhideep

Former Member
0 Kudos

Please post hoe you solved your problem.

Answers (4)

Answers (4)

Former Member
0 Kudos

You are using a DropDownByKey element, right? The "selectedKey" property is bound to an attribute, say "selectedCurrency" of a currency type.

Now make the following test:

Assign an action "CurrencySelected" to the "onSelect" event of the drop-down list. In the action handler, write a debug message like

wdComponentAPI.getMessageManager().reportSuccess
(
  "Selected currency key=" + wdContext.currentContextElement().getSelectedCurrency()
);

What do you see as output?

Armin

Former Member
0 Kudos
Former Member
0 Kudos

Hi

To get the currency keys like R/3 currency keys You have the get it From BAPI.In the Simple type not suport it.

Kind Regards

Mukesh

Former Member
0 Kudos

Hi,

Can you explain little bit detail?

Regards

Saravanan K