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

module pool

Former Member
0 Likes
587

Hi sdn,

I have a table control on my screen to display details.

i want only particlar range details, can i put select options for tthat?

If it is possible then how i place that selection options

please tell the ans.

Thank you.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
560

As we can't put select-options in the module pool programming.

Create two I/O fields as

material _______ To _________

while selecting the data in the where condition u can use BT operator, this will give result as select-options only.

4 REPLIES 4
Read only

Former Member
0 Likes
560

Hi,

We can't place the select-options on the screens that we created, use the RANGES as select-options as below.

ex:

Enter Value: R_RANGES-LOW to R_RANGES-HIGH.

Read only

Former Member
0 Likes
561

As we can't put select-options in the module pool programming.

Create two I/O fields as

material _______ To _________

while selecting the data in the where condition u can use BT operator, this will give result as select-options only.

Read only

Former Member
0 Likes
560

1) How to create a select-options in a module pool screen.

Method 1

-


a) Create a subscreen area in your screen layout where you want to create the select options.

b) In the top include of your module pool program declare a selection screen as a subscreen e.g.

SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.

select-options s_matnr for mara-matnr.

SELECTION-SCREEN END OF SCREEN.

c) In the PBO and PAI of the main screen where the select options needs to be created do a call subscreen of the above screen (100).

CALL SUBCREEN sub_area INCLUDING <program> <screen>

This call subscreen statement is necessary for transport of values between screen and program.

Note: All validations of the selection screen fields e.g. the s_matnr field created above should be done in selection screen events like AT SELECTION-SCREEN etc and not in PAI. These selection screen validations etc should be done in the top include only.

Method 2

-


a) Create 2 separate fields in your screen layout - one for the low value and one for the high value. Insert an icon beside the high value which will call the multiple selections popup screen on user command. Use function module COMPLEX_SELECTIONS_DIALOG to achieve this.

struc_tab_and_field-fieldname = con_cust. " 'KUNNR'

struc_tab_and_field-tablename = con_kna1. " 'KNA1'.

CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'

EXPORTING

  • TITLE = ' '

text = g_titl1 " 'Customers'

tab_and_field = struc_tab_and_field

TABLES

RANGE = rng_kunnr

EXCEPTIONS

NO_RANGE_TAB = 1

CANCELLED = 2

INTERNAL_ERROR = 3

INVALID_FIELDNAME = 4

OTHERS = 5.

IF NOT rng_kunnr[] IS INITIAL.

  • Read the very first entry of the range table and pass it to

  • dynpro screen field

READ TABLE rng_kunnr INDEX 1.

IF sy-subrc = 0.

g_cust = rng_kunnr-low.

ENDIF.

You can use the return table rng_kunnr to populate your own internal range table with the values entered by the user. Basically here you are just simulating the work of a select-options parameter by module pool screen elements.

Read only

Former Member
0 Likes
560

Hi phani,

The easiest way is to define a selection screen as a subscreen and embed this into a subscreen area of a dynpro. Here is a sample program including the screen flow logic.

report zrich_0006 .

tables: mara.

Custom Selection Screen 1010

selection-screen begin of screen 1010 as subscreen.

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.

selection-screen end of block b1.

selection-screen end of screen 1010.

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.

Screen 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.

[/code]

Regards.