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: 

Screen Painter and SELECT-OPTIONS howto???

Former Member
0 Kudos

I'm just beginning to use Screen Painter and so far I really like it. However, I'm running into a dead end. I would like to have a field that allows multiple selections, for which I formerly entered text such as:


SELECT-OPTIONS: p_atinns FOR cabn-atinn NO INTERVALS.

The above code will automatically produce a button that brings up another small screen to enter (either manually or from a file). Using Screen Painter, I have linked the field to the cabn-atinn dictionary, which works very nicely, but can I also make this a multiple select without having to go back into my ABAP code?

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

The easiest way to include select-options in a dynpro or screen is to embed a subscreen into your dynpro. You define a selection screen as a subscreen, then embed the subscreen in your dynpro. Here is a sample program.




report zrich_0006 .

tables: mara.

* Custom Selection Screen 1010
<b>selection-screen begin of screen 1010 as subscreen.</b>
selection-screen begin of block b1 with frame title text-001.
parameters: p_rad1 radiobutton group grp1 default 'X',
            p_rad2 radiobutton group grp1,
            p_rad3 radiobutton group grp1.
select-options: s_matnr for  mara-matnr,
                s_matkl for  mara-matkl,
                s_mtart for  mara-mtart.
<b>selection-screen end of block b1.
selection-screen end of screen 1010.</b>


start-of-selection.

  call screen 100.
*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
module status_0100 output.
*  SET PF-STATUS 'xxxxxxxx'.
*  SET TITLEBAR 'xxx'.

endmodule.
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
module user_command_0100 input.

endmodule.

Here is the screen flow of the screen 100. You must create a subscreen are using screen painter, Name it as Subscreen_1010.



* Create screen 100 with a subscreen area called "subscreen_1010"
* Screen Flow Logic follows

process before output.

  module status_0100.

  call subscreen subscreen_1010 including sy-repid '1010'.

process after input.

  call subscreen subscreen_1010 .

  module user_command_0100.

Regards,

Rich Heilman

9 REPLIES 9

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

The easiest way to include select-options in a dynpro or screen is to embed a subscreen into your dynpro. You define a selection screen as a subscreen, then embed the subscreen in your dynpro. Here is a sample program.




report zrich_0006 .

tables: mara.

* Custom Selection Screen 1010
<b>selection-screen begin of screen 1010 as subscreen.</b>
selection-screen begin of block b1 with frame title text-001.
parameters: p_rad1 radiobutton group grp1 default 'X',
            p_rad2 radiobutton group grp1,
            p_rad3 radiobutton group grp1.
select-options: s_matnr for  mara-matnr,
                s_matkl for  mara-matkl,
                s_mtart for  mara-mtart.
<b>selection-screen end of block b1.
selection-screen end of screen 1010.</b>


start-of-selection.

  call screen 100.
*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
module status_0100 output.
*  SET PF-STATUS 'xxxxxxxx'.
*  SET TITLEBAR 'xxx'.

endmodule.
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
module user_command_0100 input.

endmodule.

Here is the screen flow of the screen 100. You must create a subscreen are using screen painter, Name it as Subscreen_1010.



* Create screen 100 with a subscreen area called "subscreen_1010"
* Screen Flow Logic follows

process before output.

  module status_0100.

  call subscreen subscreen_1010 including sy-repid '1010'.

process after input.

  call subscreen subscreen_1010 .

  module user_command_0100.

Regards,

Rich Heilman

0 Kudos

Rich,

I've included the following code in my Flow Logic:


PROCESS BEFORE OUTPUT.
  MODULE status_0100.
  CALL SUBSCREEN subscreen_1010 INCLUDING sy-repid '1010'.

PROCESS AFTER INPUT.
  CALL SUBSCREEN subscreen_1010 .
  MODULE user_command_0100.

and the following code in my ABAP:


* Custom Selection Screen 1010
SELECTION-SCREEN BEGIN OF SCREEN 1010 AS SUBSCREEN.
  SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
  
  SELECT-OPTIONS: p_char FOR  cabn-atnam.
  SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN END OF SCREEN 1010.

However, when I do a syntax check in my Flow Control, I get an error that says "Screen 0100 Include block not specified, not defined or spelt incorrectly" (typo not mine).

0 Kudos

You must remember to create the subscreen UI element vai screen painter, open the layout editor Click the icon for Subscreen area from the toolbar on the left, next create this box in the layout. Give the name as "subscreen_1010", save and activate.

Regards,

Rich Heilman

0 Kudos

Works like a champ and looks better, too. Thanks a million!

0 Kudos

Yes, I like it a lot, and you get all of the functionality of select-options with multiple section and everything.

Glad to help.

Regards,

Rich Heilman

0 Kudos

Hi Rich, i know is more than a year, but your post is more than useful to me. So thank you very much. I have one problem with this, i use the select option for the BKPF-BUDAT, (date format) I do all the steps you say, and i have a very nice dynpro wiht my select option, but i can read the value that is on the select option.

My code is like this:

SELECTION-SCREEN BEGIN OF SCREEN 102 AS SUBSCREEN.

SELECT-OPTIONS: s_budat FOR bkpf-budat.

SELECTION-SCREEN: END OF SCREEN 102.

But s_budat is always initial, also i choose values for it in the dynpro.

What can i do?? Thank you in advance.

Fidel

0 Kudos

Hi Fidel,

It's been 5 years since you posted this, but may I know how you solved your problem of retrieving select-options values from the subscreen? I am facing a similar problem right now.

Will be glad if you could help.

Regards,

Gautam

Former Member
0 Kudos

Hi Eric,

Place another I/O Field in the screen-painter and link that to cabn-atinn field.

Hope this solves UR problem, it it does please reward.

Thanks,

Bharath.

Former Member
0 Kudos

Hi,

I do have the same problem.

while calling subscreen in both pbo and pai,

pbo

CALL SUBSCREEN SUBUPLD INCLUDING 'SAPMZSD_UPLD' '9001'

and not as

CALL SUBSCREEN 'SUBUPLD' INCLUDING 'SAPMZSD_UPLD' '9001'