08-29-2006 11:15 AM
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
08-29-2006 11:18 AM
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
08-29-2006 11:22 AM
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
08-29-2006 11:33 AM
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
08-29-2006 11:25 AM
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.
08-29-2006 11:35 AM
08-29-2006 12:13 PM
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.
08-30-2006 7:12 AM
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