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

Disable push button after one click

Former Member
0 Likes
3,633

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

1 ACCEPTED SOLUTION
Read only

Former Member
2,734

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

13 REPLIES 13
Read only

former_member188282
Active Participant
0 Likes
2,734

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

Read only

Former Member
0 Likes
2,734

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

Read only

vladimir_erakovic
Contributor
0 Likes
2,734

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

Read only

Former Member
2,735

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

Read only

0 Likes
2,734

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.

Read only

0 Likes
2,734

Hello Kapil,

You must put that code in PBO STATUS module of screen on which is the button you want to disable.

Regards,

Vladimir

Read only

0 Likes
2,734

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.

Read only

0 Likes
2,734

Kapil,

Check this discussion:

http://scn.sap.com/thread/2048463

Read only

0 Likes
2,734

Check this link for error:

http://scn.sap.com/thread/2048463

Read only

0 Likes
2,734

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

Read only

0 Likes
2,734

As Raymond suggested, you have another variable declared in your program called 'SCREEN'. Rename the variable to something else. This error would disappear. 

Read only

0 Likes
2,734

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.

Read only

former_member186413
Participant
0 Likes
2,734

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.