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

Select option in Module pool

Former Member
0 Likes
2,885

I am trying to incorporate select option in  module pool. I am getting an error 'CALL SUNSCREEN :>PROGRAM NAME> 0100 NO DYNPRO NAME'.

Please Help!!

Hari

1 ACCEPTED SOLUTION
Read only

former_member202818
Active Contributor
0 Likes
2,361

HI Hariharan,

*&---------------------------------------------------------------------*

*& Include ZSELOPT_IN_MP_TOP                                 Module Pool      ZSELOPT_IN_MP

*&

*&---------------------------------------------------------------------*

PROGRAM  zselopt_in_mp.

TABLES ekko.

SELECTION-SCREEN BEGIN OF SCREEN 9001 AS SUBSCREEN.

SELECT-OPTIONS so_ebeln FOR ekko-ebeln.

SELECTION-SCREEN END OF SCREEN 9001.



-->Normal Screen with Subscreen(9000) Area 'sub'.


PROCESS BEFORE OUTPUT.

* MODULE STATUS_9000.

*

call SUBSCREEN sub INCLUDING sy-cprog '9001'.    (Here is your problem, use quotas )

PROCESS AFTER INPUT.

* MODULE USER_COMMAND_9000.

CALL SUBSCREEN sub.

5 REPLIES 5
Read only

former_member196651
Contributor
0 Likes
2,361

Hi Hari,

For calling a selection screen from within a module pool, you need to declare the selection screen as a subscreen and call this in to a subscreen area in the module pool. Please have look at the following code.

REPORT zabi_test04.

SELECTION-SCREEN BEGIN OF SCREEN 1001 AS SUBSCREEN.

PARAMETERS p_werks  TYPE t001w-werks.

SELECTION-SCREEN END OF SCREEN 1001.

DATA : ok_code    TYPE sy-ucomm,

        save_ok    TYPE sy-ucomm,

        lv_dynnr   TYPE sy-dynnr VALUE '1001'.

START-OF-SELECTION.

   CALL SCREEN 9000.

*&---------------------------------------------------------------------*

*&      Module  STATUS_9000  OUTPUT

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

MODULE status_9000 OUTPUT.

   SET PF-STATUS 'STAT9000'.

   SET TITLEBAR 'TL1'.

ENDMODULE.                 " STATUS_9000  OUTPUT

*&---------------------------------------------------------------------*

*&      Module  USER_COMMAND_9000  INPUT

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

MODULE user_command_9000 INPUT.

   save_ok = ok_code.

   CLEAR ok_code.

   CASE save_ok.

     WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.

       LEAVE PROGRAM.

     WHEN '&SELECT'.

       lv_dynnr  = '1001'.

       CALL SCREEN 9001.

   ENDCASE.

ENDMODULE.                 " USER_COMMAND_9000  INPUT

*&---------------------------------------------------------------------*

*&      Module  STATUS_9001  OUTPUT

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

MODULE status_9001 OUTPUT.

   SET PF-STATUS 'STAT9001'.

   SET TITLEBAR 'TL2'.

ENDMODULE.                 " STATUS_9001  OUTPUT

*&---------------------------------------------------------------------*

*&      Module  USER_COMMAND_9001  INPUT

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

MODULE user_command_9001 INPUT.

   save_ok = ok_code.

   CLEAR ok_code.

   CASE save_ok.

     WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.

       LEAVE TO SCREEN 0.

     WHEN '&EXECUTE'.

       "Write your logic

   ENDCASE.

ENDMODULE.                 " USER_COMMAND_9001  INPUT


Copy this code and check that your requirement is met or not and revert back.


Regards,

Abijith

Read only

0 Likes
2,361

Hi,

To make select option on your custom screen of module pool,

1. Take subscreen on your custom screen suppose say screen 9001, give name to subscreen as 'SUB'.

2. Write following code in your TOP include:

Tables: AFKO.

SELECTION-SCREEN BEGIN OF SCREEN 2100 AS SUBSCREEN.

SELECT-OPTION: s_aufnr for afko-aufnr..

SELECTION-SCREEN END OF SCREEN 2100.

3. Then goto PBO event of your screen 9001.

PROCESS BEFORE OUTPUT.

CALL SUBSCREEN SUB INCLUDING SY-REPID '2100'.

MODULE PBO_9001.

Regards,

Keyur Pawar

Read only

former_member202818
Active Contributor
0 Likes
2,362

HI Hariharan,

*&---------------------------------------------------------------------*

*& Include ZSELOPT_IN_MP_TOP                                 Module Pool      ZSELOPT_IN_MP

*&

*&---------------------------------------------------------------------*

PROGRAM  zselopt_in_mp.

TABLES ekko.

SELECTION-SCREEN BEGIN OF SCREEN 9001 AS SUBSCREEN.

SELECT-OPTIONS so_ebeln FOR ekko-ebeln.

SELECTION-SCREEN END OF SCREEN 9001.



-->Normal Screen with Subscreen(9000) Area 'sub'.


PROCESS BEFORE OUTPUT.

* MODULE STATUS_9000.

*

call SUBSCREEN sub INCLUDING sy-cprog '9001'.    (Here is your problem, use quotas )

PROCESS AFTER INPUT.

* MODULE USER_COMMAND_9000.

CALL SUBSCREEN sub.

Read only

Former Member
0 Likes
2,361

Hi Hariharan,

its may be help you..

wirte code in the TOP_INCLUDE

selection-screen begin of screen 800 as subscreen.

data: <local_variable>  type <database_table>-field.

select-options : <field> for <local_variable>.

selection-screen end of screen 800.

Thanks and Regards

Niraj Sinha

Read only

Former Member
0 Likes
2,361