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

Module Pool Screen layout problem.

Former Member
0 Likes
1,426

Here the code:

MODULE user_command_0200 INPUT.

CASE sy-ucomm.

WHEN 'MODI'.

PERFORM layout200 .

WHEN 'EXIT'.

LEAVE PROGRAM.

WHEN 'BACK'.

LEAVE TO SCREEN 0.

ENDCASE.

ENDMODULE. " USER_COMMAND_0200 INPUT

FORM layout200.

LOOP AT SCREEN.

IF NOT screen-name CS 'PERNR'.

screen-input = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

COMMIT WORK.

ENDFORM. " layout200

The problem is: Why the field with screen-input = '1', don't become white? They are always grey.

I've also verified in the debug mode and it seems correct.

Thanks for the answer.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
961

Hi

You have to manage it in your PBO not PAI, change your code in this way:

PROCESS PBO

MODULE LOOP_SCREEN.

PROCESS PAI

MODULE user_command_0200

*----


MODULE LOOP_SCREEN.

CHECK FL_SCREEN_INPUT = 'X'.

LOOP AT SCREEN.

IF NOT screen-name CS 'PERNR'.

screen-input = '1'.

MODIFY SCREEN.

ENDIF.

ENDMODULE.

FORM layout200.

FL_INPUT_SCREEN = 'X'.

ENDFORM. " layout200

Max

5 REPLIES 5
Read only

Former Member
0 Likes
962

Hi

You have to manage it in your PBO not PAI, change your code in this way:

PROCESS PBO

MODULE LOOP_SCREEN.

PROCESS PAI

MODULE user_command_0200

*----


MODULE LOOP_SCREEN.

CHECK FL_SCREEN_INPUT = 'X'.

LOOP AT SCREEN.

IF NOT screen-name CS 'PERNR'.

screen-input = '1'.

MODIFY SCREEN.

ENDIF.

ENDMODULE.

FORM layout200.

FL_INPUT_SCREEN = 'X'.

ENDFORM. " layout200

Max

Read only

0 Likes
961

Yes, but i must associate this event at the user_command WHEN SY-UCOMM = 'MODI'.

Read only

0 Likes
961

Hi,

the code wot given by max bianchi is exactly correct, genraly the screen modifications we will do in PBO only.

as per max when your sy-ucomm = 'modi'.

a flag = 'x'.

and PBO he is making that field input = '1' when the flag become x.

in max code you add

clear flag before making that flag = 'x'.

for better partice.

Read only

Former Member
0 Likes
961

You need to call the subroutine layout200 inside the module at PBO. Here is the code:

PROCESS BEFORE OUTPUT.

Module modify_screen.

-


MODULE modify_screen.

PERFORM layout200.

ENDMODULE.

-


FORM layout200.

LOOP AT SCREEN.

IF NOT screen-name CS 'PERNR'.

screen-input = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDFORM.

Read only

Former Member
0 Likes
961

Hi Avalor,

You can set a flag in PAI when sy-ucomm = 'MODI' and can call the screen again.

In the PBO of the screen you can check the value of flag and modify screen accordingly.

Regards,

Neeraj