Application Development 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: 

how can we use list box on selection screen

Former Member
0 Kudos
126

hi, howe can we use list box on selection screen and how can we populate the dat ainto the list box and how can we retrive data based on list box from ther database.

thanks in advance

raju

5 REPLIES 5

anversha_s
Active Contributor
0 Kudos
75

Check the link to know how to populate values as a LIST(drop down list)

here is the sample piece of code,

PROGRAM zlist.

TYPE-POOLS : VRM.

DATA: param TYPE vrm_id,

values TYPE vrm_values,

value LIKE LINE OF values.

PARAMETERS: p_name(10) AS LISTBOX VISIBLE LENGTH 10.

AT SELECTION-SCREEN OUTPUT.

param = 'P_NAME'.

value-key = '1'.

value-text = 'NAME1'.

APPEND value TO values.

value-key = '2'.

value-text = 'NAME2'.

APPEND value TO values.

*--and so onnn

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING id = param

values = values.

rgds

anver

if helped amrk points

former_member181962
Active Contributor
0 Kudos
75

Refer the sample program:

DEMO_DROPDOWN_LIST_BOX

Regards,

Ravi

Former Member
0 Kudos
75

Use the VRM_SET_VALUES function module.

DATA: list TYPE vrm_values,

value LIKE LINE OF list.

***********************************************************************

  • AT SELECTION SCREEN OUTPUT

***********************************************************************

AT SELECTION-SCREEN OUTPUT.

name = 'P_OBJECT'.

CLEAR list.

REFRESH list.

CLEAR value.

value-key = '1'.

value-text = 'Development Class'.

APPEND value TO list.

CLEAR value.

value-key = '2'.

value-text = 'Program'.

APPEND value TO list.

CLEAR value.

value-key = '3'.

value-text = 'Function Module'.

APPEND value TO list.

CLEAR value.

value-key = '4'.

value-text = 'Database Table'.

APPEND value TO list.

CLEAR value.

value-key = '5'.

value-text = 'Structure'.

APPEND value TO list.

CLEAR value.

value-key = '6'.

value-text = 'View'.

APPEND value TO list.

CLEAR value.

value-key = '7'.

value-text = 'Data Element'.

APPEND value TO list.

CLEAR value.

value-key = '8'.

value-text = 'Table Type'.

APPEND value TO list.

CLEAR value.

value-key = '9'.

value-text = 'Class / Interface'.

APPEND value TO list.

CLEAR value.

value-key = '10'.

value-text = 'Type Group'.

APPEND value TO list.

CLEAR value.

value-key = '11'.

value-text = 'Domain'.

APPEND value TO list.

CLEAR value.

value-key = '12'.

value-text = 'Search Help'.

APPEND value TO list.

CLEAR value.

value-key = '13'.

value-text = 'Lock Object'.

APPEND value TO list.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = name

values = list

EXCEPTIONS

id_illegal_name = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

Former Member
0 Kudos
75

Hi raju,

1. very simple

2. There are two important things :

a)PARAMETERS : a(10) TYPE c AS LISTBOX VISIBLE LENGTH 10.

b) Fm VRM_SET_VALUES

3. just copy paste

4.

REPORT abc.

TYPE-POOLS : vrm.

DATA : v TYPE vrm_values.

DATA : vw LIKE LINE OF v.

PARAMETERS : a(10) TYPE c AS LISTBOX VISIBLE LENGTH 10.

INITIALIZATION.

vw-key = '1'.

vw-text = 'Jan'.

APPEND vw TO v.

vw-key = '2'.

vw-text = 'Feb'.

APPEND vw TO v.

vw-key = '3'.

vw-text = 'Mar'.

APPEND vw TO v.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = 'A'

values = v

EXCEPTIONS

id_illegal_name = 1

OTHERS = 2.

regards,

amit m.

Former Member
0 Kudos
75

Hello,

Pupulate data and use FM 'VRM_SET_VALUES'.

(OR)

Go to transaction DWDM and look in to many complex controls with example source code.

Regs,

Venkat