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

RE:module pool

Former Member
0 Likes
447

Hi,

Can any one explain me with a sample code .wht is the purpose of using AT CURSOR-SELECTION in PAI module in module pool.

Thanks in advance.

Alex.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
414

Here is the example

PROGRAM DEMO_DYNPRO_ON_CONDITION.

DATA: OK_CODE LIKE SY-UCOMM,

INPUT1(20), INPUT2(20), INPUT3(20),

FLD(20).

CALL SCREEN 100.

MODULE INIT_SCREEN_100 OUTPUT.

SET PF-STATUS 'STATUS_100'.

ENDMODULE.

MODULE CANCEL INPUT.

LEAVE PROGRAM.

ENDMODULE.

MODULE CURSOR INPUT.

GET CURSOR FIELD FLD.

MESSAGE I888(BCTRAIN) WITH TEXT-001 FLD.

ENDMODULE.

MODULE MODULE_1 INPUT.

MESSAGE I888(BCTRAIN) WITH TEXT-002.

ENDMODULE.

MODULE MODULE_2 INPUT.

MESSAGE I888(BCTRAIN) WITH TEXT-003.

ENDMODULE.

MODULE MODULE_* INPUT.

MESSAGE I888(BCTRAIN) WITH TEXT-004 INPUT3.

ENDMODULE.

MODULE C1 INPUT.

MESSAGE I888(BCTRAIN) WITH TEXT-005 '1'.

ENDMODULE.

MODULE C2 INPUT.

MESSAGE I888(BCTRAIN) WITH TEXT-005 '2' TEXT-006 '3'.

ENDMODULE.

Regards,

Pavan

2 REPLIES 2
Read only

Former Member
0 Likes
414

Hi Alex,

The Best explanation with example comes from our help.sap.com....

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbabbd35c111d1829f0000e829fbfe/content.htm

Also this might help...

MODULE mod [ AT {EXIT-COMMAND|CURSOR-SELECTION} ]

[ ON {CHAIN-INPUT|CHAIN-REQUEST} ]

[ SWITCH switch ].

... AT CURSOR-SELECTION

The AT CURSOR-SELECTION addition at the event PAI causes the module mod to be called only if

The function used to trigger event PAI has function code "CS" and function type "S"

The cursor is placed on a single input or output field of the screen at the moment of the user action

The call occurs within the usual PAI processing, meaning that the automatic input checks defined in the system or in the ABAP Dictionary are executed and the MODULE statement is called according to its position in the event block. You can use the addition in connection with the FIELD statement.

If the PAI event is triggered under the above circumstances, the function code is not passed to sy-ucomm and the OK field. They keep their previous values.

Note

The function type and function code of a function are determined in the Screen Painter or in the Menu Painter. We recommend to assign function code "CS" in the Menu Painter to function key F2 in order to simultaneously assign the double-click function of the mouse to it. This allows you to assign dialog modules to the selection of input or output fields.

Refer thread:

Thanks,

reward If Helpful.

Read only

Former Member
0 Likes
415

Here is the example

PROGRAM DEMO_DYNPRO_ON_CONDITION.

DATA: OK_CODE LIKE SY-UCOMM,

INPUT1(20), INPUT2(20), INPUT3(20),

FLD(20).

CALL SCREEN 100.

MODULE INIT_SCREEN_100 OUTPUT.

SET PF-STATUS 'STATUS_100'.

ENDMODULE.

MODULE CANCEL INPUT.

LEAVE PROGRAM.

ENDMODULE.

MODULE CURSOR INPUT.

GET CURSOR FIELD FLD.

MESSAGE I888(BCTRAIN) WITH TEXT-001 FLD.

ENDMODULE.

MODULE MODULE_1 INPUT.

MESSAGE I888(BCTRAIN) WITH TEXT-002.

ENDMODULE.

MODULE MODULE_2 INPUT.

MESSAGE I888(BCTRAIN) WITH TEXT-003.

ENDMODULE.

MODULE MODULE_* INPUT.

MESSAGE I888(BCTRAIN) WITH TEXT-004 INPUT3.

ENDMODULE.

MODULE C1 INPUT.

MESSAGE I888(BCTRAIN) WITH TEXT-005 '1'.

ENDMODULE.

MODULE C2 INPUT.

MESSAGE I888(BCTRAIN) WITH TEXT-005 '2' TEXT-006 '3'.

ENDMODULE.

Regards,

Pavan