‎2009 May 06 5:50 AM
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.
‎2009 May 06 5:57 AM
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
‎2009 May 06 5:52 AM
‎2009 May 06 5:56 AM
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.
‎2009 May 06 5:57 AM
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
‎2009 May 06 6:06 AM
Hi Experts,
Thank you all very much for your immediate help.
Venkat
‎2009 May 06 5:57 AM
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
‎2009 May 06 5:58 AM
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