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

screen disabling

Former Member
0 Likes
844

Hi all,

I have added a sub screen in the stnd. application.

The added screen is in editable mode.Now i need have to make the screen enabled or disabled when i select the CHANGE<->DISPLAY button in the appl'n.

Pl tell me hw to get it.

Thanks,

Naresh

7 REPLIES 7
Read only

Former Member
0 Likes
830

You need to add the below code in one of the userexit so as that it trigger accordingly.

if sy-tcode = <display>.

loop at screen.

if screen-name = <field-name>.

screen-input = 0.

endif.

modify screen.

endloop.

endif.

Read only

Former Member
0 Likes
830

hii

you can use like

CASE sy-ucomm.
  WHEN 'DISPLAY'.--->your Button name
    LOOP AT SCREEN.
      IF screen-name CS 'p_docno'-->here like this you can write for all your screen elements by using AND addition.
        screen-enable = 0.
        MODIFY SCREEN.
      ENDIF.                           " IF screen-name CS 'p_docno'.
    ENDLOOP.                           " LOOP AT SCREEN.
  
  WHEN 'CHANGE'..--->your Button name

    LOOP AT SCREEN .
      IF screen-name CS 'p_docno'.
        screen-enable = 1.
        screen-input = 1.
        MODIFY SCREEN.
      ENDIF.                           " IF screen-name CS 'p_docno'.
    ENDLOOP.                           " LOOP AT SCREEN .
  
ENDCASE.

i hope it helps you

regards

twinkal

Read only

Former Member
0 Likes
830

hi,

Use case endcase.

Firstly you will have to put the fields you want in display and change mode in the screen painter (SE51)and then use that group name in the screen-group1 parameter.

Case sy-ucomm.

when 'DISPLAY'.

LOOP AT SCREEN.

IF screen-group1 = 'DIS'.

screen-input = '0'.

MODIFY SCREEN .

ENDIF.

ENDLOOP.

when 'CHANGE'.

LOOP AT SCREEN.

IF screen-group1 = 'CHA'.

screen-input = '1'.

MODIFY SCREEN .

ENDIF.

ENDLOOP.

Endcacse

Hope this helps you

Thanks,

Sneha.

Read only

0 Likes
830

Hi Sneha,

Thanks for your reply.

Can u tell me where can i keep tihs peice of code..

in PBO or in PAI.

Thanks,

Naresh

Read only

0 Likes
830

hi,

You can keep this piece of code in the PBO (PROCESS BEFORE OUTPUT) since you have to modify the screen attributes as soon as you click on the particular pushbutton so that you can further do the changes on to the screen as per your need.

Thanks,

Sneha.

Read only

0 Likes
830

thanks for your reply..

Read only

Former Member
0 Likes
830

thanks all