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 to make default value in a drop down list

Former Member
0 Kudos

Hi,

I have created a drop down list using Selection-Screen code. I have three values in it. I would like to make one of the option as a default value. How to achieve it?

I am working on module pool program. I have few screens as a part of my program. I have created print button on tool bar of one screen but that print button is appearing on the other screens too. How to avoid it?

Help would be appreciated...

Thanks

Edited by: mohammed ibrahim on Oct 10, 2008 8:43 PM

9 REPLIES 9

former_member188685
Active Contributor
0 Kudos

if you make the list box field mandatory then it will be defaulted to some value. to avoid the print button in otherscreens you have two options , one using a different status . or using exclude option.

set pf-status 'STATUS' excluding 'PRINTSTATUS'.

0 Kudos

Hey Vijay,

I want to make one particular value as default not any value from all the options.

and for the print option...

there is not PF Status for other screens on which this Print option is appearing

Former Member
0 Kudos

Hi,

TO make default valu in the list box, try using CALL FUNCTION 'VRM_SET_VALUES' in PBO.

Create your set PF-Status based on the screen nu,ber.

Former Member
0 Kudos

1) let drop down box be g_dd.

if g_dd is initial.

g_dd = option2.

endif.

2)

by default same pf-status is used by all the screens in the same program

if sy-dynnr = 'screen_no'. " for screens for which you do not want button to come

set pf-status 'abc' excluding 'fcode_of_button'

endif.

or

data: git_fcode type sy-ucomm with header line.

git_fcode = 'fcode_of_button'.

append git_fcode.

if sy-dynnr = 'screen_no'. " for screens for which you do not want button to come

set pf-status excluding git_fcode

endif.

Edited by: Amit Gupta on Oct 11, 2008 11:36 AM

former_member182485
Active Contributor
0 Kudos

Hi,

I also faced the same problem, just assign the default value in the parameter AT SELECTION SCREEN OUTPUT event

Eg.

AT SELECTION-SCREEN OUTPUT.

  • Build Drop down menu in the selection screen

PERFORM build_menu.

pr_doc = 'Default'.

Hope this helps.

Regards

Bikas

Former Member
0 Kudos

U can set the default values in the event 'INITIALIZATION'

example...


INITIALIZATION.
  PERFORM initialization.

FORM initialization .
WRITE sy-datum(4) TO year1.      "year1 is set using VRM_SET_VALUES.
ENDFORM.                    " INITIALIZATION

i think this will solve ur problem.....

Former Member
0 Kudos

Hey guys,

I could not solve my problem yet. Waiting for your help.

0 Kudos

what exactly you are doing..? there is nothing complex in it. tell me where you facing the problem..

0 Kudos

Hey i got the answer....