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

Default value for a dropdown listbox

rainer_hbenthal
Active Contributor
0 Likes
1,586

Hi,

i placed a dropdown listbox on a dynpro and i'm filling the possible values in the PBO using FM VRM_FILL_VALIUES. But how do i set the default value?

//Rainer

1 ACCEPTED SOLUTION
Read only

JozsefSzikszai
Active Contributor
0 Likes
1,177

hi Rainer,

very simple:

PARAMETERS : p_druck TYPE zdruc-druck OBLIGATORY

<b>DEFAULT '01'</b> USER-COMMAND lb01

AS LISTBOX VISIBLE LENGTH 40,

ec

8 REPLIES 8
Read only

JozsefSzikszai
Active Contributor
0 Likes
1,178

hi Rainer,

very simple:

PARAMETERS : p_druck TYPE zdruc-druck OBLIGATORY

<b>DEFAULT '01'</b> USER-COMMAND lb01

AS LISTBOX VISIBLE LENGTH 40,

ec

Read only

0 Likes
1,177

Thanks, works fine for report with a selection screen, but i have a dynpro and therefore no parameter clause.

Read only

0 Likes
1,177

Declare a variable with the same name as the dropdown box in TOP INCLUDE. And then, in the PBO module set the default value you want to this variable. Hope this helps.

Read only

0 Likes
1,177

Hi Rainer ,

In the PBO afte the FM has been called assign the default value to the screen parameter.

I feel this should work.

Regards

ARUN

Read only

0 Likes
1,177

Hi ..

For Eg:

The Listbox field in the Screen Painter is MARA-MTART.

Then to Populate a Default value.

1) Declare the Global variable in the Program. Top include:

TABLES MARA.

2) In the PBO module called from the Screen put a Default value in this variable.

MARA-MTART = 'ROH'.

This value appears as default value in Checkbox.

Or in the Screen Painter :

Open the attributes of the Listbox

Enter the Default value in the TEXT attribute..

reward if Helpful.

Read only

Former Member
0 Likes
1,177

hi,

TYPE-POOLS: vrm.

DATA: name TYPE vrm_id,

list TYPE vrm_values,

value LIKE LINE OF list.

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

AT SELECTION-SCREEN OUTPUT.

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.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING id = name

values = list.

if helpful reward some points.

with regards,

Suresh Aluri.

Read only

rainer_hbenthal
Active Contributor
0 Likes
1,177

Hi thanks, works fine. Is there any chance of getting rid of the empty line in the selection values? It seems t be there by default but rather to have an empty line would prefer something like "0 None".

Read only

0 Likes
1,177

U've to make the parameter as <b>OBLIGATORY</b> to get rid of the empty line.