on 09-07-2015 7:07 AM
Hi,
I have a requirement where I need to display 2 columns in a drop down ( Col1 - Key, Col2 - Text ).
Is it possible to display in a dropdown?
Please help with your pointers.
Regards,
Sujay.
Hi,
Instead of concatenating key and text in the text, you could use set_key_visible( ) method to display key and text ( appears like columns)
code snippet: Write the below code in WDDOMODIFYVIEW method.
DATA lr_drop_down TYPE REF TO cl_wd_dropdown_by_key.
lr_drop_down ?= view->get_element( 'DRP_DWN' ). "DRP_DWN is the name of Drop down UI element
lr_drop_down->set_key_visible( abap_true ).
hope this helps,
Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Create two columns of type dropdown and bind the data accordingly..
If you want to display data in 2nd column dropdown based on selected 1st column dropdown, create and action and bind the value accordingly.
Thanks
KH
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sujay,
if you have requirement where you need to display 2 columns in a drop down for example,
TYPES: BEGIN OF TY_OUT,
KEY TYPE I,
TEXT TYPE STRING,
END OF TY_OUT.
DATA : IST_OUT TYPE TABLE OF TY_OUT,
WA_OUT TYPE TY_OUT.
and Data in IST_OUT LIke,
KEY TEXT
1 A
2 B
3 C
You want to display KEY as well as TEXT . It is directly not possible for that you have to take another internal table such as below,
DATA: IST_BIND TYPE TABLE OF TY_OUT,
WA_BIND TYPE TY_OUT.
DATA: GD_TMP TYPE STRING.
LOOP AT IST_OUT INTO WA_OUT.
CLEAR : WA_BIND,GD_TMP.
CONCATENATE WA_OUT-KEY WA_OUT-TEXT INTO GD_TMP SEPARATED BY '-'.
WA_BIND-KEY = WA_OUT-KEY.
WA_BIND-TEXT = WA_OUT-TEXT.
APPEND WA_BIND TO IST_BIND.
CLEAR : WA_BIND.
ENDLOOP.
Use IST_BIND for display value in drop down.
Rewards if Helpful or Correct answer.
Regards,
Hitesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.