Application Development 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: 

Module pool logic

Former Member
0 Kudos
161

<b>HELLO FRIENDS.</b>

When enduser enters the employee_Number in the screen field and presses <b>"ENTER"</b> then the employee_Name and employee_Dept should be displayed in a non-editable form.

And I met the requirement execpt the logic to be use when the enduser presses the <b>"ENTER"</b> key and in which system field the <b>"ENTER"</b> key is stored. <b>PLEASE HELP</b>.

Regards

Sara.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
137

Hi Sara

The <b>Enter</b> key is assigned to <b>SPACE</b> functional code by default, so if you haven't assign an OK-CODE to it in your STATUS GUI, you should check when OK-CODE is SPACE.

Anyway I believe you haven't to care of the value of OK-CODE, but only if the field of employee_Number is or isn't filled.

Infact u can change the attributes of the screen field only in the PBO and it's triggered every time the user press a buttom (or key).

PROCESS PBO

MODULE LOOP_SCREEN.

MODULE LOOP_SCREEN.

IF NOT employee_Number IS INITILA.

LOOP AT SCREEN.

IF SCREEN-NAME = <employee_Name> OR

SCREEN-NAME = <employee_Dept>.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

ENDMODULE.

Max

9 REPLIES 9

Former Member
0 Kudos
137

Hi Sara,

All user actions are captured in SY-UCOMM field.

and the ok_code field used in ur module pool.

Cheers

VJ

0 Kudos
137

Thanks VJ,

Can I use CASE statement as follows:

case sy-ucomm.

when 'ENTER'.

.......................

....................

endcase.

0 Kudos
137

Hi Sara,

Yes you can use the case statement as you have mentioned but remember the user action enter can have different sy-ucomm values on different screens. In some screens sy-ucomm will be "ENTE" , in some screens it will be "ENTER" so, try doing a debugging and check whats the value in the sy-ucomm and you can code accordingly.

Cheers

VJ

0 Kudos
137

Thanks Ajith and VJ.

I will try the above solutions.

Former Member
0 Kudos
137

hi sara,

TRY THIS..

use IN PAI

FIELD <employee_number> MODULE GET_NAME.

MODULE GET_NAME.

SELECT SINGLE EMP_NAME EMP_DEPT

FROM <TABLE> INTO (SCREEN_EMP_NAME,SCREEN_EMP_DEPT) WHERE EMPLOYEE NUMBER = SCREEN_EMP_NUM.

ENDMODULE.

<b>AWARD POINTS IF FOUND USEFUL.</b>

Former Member
0 Kudos
138

Hi Sara

The <b>Enter</b> key is assigned to <b>SPACE</b> functional code by default, so if you haven't assign an OK-CODE to it in your STATUS GUI, you should check when OK-CODE is SPACE.

Anyway I believe you haven't to care of the value of OK-CODE, but only if the field of employee_Number is or isn't filled.

Infact u can change the attributes of the screen field only in the PBO and it's triggered every time the user press a buttom (or key).

PROCESS PBO

MODULE LOOP_SCREEN.

MODULE LOOP_SCREEN.

IF NOT employee_Number IS INITILA.

LOOP AT SCREEN.

IF SCREEN-NAME = <employee_Name> OR

SCREEN-NAME = <employee_Dept>.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

ENDMODULE.

Max

0 Kudos
137

THANKS MAX.

Max i have not assign an OK-CODE in STATUS GUI.

So please tell how to assign an OK-CODE in STATUS GUI, and how can I check when OK-CODE is SPACE?

SARA.

0 Kudos
137

Hi

See the section FUNCTION KEYS of yuor status here assign an OK-CODE to the first field (just before of the SAVE icon).

In this way u'll assign an Ok-CODE to ENTER key.

PROCESS PAI.

MODULE USER_COMMAND.

MODULE USER_COMMAND.

SAVE_OK_CODE = OK_CODE.

CLEAR OK_CODE.

CASE SAVE_OK_CODE.

WHEN SPACE.

-


> The user has pressed ENTER

WHEN ......

ENDMODULE.

Of course if you have assigned an ok-code:

MODULE USER_COMMAND.

SAVE_OK_CODE = OK_CODE.

CLEAR OK_CODE.

CASE SAVE_OK_CODE.

WHEN <MY CODE>.

-


> The user has pressed ENTER

WHEN ......

ENDMODULE.

Max

0 Kudos
137

<b>THANKS MAX.</b>