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

How to insert a standard selection screen on moduled program?

Former Member
0 Likes
1,441

Hi All,

Selection screen can be easily done in classic report by just simply invoking the event "SELECTION-SCREEN"


SELECTION-SCREEN BEGIN OF ...
SELECT-OPTIONS ...
PARAMETERS ...

In the case of moduled program, there will be a PBO and PAI, I have a requirement on my 2nd screen where I need to have a selection screen, but the SELECTION-SCREEN event is not applicable for NOT TYPE 1(Executable) Program.

My Dialog Program Flow:

Main Screen -> Display Screen (should be SELECTION SCREEN) -> Output (3rd screen)

What's the best alternative solution on this scenario?

Thanks.

1 ACCEPTED SOLUTION
Read only

former_member217544
Active Contributor
0 Likes
1,361

Hi,

You can use

CALL SELECTION-SCREEN dynnr

[STARTING AT col1 lin1

[ENDING AT col2 lin2]]

[USING SELECTION-SET variant].

You can check sap help for more details.

Regards,

Swarna Munukoti.

12 REPLIES 12
Read only

premal_mistry2
Active Participant
0 Likes
1,361

Hi Jaime,

You can use the fm COMPLEX_SELECTIONS_DIALOG. For a deatiled code please search sdn.

Regards,

Premal

Read only

former_member217544
Active Contributor
0 Likes
1,362

Hi,

You can use

CALL SELECTION-SCREEN dynnr

[STARTING AT col1 lin1

[ENDING AT col2 lin2]]

[USING SELECTION-SET variant].

You can check sap help for more details.

Regards,

Swarna Munukoti.

Read only

0 Likes
1,361

Hi Swarna,

Yes, I came into that, but I realized that I have to design everything from scratch compared to the SELECTION-SCREEN event where SELECTION-OPTIONS has an automatic ranges capability.

Am I right?

I'm thinking if there's any other automatic way to recreate the SELECTION-SCREEN event / SELECTION screen for Executable programs to module pools.

Thanks.

Read only

0 Likes
1,361

Hi,

Check this program DEMO_SEL_SCREEN_WITH_SUBSCREEN where a selection screen is being called in a tab strip. may be you can go through the steps to implement the same while calling from your first screen.

Regards,

Swarna Munukoti.

Read only

0 Likes
1,361

Hi All,

I layout and detailed my question, please see my scenario below:

screen 9000


MODULE user_command_9000 INPUT.
  CASE ok_code.
     WHEN 'CREATE'.
        CALL SCREEN 9001.
     WHEN 'DISPLAY'.
         "SHOULD CALL A SELECTION SCREEN HERE
         "AFTER THE SELECTION SCREEN, IS ANOTHER SCREEN FOR OUTPUT
    ENDCASE.

TOP include


SELECTION-SCREEN BEGIN OF SCREEN 9003 AS SUBSCREEN.
  PARAMETERS P_PLANT TYPE T001W-WERKS.
  SELECT-OPTIONS: S_MATNR    FOR MARA-MATNR,
                  S_LICHA    FOR MCHA-LICHA,
                  S_LIFNR    FOR LFA1-LIFNR.
SELECTION-SCREEN END OF SCREEN   9003.

Questions:

1. on the PAI of my main screen 9001, how can I call the SUBSCREEN I created using CALL SUBSCREEN?

the code:


        CALL SUBSCREEN 9001 INCLUDING 'PROG_NAME' '9002',
     

is not working / syntax error.

2. Should I call it like this?


    WHEN 'DISPLAY'.
       CALL SCREEN 9002.
   

Screen 9002 PBO


        CALL SUBSCREEN 9001INCLUDING 'PROG_NAME' 9002',
     

is not working / syntax error.

Thanks all.

Edited by: Jaime Cabanban on Dec 2, 2009 5:29 PM

Read only

0 Likes
1,361

in the PAI use the statement

CALL SELECTION-SCREEN 9002 STARTING AT 1 1 ENDING AT 80 80

