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

Button is not disabling in module pool example.....

Former Member
0 Likes
818

Hi,

I am not able to disable button. my requirement is to disable button after clicking the same button by user. so that user will not able to click again. I tried mant SCREEN options allready but unsuccessfull.

Similar code is working fine for text-filed in my code and able to enable and disable text field on button click

Here is problamatic code.

CASE sy-ucomm .

WHEN 'B_BACK'.

leave TO SCREEN 0.

WHEN 'B_SAVE'. " --> button tcode is B_SAVE

LOOP AT SCREEN. "----


> Problem is here

IF screen-name = 'B_NAME_SAVE'. "--> name of button is B_NAME_SAVE

screen-active = '0'. "screen-invisible = 1. "screen-output = 0. "screen-active = 0.

MODIFY SCREEN.

EXIT.

ENDIF.

ENDLOOP .

ENDCASE.

ENDMODULE.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
688

hi,

EXIT is control break statement for loop nothing wrong to use this....whenever logic required to exit from the loop it used.

Regards

Gaurav

5 REPLIES 5
Read only

Former Member
0 Likes
688

hi,

declare a lflag variable. when button is clicked set the flag. in pbo disable only if the flag is set. i have added some lkines in ur logic please chek.

data: lv_flag type c.

in PAI

CASE sy-ucomm .

WHEN 'B_BACK'.

leave TO SCREEN 0.

WHEN 'B_SAVE'. " --> button tcode is B_SAVE

lv_flag = 'X'.

PBO.

LOOP AT SCREEN. "----


> Problem is here

if lv_flag = X.

IF screen-name = 'B_NAME_SAVE'. "--> name of button is B_NAME_SAVE

screen-active = '0'. "screen-invisible = 1. "screen-output = 0. "screen-active = 0.

MODIFY SCREEN.

EXIT.

ENDIF.

endif.

ENDLOOP .

ENDCASE.

ENDMODULE.

Read only

Former Member
0 Likes
688

hi,

also try to avoid exit inside loop endloop.

Read only

Former Member
0 Likes
688

Hi Raghavendar,

thanks for prompt reply ...I got the solution.

I would also like to thanks ALEX. as I got my problem solved by some manipulation based on his reply in following link:

HI raghu ...

I was using EXT in Loop so that execution time will be shortened .......Can u guide me what is wrong by using EXIT here.

Read only

Former Member
0 Likes
689

hi,

EXIT is control break statement for loop nothing wrong to use this....whenever logic required to exit from the loop it used.

Regards

Gaurav

Read only

Former Member
0 Likes
688

thanks for reply..

issue is resolved by above all reply