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-options in module pool

Former Member
0 Likes
987

hi all,

how to get select-option field in module pool.

Regards

Suprith

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
726

Hi,

try the following code

tables : mard.

data : ok_code_100 type sy-ucomm.

selection-screen begin of screen 1010 as subscreen.

selection-screen begin of block b1 with frame title text-001.

select-options: s_werks for mard-werks,

s_lgort for mard-lgort.

parameters : p_var like disvariant-variant.

parameter: p_rb1 radiobutton group rd1 default 'X', " list

p_rb2 radiobutton group rd1. " grid

selection-screen end of block b1.

selection-screen end of screen 1010.

start-of-selection.

  • CALL SCREEN 100.

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


module status_0100 output.

set pf-status 'Z11_SUBMIT'.

set titlebar 'CALL'.

endmodule. " STATUS_0100 OUTPUT

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


module user_command_0100 input.

case ok_code_100.

when 'EXIT'.

leave program.

when 'SUBM'.

submit z11_ap_alv_mat using

selection-screen '1000'

with s_plant in s_werks

with s_stor in s_lgort

with p_var = p_var

with p_rb_01 = p_rb1

with p_rb_02 = p_rb2

and return.

endcase.

endmodule. " USER_COMMAND_0100 INPUT

here u have to design a subscreen area SUB_1010 in the screen painter, there is a option given there for that.

and also in the flow logic of screen 0100 you have to call the subscreen SUB_1010 both in PBO and PAI like :

process before output.

module status_0100.

call subscreen sub_1010 including sy-repid '1010'.

process after input.

call subscreen sub_1010.

module user_command_0100.

reward if helpful

Edited by: Ashish Paliwal on Apr 3, 2008 10:05 AM

Edited by: Ashish Paliwal on Apr 3, 2008 10:11 AM

6 REPLIES 6
Read only

Former Member
0 Likes
727

Hi,

try the following code

tables : mard.

data : ok_code_100 type sy-ucomm.

selection-screen begin of screen 1010 as subscreen.

selection-screen begin of block b1 with frame title text-001.

select-options: s_werks for mard-werks,

s_lgort for mard-lgort.

parameters : p_var like disvariant-variant.

parameter: p_rb1 radiobutton group rd1 default 'X', " list

p_rb2 radiobutton group rd1. " grid

selection-screen end of block b1.

selection-screen end of screen 1010.

start-of-selection.

  • CALL SCREEN 100.

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


module status_0100 output.

set pf-status 'Z11_SUBMIT'.

set titlebar 'CALL'.

endmodule. " STATUS_0100 OUTPUT

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


module user_command_0100 input.

case ok_code_100.

when 'EXIT'.

leave program.

when 'SUBM'.

submit z11_ap_alv_mat using

selection-screen '1000'

with s_plant in s_werks

with s_stor in s_lgort

with p_var = p_var

with p_rb_01 = p_rb1

with p_rb_02 = p_rb2

and return.

endcase.

endmodule. " USER_COMMAND_0100 INPUT

here u have to design a subscreen area SUB_1010 in the screen painter, there is a option given there for that.

and also in the flow logic of screen 0100 you have to call the subscreen SUB_1010 both in PBO and PAI like :

process before output.

module status_0100.

call subscreen sub_1010 including sy-repid '1010'.

process after input.

call subscreen sub_1010.

module user_command_0100.

reward if helpful

Edited by: Ashish Paliwal on Apr 3, 2008 10:05 AM

Edited by: Ashish Paliwal on Apr 3, 2008 10:11 AM

Read only

Former Member
0 Likes
726

You can use the SELECT-OPTIONS statement to place a group of fields on the screen that allows users

to enter complex selections. The selection may be a single value, or any form of interval

Selection ranges are stored in programs using an internal table.

The ABAP statement SELECT-OPTIONS <selname> FOR <field> declares an internal table called

<selname>, containing four fields - SIGN, OPTION, LOW, and HIGH. The fields LOW and HIGH have

the same type as the field <field>.

The SIGN field can take the value 'I' (for inclusive) or 'E' (for exclusive).

The OPTION field can contain relational operators (EQ, NE, LE, LT, GE, GT), pattern operators (CP,NP), and operators that allow you to enter intervals (BT, NB).

SELECTION-SCREEN BEGIN OF SCREEN xxxx

PARAMETERS pa_car LIKE wa_sflight-carrid OBLIGATORY.

SELECT-OPTIONS: so_car FOR wa_sflight-carrid,

SELECTION-SCREEN END OF SCREEN xxxx

and to use a CALL SELECTION-SCREEN xxxx in your module pool.

Read only

Former Member
0 Likes
726

Hi Surpith,

Try the option suggested by the fellow SDN member here.......

It is possible to create select-option on the screen using modulepool program.

1.

Define the selection-screen as subscreen in the top include of module pool program.

create modulepool program SAPMZ_SELOPT

Place the below code.or u can define that in top include.

REPORT SAPMZ_SELOPT.

TABLES :pa0001.

SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.

SELECT-OPTIONS: p_bukrs FOR pa0001-bukrs.

SELECTION-SCREEN END OF SCREEN 100.

2.

Goto garphical layout editor, drag Subscreen and drop on screen means define Subscreen area on the screen.

Place the below code in the PBO.

process before output.

" MODULE STATUS_1001.

call subscreen sub_area including 'SAPMZ_SELOPT' '100'.

process after input.

" MODULE USER_COMMAND_1001.

Please check the link for the same query closed

it will solve your problem

Regards

Byju

Read only

Former Member
0 Likes
726

Hi,

You can use select-options in module pool also.

define a screen of type selection screen.

SELECTION-SCREEN BEGIN OF SCREEN 100.

SELECT-OPTIONS: s_vbeln FOR vbak-vbeln,

SELECTION-SCREEN END OF SCREEN 100.

Call the selection screen in you module pool.

CALL SELECTION-SCREEN 100.

Reward.

Read only

venkat_o
Active Contributor
0 Likes
726

Suprith kumar It is possible to create select-option on the screen using modulepool program. 1. Define the selection-screen as subscreen in the top include of module pool program. create modulepool program SAPMZ_SELOPT Place the below code.or u can define that in top include.

REPORT  SAPMZ_SELOPT.
TABLES :pa0001.
SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
SELECT-OPTIONS: p_bukrs FOR pa0001-bukrs.
SELECTION-SCREEN END OF SCREEN 100.
2. Goto garphical layout editor, drag Subscreen and drop on screen means define Subscreen area on the screen. Place the below code in the PBO.
process before output.
" MODULE STATUS_1001.
call subscreen sub_area including 'SAPMZ_SELOPT' '100'.
process after input.
" MODULE USER_COMMAND_1001.
Its working fine. We can write code like that as well. I hope that your problem is solved Regards, Venkat.O

Read only

Former Member
0 Likes
726

You can create a selection screen in r Top Include of your module pool pgm and call this selection-screen from PBO using

CALL SELECTION-SCREEN dynnr

[STARTING AT col1 lin1

[ENDING AT col2 lin2]]

[USING SELECTION-SET variant].