‎2008 Aug 06 2:44 PM
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
‎2008 Aug 06 2:49 PM
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.
‎2008 Aug 06 2:59 PM
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
‎2008 Aug 06 3:03 PM
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.
‎2008 Aug 06 3:22 PM
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
‎2008 Aug 06 3:25 PM
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.
‎2008 Aug 06 3:36 PM
‎2008 Aug 07 3:36 PM