How to Create a drop down with Key and Value
I want to make a drop down list with key and value. I know it can be possible by customization.
But my requirement is to make it as default for all. All should see the drop down with key and value without doing the customization for each.
Is there any logic which i can implement in V- method for this. Please help me out.
Vinodkumar Kommineni replied
If it is for one drop down you can do some thing like concatenating your key and the value into value by separating with a ''-'' probably.
This is the sample code assuming you have the values you are showing in ddlb in lt_ddlb already.
DATA: ls_ddlb type BSP_WD_DROPDOWN_LINE,
lt_ddlb type BSP_WD_DROPDOWN_TABLE.
LOOP AT lt_ddlb INTO ls_ddlb.
CONCATENATE ls_ddlb-key '-' ls_ddlb-value INTO ls_ddlb-value.
MODIFY lt_ddlb INDEX sy-tabix FROM ls_ddlb.
This would be the simple solution for what you are trying to achieve.