cancel
Showing results for 
Search instead for 
Did you mean: 

Using SELECT_OPTIONS in Web Dynpro with currency fields

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

ramakrishnappa
Active Contributor
0 Kudos

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