In the PBO of 9002, call the selection screen as subscreen (u have already done it)

Hope it helps

Thanks,

Anju

Read only

0 Likes
1,361

Hi Jaime,

You are not calling the subscreen correctly.

You need to create a new screen(say 9002) with a subscreen area(say sub_area) in it.

now

when 'DISPLAY'.
                CALL SCREEN '9002'.

In PBO of screen 9002 write

CALL SUBSCREEN sub_area INCLUDING 'PROG_NAME' '9003'.

This should work

Regards

Avinash

Read only

0 Likes
1,361

Hi Jaime,

While calling a subscreen, there are few more steps that need to be followed.

The link provided by Raymond will help you to create the subscreen in module pool

http://help.sap.com/saphelp_nw04/helpdata/en/e7/deb237b9a9a968e10000009b38f8cf/frameset.htm.

To put the same into your screen names:

Create a normal module screen 9002. In that create a subscreen area from edit -> Create element -> subscreen

Now give a name sel_1 fro that subscreen

so to call this scubscreen when ok_code is 'DISPLAY'.


MODULE user_command_9000 INPUT.
  CASE ok_code.
     WHEN 'CREATE'.
        CALL SCREEN 9001.
     WHEN 'DISPLAY'.
        CALL SCREEN 9002.
    ENDCASE.


Now in the PBO of screen 9002, use the staements call subscreen

PROCESS BEFORE OUTPUT.
 MODULE STATUS_9002.

call subscreen sel_1 including sy-repid '9003'. " calling your defined selection screen 9003

PROCESS AFTER INPUT.

MODULE USER_COMMAND_9002.
call subscreen sel_1.

Hope this will help you.

Regards,

Swarna Munukoti.

Read only

Former Member
0 Likes
1,361

Hi Jaime,

You can declare a selection screen like a subscreen(like below) and then use it in your module pool program.


SELECTION-SCREEN BEGIN OF SCREEN 300 as SUBSCREEN.

   PARAMETERS...
   SELECT OPTIONS....

SELECTION-SCREEN END OF SCREEN 300.

Now call this subscreen in a screen of your choice.This should work.I have tried this myself.

Regards

Avinash

Edited by: Avinash Jagtap on Dec 2, 2009 9:23 AM

Read only

premal_mistry2
Active Participant
0 Likes
1,361

Hi Jaime,

Kindly have a look at this link

[http://www.sapdb.info/forums/index.php?topic=3271.0;wap2]

Regards,

Premal

Read only

Former Member
0 Likes
1,361

Hello,

Try this

create a selection screen using

SELECTION-SCREEN BEGIN OF SCREEN 1100 AS SUBSCREEN.

SELECT-OPTIONS: s_matnr for mara-matnr.

SELECTION-SCREEN END OF SCREEN 110.

Create a subscreen 9001 with a subscreen area and call the selection screen in the screen 9001 like a normal a subscreen.

PROCESS BEFORE OUTPUT.

CALL SUBSCREEN sel_crit INCLUDING sy-repid '1100'.

PROCESS AFTER INPUT.

CALL SUBSCREEN sel_crit.

what ever code needs to be done for the selection screen is done in the top incklude using selection screen events like std reports e.g. at selection screen output.

Hope it helps u.

Thanks,

Anju

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,361

Just read sap documentation at [Selection Screens as Subscreens|http://help.sap.com/saphelp_nw04/helpdata/en/e7/deb237b9a9a968e10000009b38f8cf/frameset.htm] (there is a sample provided)

- [COMPLEX_SELECTIONS_DIALOG|http://wiki.sdn.sap.com/wiki/display/sandbox/Usethefunctionalityofselect-optionsindialogprogramming%28module+pool%29] is useful for dynamic selection (like those in logical database)

- [CALL SELECTION-SCREEN|http://help.sap.com/abapdocu_70/en/ABAPCALL_SELECTION_SCREEN.htm] should only be used in a SELECTION-SCREEN report, not in module pool programming

Regards,

Raymond