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 painter issue

Former Member
0 Likes
793

Dear friends

I want screen fields to be disable when I click on display button and it become enabled when I click on it again.

For example in any transaction we have options display and change when we click on display next screen shows records in a display mode we cant make changes in that , I also want same thing , is there is any Function Module for the Same.

Its very urgent .

Regards

Vinod.

11 REPLIES 11
Read only

Former Member
0 Likes
767

Welcome to SDN.

Here is what you can do to make all your fields display-only:

Assign all the fields to a group (say ABC), using the screen-painter (You will find this in the properties of each field). Then, use the following code in your PBO to set the fields to display only:

LOOP AT SCREEN.

IF screen-group1 = 'ABC'.

screen-input = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

Hope this helps.

Sudha

Read only

0 Likes
767

Hi Sudha

Thanks for reply.

I Tried this but its not working.is there any other option or any function module. i tried one function module RS_TOOLS_ACCESS it is somewhat Ok but Still having problem.

waiting for reply.

regards

Vinod.

Read only

0 Likes
767

Please post your code. As far as I know, the screen-input method works really well.

Sudha

Message was edited by: Sudha Mohan

Read only

0 Likes
767

Hi friends

Thanks for reply.

I Tried this but its not working.is there any other option or any function module. i tried one function module RS_TOOLS_ACCESS it is somewhat Ok but Still having problem.

waiting for reply.

regards

Vinod.

Read only

0 Likes
767

Hi Vinod,

Did u tried this code??

This will work for sure infact its wrkin 4 me u need to assign the screen fields with a group like G1 and have 2 create a module in the PBO of the screen

case sy-ucomm.

When 'DISPLAY'.

LOOP AT SCREEN.

IF screen-group1 = 'G1'.

screen-active = 1.

screen-input = 0.

screen-output = 1.

screen-invisible = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

endcase.

Hope this helps u.

Regards,

Seema.

Read only

0 Likes
767

program given below is test program plz go thrugh it & plz make correction where required

PROGRAM ZTEMP .

&----


*& Module STATUS_0001 OUTPUT

&----


  • text

----


MODULE STATUS_0001 OUTPUT.

SET PF-STATUS 'T1'.

  • SET TITLEBAR 'xxx'.

ENDMODULE. " STATUS_0001 OUTPUT

&----


*& Module USER_COMMAND_0001 INPUT

&----


  • text

----


MODULE USER_COMMAND_0001 INPUT.

CASE SY-UCOMM.

WHEN 'SHOW'.

LOOP AT SCREEN.

IF screen-group1 = 'PC1'.

screen-active = 1.

screen-input = 0.

screen-output = 1.

screen-invisible = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

WHEN 'BACK'.

SET SCREEN 0.

ENDCASE.

ENDMODULE. " USER_COMMAND_0001 INPUT

regds vinod

Read only

0 Likes
767

Vinod,

The code will work perfectly if you put it in the <b>PBO</b>. Remember that this is a screen change and has to be done in the PBO.

Set a flag in the PAI, for the ucomm SHOW. If the flag is X, have the PBO execute the LOOP AT SCREEN call.

Hope this helps.

Sudha

Read only

0 Likes
767

thanks

the code is working properly.

thanks again for replay.

regards,

Vinod

Read only

dani_mn
Active Contributor
0 Likes
767

HI,

you can do this by using a LOOP ENDLOOP on screen in PBO module. you can set a flag for the mode to be enable or disable for the button .

Like this.

"if button is clicked do this".

IF mode_flag = 0.

mode_flag = 1.

ELSEIF mode_flag = 1.

mode_flag = 0.

ENDIF.

in PBO do like this. assign all the fields to a field group name like 'GRP' so all will be disabled at once.

IN PBO module

IF mode_flag = 1.

LOOP AT SCREEN.

if screen-group1 = 'GRP'.

screen-input = 1.

modify screen.

endif.

ENDLOOP.

elseif mode_flag = 0.

LOOP AT SCREEN.

if screen-group1 = 'GRP'.

screen-input = 0.

modify screen.

endif.

ENDLOOP.

endif.

REgards,

Read only

Former Member
0 Likes
767

Hi,

use below logic

clear ok-code.

ok-code = sy-ucomm.

case ok-code

when 'DISPLAY'

loop at screen.

if screen-name = 'P'

screen-input = 0.

modify screen.

endif.

endloop.

else.

loop at screen.

if screen-name = 'P'

screen-input = 1.

modify screen.

endif.

endloop.

Regards

amole

Read only

Former Member
0 Likes
767

Hi Vinod,

This is how u can achieve the disable mode-

case sy-ucomm.

When 'DISPLAY'.

LOOP AT SCREEN.

IF screen-group1 = 'G1'.

screen-active = 1.

screen-input = 0.

screen-output = 1.

screen-invisible = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

endcase.

Hope this helps u.

Regards,

Seema.