Skip to Content
author's profile photo Former Member
Former Member

Using SELECT_OPTIONS in Web Dynpro with currency fields

I have an application where I use SELECT_OPTIONS to gather search parameter values for a query which has amount and currency fields. In my WDDOINIT, I am calling add_selection_field to add the fields that I wish to use to search. One of the fields is a currency key and another is the amount. The query returns the found data in an ALV and each record has its amount formatted correctly based on the currency key field in each record. This all works as it should.

However, the search parameter for the amount field is always formatted based on its data type and not on the other search parameter with the currency key. The currency key field does not allow multiples so it is either present or not (using the default would be fine if the currency key is not specified). If it is specified, I would like it to format the amount.low and amount.high input fields correctly.

For example, if I enter 'USD' in the currency key search field and '10' and '20' in the amount from/to fields, respectively, when I press the search button or hit enter, both the amount to/from fields' display changes to '10,00000' and '20,00000', respectively which is the data type definition of CURR19,5.

I found no documentation on how to handle formatting of currency or quantities in the search fields when using SELECT_OPTIONS. Has anyone solved this problem? I looked at all the parameters to the add_selection_field method and cold not find a way to associate the currency key to the amount. Any help would be greatly appreciated.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on May 15, 2014 at 03:55 AM

    Hi Mark,

    I don't think, it is possible to get the currency key reference for the amount fields in selection screen by using IF_WD_SELECT_OPTIONS.

    I would suggest you the below work around option

    If you do not have the requirement of passing multiple values in either currency key field or amount field, you can go for normal input fields to design your input screen.

    • Create a structure with 3 fields , CURR, AMT_LOW, AMT_HIGH
    • Use currency reference field in structure with self structure name and CURR field, so that amount fields refer to the same structure's currency key
    • Create a node by using this structure and design the input fields from this context node
    • Now, the amount fields have the reference of currency key from the structure and it should work fine

    Hope this helps you.

    Regards,

    Rama

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.