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

New Selection-Screen via Button?

Former Member
0 Likes
1,045

Hi SDN community,

I need your help:

I have a dynpro with a button. Clicking this button, I want to display a new screen with many "SELECT-OPTIONS", but I don't want to create the "SELECT-OPTIONS" via ScreenPainter, I want to generate them via e.g.:

SELECT-OPTIONS : s_matnr FOR mara-matnr.

Is there any possibility to do this? I have already tried this:

Process After Input on the StartScreen clicking the button:

PERFORM selection_screen.

FORM selection_screen.

  SELECT-OPTIONS : s_matnr FOR mara-matnr.

ENDFORM.

But it doesnt work, SELECT-OPTIONS may not be local or something =/

You know whats my point? I wanna generate a new Selection-Screen by using

SELECT-OPTIONS : s_matnr FOR mara-matnr.

and not by using the ScreenPainter...

PS: I also tried to generate the SelectionScreen by writing

SELECT-OPTIONS : s_matnr FOR mara-matnr.

directly into the PAI, but then, this SelectionScreen is displayed immediately after I execute the program and this overrides the StartScreen with the button =[

Thanks for your help, hope you got my points

Marius Klaus

Edited by: Marius Klaus on Dec 2, 2009 12:34 PM

Edited by: Marius Klaus on Dec 2, 2009 12:35 PM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
950

Hi!

Try it like this:

SELECTION-SCREEN BEGIN OF SCREEN 1111. 
  SELECTION-SCREEN BEGIN OF BLOCK BL1. 
    SELECT-OPTIONS SEL0 FOR SY-REPID. 
    PARAMETERS     PAR0. 
  SELECTION-SCREEN END  OF  BLOCK BL1. 
  SELECT-OPTIONS SEL1 FOR SY-REPID. 
  PARAMETERS     PAR1. 
  SELECTION-SCREEN PUSHBUTTON /10(30) PUBU USER-COMMAND US03. 
SELECTION-SCREEN END OF SCREEN 1111.

And when the user presses the button:

IF sy-ucomm = 'BUTTONPRESS'.

CALL SCREEN 1111.

ENDIF.

It's untested, but hopefully will work...

Regards

Tamá

Hi SDN community,

I need your help:

I have a dynpro with a button. Clicking this button, I want to display a new screen with many "SELECT-OPTIONS", but I don't want to create the "SELECT-OPTIONS" via ScreenPainter, I want to generate them via e.g.:

SELECT-OPTIONS : s_matnr FOR mara-matnr.

Is there any possibility to do this? I have already tried this:

Process After Input on the StartScreen clicking the button:

PERFORM selection_screen.

FORM selection_screen.

  SELECT-OPTIONS : s_matnr FOR mara-matnr.

ENDFORM.

But it doesnt work, SELECT-OPTIONS may not be local or something =/

You know whats my point? I wanna generate a new Selection-Screen by using

SELECT-OPTIONS : s_matnr FOR mara-matnr.

and not by using the ScreenPainter...

PS: I also tried to generate the SelectionScreen by writing

SELECT-OPTIONS : s_matnr FOR mara-matnr.

directly into the PAI, but then, this SelectionScreen is displayed immediately after I execute the program and this overrides the StartScreen with the button =[

Thanks for your help, hope you got my points

Marius Klaus

Edited by: Marius Klaus on Dec 2, 2009 12:34 PM

Edited by: Marius Klaus on Dec 2, 2009 12:35 PM

6 REPLIES 6
Read only

Former Member
0 Likes
951

Hi!

Try it like this:

SELECTION-SCREEN BEGIN OF SCREEN 1111. 
  SELECTION-SCREEN BEGIN OF BLOCK BL1. 
    SELECT-OPTIONS SEL0 FOR SY-REPID. 
    PARAMETERS     PAR0. 
  SELECTION-SCREEN END  OF  BLOCK BL1. 
  SELECT-OPTIONS SEL1 FOR SY-REPID. 
  PARAMETERS     PAR1. 
  SELECTION-SCREEN PUSHBUTTON /10(30) PUBU USER-COMMAND US03. 
SELECTION-SCREEN END OF SCREEN 1111.

And when the user presses the button:

IF sy-ucomm = 'BUTTONPRESS'.

CALL SCREEN 1111.

ENDIF.

It's untested, but hopefully will work...

Regards

Tamá

Read only

0 Likes
950

Hi,

Tamas code will work, except that use call-selection screen instead of call screen


IF sy-ucomm = 'BUTTONPRESS'.
CALL SELECTION-SCREEN 1111.
ENDIF.

Read only

Former Member
0 Likes
950

Hello,

I dont think just by declaring a select-options will generate a new selection screen as in a normal report in a module pool program. You may have to use CALL SELECTION-SCREEN or SUBMIT to a normal report with the selection screen you require.

Vikranth

Read only

Former Member
0 Likes
950

Thank you all very much, you're so great !!!

Read only

0 Likes
950

Thank You very much.

Read only

Former Member
0 Likes
950

I made a post some time ago with many screen examples, including this one.

Check it out here: http://www.abapzombie.blog.br/codigos-exemplo/2011/01/05/abap-zombie-screen-examples-a-tela-de-selec...

It has many other examples. Hope it helps!