Skip to Content
avatar image
Former Member

How to easily add a dropdown for a limited number of currencies?

Hiya,

I have a table field for currency that I need to update and the field references a domain of type WAERS:

I'd like to update this table field and so I created a web dynpro input field that is bound to a context attribute that references the table and the currency field. The input element looks like this:

It's a text entry field.

What would be the easiest way to convert it into a drop-down that only showed a subset of currencies, say GBP, USD, CAD and EUR?

Thanks in advance for any help.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Feb 04, 2014 at 03:51 PM

    Hi Robert,

    Use DropDownByKey UI Element.

    http://webdynproabap.wordpress.com/2012/07/08/drop-down-by-key/

    Hope this will help your Requirement. Please let me know.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Robert,

      Instead of binding a standard Type like waers which has all the currency listed you can actually build your own drop down list.

      You can use drop down by index method to build a drop only for some currencies like - GBP, USD, CAD , EUR etc. You basically have add values to an internal table and then bind that internal table to the respective node.

      Following link gives you a brief overview on how to do the same.

      Drop down by Index | Webdynpro ABAP

      Regards,

      Karan

  • avatar image
    Former Member
    Feb 12, 2014 at 08:57 PM

    Okay I've thought about this and how about I:

    • Create a new 5 character domain, in the data dictionary, that only has the relevant currencies defined as values.
    • Then assign this domain to a data element.
    • Then assign the data element to the context attribute type (instead of waers).
    • Then use dropdownbykey in the web dynpro entry field and bind it to the above context attribute

    Would that be okay or am I doing something horrendous that shouldn't be done...

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Robert,

      Yes, your approach is in right direction  If you are sure about the drop down list values wont change very often and its fixed. As it could not be maintained by non-developers ( i.e. updating via table maintainance by users/functional consultants ).

      In future, they need to have one more corrency in the drop down list .... no issues.. they will surely contact developer ( i.e. Mr. Robert ) 😊

      Please go ahead with your approach and its very simple do.

      Regards,

      Rama