Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Dropdown list in selection screen

Former Member
0 Likes
1,143

Hi Experts,

Can any one say how to create a dropdown list in a report's selection screen and how to populate values on that? I searched in SDN, but most of the hits were for module pool only.

Thanks and regards,

Venkat.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,057

Hi,

You can give dropdown list in selection-screen via PARAMETERS

PARAMETERS p_name(n) AS LISTBOX .

Also addition

PARAMETERS p_name(n) AS LISTBOX VISIBLE LENGTH n.(can be added)

where n is an integer .

To populate the value list use the Function module VRM_SET_VALUES .

and place it in atselection-screeen output event.

Regards,

jaya

6 REPLIES 6
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
1,057

You can use any PARAMETER with addition as list box.

Read only

Former Member
0 Likes
1,057

check the below code.

&----


*& Report Z_DYNAMIC_SCREEN

*&

&----


*&

*&

&----


REPORT z_dynamic_screen.

TYPE-POOLS: vrm.

DATA: name TYPE vrm_id, list TYPE vrm_values, value LIKE LINE OF list.

TABLES: sscrfields.

  • Selection screen

  • List box

PARAMETERS: ps_parm AS LISTBOX VISIBLE LENGTH 10

USER-COMMAND abc.

  • Radio buttons

PARAMETERS: rb1 RADIOBUTTON GROUP ab MODIF ID bl2,

rb2 RADIOBUTTON GROUP ab MODIF ID bl2,

rb3 RADIOBUTTON GROUP ab MODIF ID bl3.

INITIALIZATION.

  • Populate list box values

name = 'PS_PARM'.

value-key = '1'. value-text = 'Line 1'. APPEND value TO list.

value-key = '2'. value-text = 'Line 2'. APPEND value TO list.

AT SELECTION-SCREEN OUTPUT.

  • Set list box with value

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = name

values = list.

  • Control the display of screen components

LOOP AT SCREEN.

IF ps_parm = 1.

IF screen-name = 'RB1' OR screen-name = 'RB2' .

screen-invisible = 0.

ELSEIF screen-name = 'RB3'.

screen-invisible = 1.

ENDIF.

MODIFY SCREEN.

ELSEIF ps_parm = 2.

IF screen-name = 'RB1' OR screen-name = 'RB2' .

screen-invisible = 1.

ELSEIF screen-name = 'RB3'.

screen-invisible = 0.

ENDIF.

MODIFY SCREEN.

ELSEIF ps_parm = space.

rb1 = 'X'.

clear: rb2,rb3.

IF screen-name = 'RB1' OR screen-name = 'RB2' OR

screen-name = 'RB3'.

screen-invisible = 0.

MODIFY SCREEN.

ENDIF.

ENDIF.

ENDLOOP.

AT SELECTION-SCREEN.

IF sscrfields-ucomm = 'ABC'.

ENDIF.

START-OF-SELECTION.

WRITE: / 'Parameter:', ps_parm.

Read only

Former Member
0 Likes
1,058

Hi,

You can give dropdown list in selection-screen via PARAMETERS

PARAMETERS p_name(n) AS LISTBOX .

Also addition

PARAMETERS p_name(n) AS LISTBOX VISIBLE LENGTH n.(can be added)

where n is an integer .

To populate the value list use the Function module VRM_SET_VALUES .

and place it in atselection-screeen output event.

Regards,

jaya

Read only

0 Likes
1,057

Hi Experts,

Thank you all very much for your immediate help.

Venkat

Read only

Former Member
0 Likes
1,057

Hi ,

try this link.

Pleas search properly you can find many links. This was solved many times.

https://forums.sdn.sap.com/click.jspa?searchID=25721451&messageID=3272664

Regards,

Venkatesh

Read only

Former Member
0 Likes
1,057

Hi,

Try this

Parameter p_carr type spfli-carrid as listbox.

If u want any custom field values,create a domain with value range and create data element and use