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: 

Event for Cursor Movement

Former Member
0 Kudos

Hi

I have a problem in which some validations are required on cursor movement. Even not to press enter.

Is there any event for cursor? If yes , Tell me.

Ruchika

7 REPLIES 7

Former Member
0 Kudos

Hi Ruchika,

There is an event called doubleclick in cl_gui_alv* (i'm not sure abt the Class). If you'r using ALV Grid then you can define a function module in the event parameter in the Function Module.

Hope this might help you.

Thanks,

Prashanth

Former Member
0 Kudos

Try this:

In the PAI event of the selection screen, the event

AT SELECTION-SCREEN ON BLOCK block

event is triggered. You define a block by enclosing the declarations of the elements in the block between the statements SELECTION-SCREEN BEGIN OF BLOCK block - END OF BLOCK block. You can use this event block to check the consistency of the input fields in the block. If an error message occurs within this event block, the fields in the block are made ready for input again on the selection screen.

REPORT demo_at_selection_on_block.

SELECTION-SCREEN BEGIN OF BLOCK part1 WITH FRAME.

PARAMETERS: number1 TYPE i,

number2 TYPE i,

number3 TYPE i.

SELECTION-SCREEN END OF BLOCK part1.

SELECTION-SCREEN BEGIN OF BLOCK part2 WITH FRAME.

PARAMETERS: number4 TYPE i,

number5 TYPE i,

number6 TYPE i.

SELECTION-SCREEN END OF BLOCK part2.

AT SELECTION-SCREEN ON BLOCK part1.

IF number3 LT number2 OR

number3 LT number1 OR

number2 LT number1.

MESSAGE e888(sabapdocu) WITH text-001.

ENDIF.

AT SELECTION-SCREEN ON BLOCK part2.

IF number6 LT number5 OR

number6 LT number4 OR

number5 LT number4.

MESSAGE e888(sabapdocu) WITH text-001.

ENDIF.

If the user does not enter numbers in ascending order in one of the blocks, the whole of the corresponding block is made ready for input again.

Regards,

Vishal

0 Kudos

Hi

Actually , Requirement is like :

There are two parameters. One is mandatory.one is not.

Based on Radiobutton r1 or r2 I have to make other parameter also mandatory if i select r1.But This should happen as soon as cursor moves.Even User do not want press enter.

This has been done but after pressing f8 using At selection screen validations.

I am unable to find any event for cursor movement.

Please help in this.

Ruchika

Former Member
0 Kudos

Hi Ruchika,

There are no events for cursor movements in list processing or alv grid.

But if you want some event for screens or selection screens, you can use list box instead of text box for the field on which you want to set a event. Assign a function code to the list box. Then you will be able to proces the screen whenever the value in the listbox is changed.

Prabhas.

0 Kudos

Hi

Please explain your previous matter clearlr.

Ruchika

0 Kudos

HI Ruchika,

Please assign function code to your radio buttons.

use the addition 'USER-COMMAND' in your declaration.

EX.

PARAMETER : RAD1 RADIOBUTTON GROUP GR1 USER-COMMAND ABCD,

RAD RADIOBUTTON GROUP GR1.

This will trigger an event when the user clicks any of the radio buttons.

in the event AT SELECTION-SCREENu can code ur logic after checking the sy-ucomm = 'ABCD'.

Please assign points if helpful.

Regards,

Prabhas.

0 Kudos

Hi Prabhas

I had found this. Also working when I am going from r2 to r1. But as parameter become mandatory in this case ,

screen does not allow to go at selction screen ouput when i want to change from r1 to r2 again.

I had assigned the points for previous one .

Ruchika