on 10-16-2013 9:38 PM
Hi all,
I am able to get selected key from dropdownbykey UI element in WDA.
But I also want to get selected text from dropdownbykey UI element in WDA.
The reason is, I am populating values like below.
Key Text
---------------------------
1 0001 - AAA
1 0002 - BBB
2 0001 - CCC
2 0002 - DDD
How do I get the textvalue for selected item in the dropdown?
Thanks
Thruna
Hi Thruna,
Using non-unique key values in your DropDownByKey will make it impossible to know which option a user has selected.
When dropdown options come from a domain, you can get the text values as Subhash and Paul have suggested (or by reading table DD07T directly). In the case of a dropdown that is manually populated by you, you can store an internal table of key/value pairs in either an assistance class or a context node and look up the selected key in your stored internal table to determine its text. Again though, the key would need to be unique.
Cheers,
Amy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Amy,
You are correct.
Using non-unique key values in DDBK is a not recommended.
Reason is If I select 0002 - BBB, system automatically set the selected text as 0001 - AAA because of duplicate key 1 in this case.
Key Text
---------------------------
1 0001 - AAA
1 0002 - BBB
2 0001 - CCC
2 0002 - DDD
Thank you for all your replies.
Thanks
Thruna
Hi ,
As subhash told you can use FM GET_DOMAIN_VALUES so that you will get values for domain .
read that itab into ls_itab with key domvalue_l = lv_xxx.
if sy-subrc ,is initial.
concatenate ls_itab-domvalue_l '-' ls_itab-ddtext into ls_yyyy.
endif.
you can use ls_yyyy how ever you want.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can read the Drop down by key text from the standard table's which stores the values maintained in the value range.
(values DD07L and texts DD07T)
or
try using the standard function modules to which will fetch all the values present in the value range.
CHECK_DOMAIN_VALUES
GET_DOMAIN_VALUES
http://www.saphub.com/abap-dictionary/read-sap-domain-value-range/
Hope this solves your problem!
Regards
Subhash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.