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

Drop down list box

Former Member
0 Likes
638

Hi Friends,

I have created a ztable and in the report selection screen, for some of the fields of this table, I want to create a drop down list box.

Kindly guide me create this.

TIA.

Regards,

Mark K

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
617

Hi,

For Declaring List box Write-

PARAMETERS: name(n) AS LISTBOX VISIBLE LENGTH n.

For populating Listbox check this link-

http://sap.niraj.tripod.com/id38.html

Regards,

Sujit

5 REPLIES 5
Read only

Former Member
0 Likes
618

Hi,

For Declaring List box Write-

PARAMETERS: name(n) AS LISTBOX VISIBLE LENGTH n.

For populating Listbox check this link-

http://sap.niraj.tripod.com/id38.html

Regards,

Sujit

Read only

Former Member
0 Likes
617

Mark,

ZTEST.
TYPE-POOLS vrm.

**"Table declarations...................................................
*TABLES sscrfields.

*"Table declarations...................................................
PARAMETERS:
p_connid(11) AS LISTBOX
VISIBLE LENGTH 20 default 'FOREX-ANANTH'.

p_value TYPE i MODIF ID QWR. 

*" Data declarations...................................................
"--------------------------------------------------------------------

Work variables * 
"--------------------------------------------------------------------
DATA:
w_char(20) TYPE c,
w_flag TYPE i.

"--------------------------------------------------------------------

INITIALIZATION. EVENT * 
"--------------------------------------------------------------------
INITIALIZATION.

"--------------------------------------------------------------------

Internal table to hold delivery header data * 
"--------------------------------------------------------------------
DATA:
t_table TYPE
STANDARD TABLE
OF vrm_value,

vrm_values1 LIKE LINE OF t_table.

vrm_values1-key = 'a'.
vrm_values1-text = 'sap'.
APPEND vrm_values1 TO t_table.

vrm_values1-key = '2'.
vrm_values1-text = 'testing'.
APPEND vrm_values1 TO t_table.

vrm_values1-key = '2'.
vrm_values1-text = 'java'.
APPEND vrm_values1 TO t_table.

vrm_values1-key = '4'.
vrm_values1-text = '.net'.
APPEND vrm_values1 TO t_table.

vrm_values1-key = '5'.
vrm_values1-text = 'vc++'.
APPEND vrm_values1 TO t_table.
vrm_values1-key = 'che'.
vrm_values1-text = 'chetta-ram'.
APPEND vrm_values1 TO t_table.

CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'p_connid'
values = t_table
EXCEPTIONS
ID_ILLEGAL_NAME = 1
OTHERS = 2

Read only

Former Member
0 Likes
617

hi, chk this code

PARAMETERS:

listbox(1) AS LISTBOX VISIBLE LENGTH 10 DEFAULT 'N'.

AT SELECTION-SCREEN OUTPUT.

DATA:

name TYPE vrm_id,

list TYPE vrm_values,

value TYPE vrm_value.

name = 'LISTBOX'. " Name should be in UPPER CASE

value-key = '1'.

value-text = 'Text 1'.

APPEND value TO list.

value-key = '2'.

value-text = 'Text 2'.

APPEND value TO list.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = name

values = list

EXCEPTIONS

id_illegal_name = 0

OTHERS = 0.

Read only

Former Member
0 Likes
617

Hi Mark,

[drop down list box|http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbabe435c111d1829f0000e829fbfe/content.htm]

Regards,

Sravanthi

Read only

Former Member
0 Likes
617

Hi mark,

u can try like this....

PARAMETERS: name type ztable-field AS LISTBOX VISIBLE LENGTH n.

and you can set fixed values at the domain level.(for ztable-field)

ie:double-click on domain->go to value ranges->Enter fix values and short text