Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to Create a drop down with Key and Value

Hi All,

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.

Thanks

Satya

Tags:
Former Member
replied

Hi Satyaranjan,

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.

ENDLOOP.

This would be the simple solution for what you are trying to achieve.

Regards

Vinod

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question