cancel
Showing results for 
Search instead for 
Did you mean: 

How to deactivate the screen fields dynamically in Module Pool Program?

Former Member
0 Kudos

Hi guys,

How to <b>activate & deactivate the screen fields</b> of a <b>module pool program</b>

<b>dynamically</b> through program. Like Change mode and display mode in a single

screen.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi,

You can simply loop at the screen and make the changes in the screen field apprearance.

loop at screen.

if screen-name = 'ABC'. " Identity the screen field name.

screen-active = 0. " use fields like active, output, input for changing the

" appreanace of screen fields

endif.

endloop

This needs to be done just before the final display of the screen ie PBO.

Hope this helps.

Regards,

Richa

Former Member
0 Kudos

Hi,

Make use of a Variable,say gv_flag, for both Activate and Deactivate functionalities. As many times you hit the same button, change this variable value. For example, let us say first time you hit this button, assign value 'X' to this variable. Second time you hit this button, assign value ' ' to this variable. In PBO based the variable value you have to Activate and Deactivate.

PBO.

if gv_flag = 'X'. " Activate

loop at screen.

if screen-fname = 'ITAB1-MATNR'.

screen-input = '1'.

modify screen.

endif.

endloop.

elseif gv_flag = ' '. " Deactivate

if screen-fname = 'ITAB1-MATNR'.

screen-input = '0'.

modify screen.

endif.

endloop.

endif.

PAI.

case sy-ucomm.

when 'ACDC'. " Activate/Deactivate

if gv_flag = 'X'.

gv_flag = ' '.

else.

gv_flag = 'X'.

endif.

endcase.

thanks,

sksingh