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: 

Selection-screen in module program

Former Member
0 Kudos

Hi,

I have created a module pool prog.

Now the new regd. is that I want to create selection-screen before displying the actual screen.

But when I m trying to use selection screen then I m getting the message that it is not possible in type 'M' as my program is module pool.

I m using screen 9000 to display the records, now where to write selection screen in the program?

I think in PBO but getting some error, I have created one screen and in that defined a subscreen but it is giving some error.

So any body knows how to add selection screen in 'M' type program?

Thankx in advance.

Umesh

13 REPLIES 13

Former Member
0 Kudos

A simple solution for this

Create a REPORT / EXECUTALBE program.

Have the selection screen.

After the END-of-Selection, call the screen of the module pool.

CALL SCREEN 100.

That means that screens are also a part of the report program.

You can do all this from SE80.

That means although you are creating a module program, you are just setting that as a report program, so that your selection screen problem becomes simple.

Regards,

Ravi

Note - Please mark all the helpful answers

Note - Please

Former Member
0 Kudos

Hi Umesh,

Try like this:

SELECTION-SCREEN BEGIN OF SCREEN numb [TITLE tit] [AS WINDOW].

...

SELECTION-SCREEN END OF SCREEN numb.

define a user-defined selection screen with screen number numb. All PARAMETERS, SELECT-OPTIONS, and SELECTION-SCREEN statements that occur between these two statements define the input fields and the formatting of this selection screen. Screen number numb can be any four-digit number apart from 1000, which is the number of the standard selection screen. You must also ensure that you do not accidentally assign a number to a selection screen which is already in use for another screen of the program.

From your screen program in which selection screens are defined, you can call these screens at any point of the program flow using the following statement:

CALL SELECTION-SCREEN <numb> [STARTING AT <x1> <y 1>]

[ENDING AT <x2> <y 2>].

And also look at the DEMO program DEMO_DYNPRO_SUBSCREENS.

Regards,

Kumar

Former Member
0 Kudos

hi,

try attaching a tcode to your program.

execute via tcode ,u will get the selection screen.

regards,

keerthi

Former Member
0 Kudos

Hi

U've to define a selection screen in top include using SELECTION-SCREEN statament:

SELECTION-SCREEN BEGIN OF SCREEN 100.

PARAMETERS: P_BUKRS LIKE T001-BUKRS.

SELECT-OPTIONS: S_BUDATA FOR BKPF-BUDAT.

SELECTION-SCREEN END OF SCREEN 100.

Call this in PBO of 9000:

PROCESS PBO.

MODULE CALL_SEL_SCREEN.

MODULE CALL_SEL_SCREEN.

CALL SELECTION-SCREEN 100.

IF SY-SUBRC = 0.

  • User has pressed F8

ELSE.

ENDIF.

ENDMODULE.

U can define the tipical event of a selection-screen for validation in a new include.

Max

0 Kudos

Hi All,

Thankx for the reply.

Max, I have added the selection screen statement in my top include and also created the screen in the program.

But I m getting error like Error when generating selection screen.

The same number I have given in selection screen.

SELECTION-SCREEN BEGIN OF SCREEN 0101.

select-options: s_matnr for mara-matnr.

SELECTION-SCREEN END OF SCREEN 0101.

and I have created the screen 0101 in the program with out any control on that.

Is it ok or I need to do any changes ?

Thank .

Umesh

0 Kudos

ANy ans.??

former_member404244
Active Contributor
0 Kudos

hI,

Instead of going for module pool u can do it in report (type executable).We can't set selection screen in a module pool program..

So first create a report.

then give ur selection screen parameters.

START-OF-SSELECTION.

Retrieve all the data.

END-OF-SELECTION.

CALL SCREEN '9001'.

now u can get the output in the screen 9001....

Regards,

nagaraj

Former Member
0 Kudos

Hi,

You can create a selection-screen for a module pool program.

Create a new program with executable type. Create the selection screen as you would do in a normal program. Once you give data in the selection and press F8 button, based on the logics written, the O/P must appear in a table control. This is what your requirement is:

A example below for your understanding.

name of the prog : ZTEST

Type: Exectable report (I)

*----


Selection Screen -

*----


SELECTION-SCREEN BEGIN OF BLOCK IPDATA WITH FRAME TITLE TEXT-001.

PARAMETERS: PR_MONTH LIKE BOITEM-SPMON.

SELECT-OPTIONS: SO_VKGRP FOR KNVV-VKGRP.

SELECTION-SCREEN END OF BLOCK IPDATA.

SELECTION-SCREEN BEGIN OF BLOCK ORGDATA WITH FRAME TITLE TEXT-002.

SELECT-OPTIONS: SO_REGIO FOR KNA1-REGIO,

SO_KUNNR FOR KNA1-KUNNR,

SO_WERKS FOR T001W-WERKS.

SELECTION-SCREEN END OF BLOCK ORGDATA.

*----


*--


Selection Screen Events--

*----


START-OF-SELECTION.

W_CURMFDAY = SY-DATUM.

W_CURMFDAY+6(2) = '01'.

PERFORM F001_GETDATA.

IF SY-DBCNT EQ 0.

MESSAGE S017(ZSFL).

EXIT.

ENDIF.

PERFORM F002_ADDITIONALDATA.

CALL SCREEN 100.

For this screen 100, both the PBO and PAI can be declared in this main program itself.

Regards,

JLN.

former_member188685
Active Contributor
0 Kudos

Hi,

Check this thread..

Here you can see two possible solutions.

Regards

vijay

Former Member
0 Kudos

Hi umesh,

Try the following method, create a screen which acts as a selection screen provide the input elements and on the PAI of this screen call the result screen providing the input from previous screen.

like for the example below input_1 is the input field for screen 100 and output is the field of screen 200


data: output(10) type c,
      input_1(10) type c.

load-of-program.
   call screen 100.
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module USER_COMMAND_0100 input.
  case sy-ucomm.
      when 'GO'.
          output = input_1.
         call screen 200.
 endcase.

hope this helps.

Regards,

Kinshuk

Former Member
0 Kudos

selection-screen : begin of screen 9000.

parameters c(10).

selection-screen End of screen 9000.

call selection-screen 9000.

U cant execute a module pool program by direct processing.

U have to create a transaction code in SE93 for ur Module pool program with screen number.

Now execute the transaction.

Former Member
0 Kudos

Create Selection-Screen with this option:

<b><u>put this code in to TOP include</u></b>

SELECTION-SCREEN: BEGIN OF SCREEN 9050 AS SUBSCREEN.

select-options: S_INT_NU for z0cs_zzif0_A-IF_NR, "Inter face number,

S_INT_RU FOR z0cs_zzif3-LAUF_DAT. " run date .

parameters: P_screen as Checkbox. " for hide selection screen option.

SELECTION-SCREEN: END OF SCREEN 9050.

After this :

PBO of Main Screen coding is as under.

CALL SUBSCREEN sc1 INCLUDING <Program name> <Selectioin Screen number>

In PAI of Main Screen codein is as under

CALL SUBSCREEN sc1.

Former Member
0 Kudos

Hi Umesh,

Instead of creating the selection screen, you can create one more screen to the exiting module pole and provide some butons on that to process the requirement.

This new screen can be used as selection before dispalying the other information of the module pool.

Regards,

Satya.