2013 Oct 22 2:01 PM
Hello Guyz,
I am developing Online Examination System using ABAP , In this I have created a Push button named START. whenever i clicks start the test by showing first question. I want to know if it is possible to disable the start button after clicking it for first time so that if during exam if one click the start button by mistake it doesn't navigate it to first question again. Please help guyz i need it urgently , ur help will be appreciated.
Thanks & regards,
kapil
2013 Oct 22 8:00 PM
Hi, If you are using Screen Programming then you can use SCREEN-INPUT = 0 in the PBO method and similarly you can activate on some condition
SAMPLE code:
MODULE STATUS_0001 OUTPUT " PBO of your screen
If click = 1
LOOP AT SCREEN
If screen-name ='YOUR Button name here'
screen-input = 0
MODIFY SCREEN
endif
ENDLOOP
endif
The click can be known in PAI method as follows:
PAI method
CASE SY-UCOMM.
when 'Your button name;.
click = 1.
ENDCASE.
Message was edited by: Rajiv Kumar
Hello Guyz,
I am developing Online Examination System using ABAP , In this I have created a Push button named START. whenever i clicks start the test by showing first question. I want to know if it is possible to disable the start button after clicking it for first time so that if during exam if one click the start button by mistake it doesn't navigate it to first question again. Please help guyz i need it urgently , ur help will be appreciated.
Thanks & regards,
kapil
2013 Oct 22 2:09 PM
Hi Kapil,
If you are developing screen in module pool.
Please check the below code.
Write the below code IN PBO EVENT.
Here append sy-ucomm field in to internal table t_ucomm.
APPEND 'ENT1' TO t_ucomm.
APPEND 'CHECK' TO t_ucomm.
SET PF-STATUS 'LOSEROEFFNUNG' EXCLUDING t_ucomm.
Regards,
Rajesh
2013 Oct 22 2:17 PM
Hi Kapil,
You can disable by modifying screen table when start button is pushed. Set some flag in PAI and use it for disabling in PBO.
Regards,
Koustubh
2013 Oct 22 2:24 PM
Hi Kapil,
You can just declare variable, let's say first_time TYPE c VALUE ' '.
In PBO of screen put IF statement in which you check value of that variable, and if it's different then ' ' do loop at screen and disable button.
In PAI module user_command on click on start button assign the value e.g. 'X' to variable first_time so when user clicks start button for the first time it will be disabled.
Hope it helps.
Regards,
Vladimir
2013 Oct 22 8:00 PM
Hi, If you are using Screen Programming then you can use SCREEN-INPUT = 0 in the PBO method and similarly you can activate on some condition
SAMPLE code:
MODULE STATUS_0001 OUTPUT " PBO of your screen
If click = 1
LOOP AT SCREEN
If screen-name ='YOUR Button name here'
screen-input = 0
MODIFY SCREEN
endif
ENDLOOP
endif
The click can be known in PAI method as follows:
PAI method
CASE SY-UCOMM.
when 'Your button name;.
click = 1.
ENDCASE.
Message was edited by: Rajiv Kumar
2013 Oct 23 9:04 AM
Hello Rajiv,
I have implemented your but there is error coming which am not able to identify.
if u know the solution for this , please share. I need this urgently. Ur help will be appreciated.
2013 Oct 23 9:18 AM
Hello Kapil,
You must put that code in PBO STATUS module of screen on which is the button you want to disable.
Regards,
Vladimir
2013 Oct 23 9:36 AM
I have already put that code in PBO STATUS module , u can see in screen shot but still error is coming . Plz help me out guyz.
2013 Oct 23 9:41 AM
2013 Oct 23 9:42 AM
2013 Oct 23 10:18 AM
Well I hope that you did not define a structure with the name SCREEN in your code ?
(ActuallyI hope you did, so you just rename it)
Even if there are not "reserved words" in Abap, try not to use abap words to name your fields, structure or objects.
Regards,
Raymond
2013 Oct 23 1:02 PM
As Raymond suggested, you have another variable declared in your program called 'SCREEN'. Rename the variable to something else. This error would disappear.
2013 Oct 23 7:59 PM
Hi,
If you have declared any table or Variable with name "SCREEN" change it , to some other name and revert back with your results.
Thanks.
2013 Oct 24 4:25 AM
It's quite simple, first in PAI event MODULE user_command.
for eg.
MODULE user_command INPUT.
save_ok = sy-ucomm.
CASE save_ok.
WHEN 'START".
PERFROM exam.
LOOP AT SCREEN.
IF SCREEN-NAME = 'START'.
SCREEN-ACTIVE = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDCASE.
ENDMODULE.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |