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: 

dropdown list in selection screen

Former Member
0 Kudos
756

Hi guys,

I am having a drop down list of 5 values in my selection screen.

I am able to show the list of values in the droplist of the selection screen.

How should I set default value in the list.

Regards

mac

8 REPLIES 8

Former Member
0 Kudos
199

Hi Mac,

Did you give a try to set the default value when you are declaring the selection screen parameter or selection option ? i think that should be defaulted in the input box along with the dropdown available.

Regards,

Lohith

former_member536879
Active Contributor
0 Kudos
199

REPORT ztest1234.

type-POOLs : vrm.

PARAMETERS : dr1 as LISTBOX VISIBLE LENGTH 20,

dr2 as LISTBOX VISIBLE LENGTH 20.

DATA : lv_values TYPE vrm_values,

lv_values1 TYPE vrm_values,

gw_values like LINE OF lv_values.

AT SELECTION-SCREEN OUTPUT.

gw_values-key = '1'.

gw_values-text = 'One'.

append gw_values to lv_values.

gw_values-key = '2'.

gw_values-text = 'Two'.

append gw_values to lv_values.

gw_values-key = '3'.

gw_values-text = 'Three'.

append gw_values to lv_values.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

ID = 'dr1'

VALUES = lv_values

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.

else.

dr1 = '1'. ( Just give ur id number which u wants to be default)

ENDIF.

With Regards,

Sumodh.P

Edited by: Sumodh P on Apr 23, 2010 12:25 PM

Edited by: Sumodh P on Apr 23, 2010 12:26 PM

Edited by: Sumodh P on Apr 23, 2010 12:30 PM

0 Kudos
199

Hello Boss,

Along with the default, I want the other values to appear in the list. But for example I want 3rd value to be default.

Tellme if that is possible or not.

Regards

Mac

0 Kudos
199

Did you try DEFAULT'ing the value of the parameter:

PARAMETER: MY_PARAM TYPE STRING AS LISTBOX DEFAULT 'Third Value'.

I suppose this should work for listbox as well.

0 Kudos
199

Hi Mohan,

After filling internal table, you can insert the constant value or default value on 3rd position.

Regards,

Narendra

0 Kudos
199

Hi Narendra,

How can you set default value on 3 record of an internal table.

Do you have any code for that.

Regards

mac

0 Kudos
199

Hi MOhan,

I think the ques has been marked answered.

Yoou can use INSERT Statement

Regards,

Narendra

Former Member
0 Kudos
199

Hi Mohan,

You can refer given below code.

type-pools: vrm.

parameters : p_logsys type LOGSYS AS LISTBOX VISIBLE LENGTH 15 OBLIGATORY.

at selection-screen on VALUE-REQUEST FOR p_logsys.

DATA: name4 TYPE VRM_ID,

list4 TYPE VRM_VALUES,

list_wa3 like line of list4.

refresh list4.

list_wa3-key = 'BWDEV020'.

list_wa3-text = 'Development'.

append list_wa3 to list4.

clear list_wa3.

list_wa3-key = 'MPBCLNT100'.

list_wa3-text = 'Production'.

append list_wa3 to list4.

clear list_wa3.

name4 = 'P_LOGSYS'.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

ID = name4

VALUES = list4.

I hope it will help you.

Regards,

Narendra