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 logic

Former Member
0 Likes
1,091

<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
Read only

Former Member
0 Likes
1,067

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
Read only

Former Member
0 Likes
1,067

Hi Sara,

All user actions are captured in SY-UCOMM field.

and the ok_code field used in ur module pool.

Cheers

VJ

Read only

0 Likes
1,067

Thanks VJ,

Can I use CASE statement as follows:

case sy-ucomm.

when 'ENTER'.

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

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

endcase.

Read only

0 Likes
1,067

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

Read only

0 Likes
1,067

Thanks Ajith and VJ.

I will try the above solutions.

Read only

Former Member
0 Likes
1,067

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>

Read only

Former Member
0 Likes
1,068

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

Read only

0 Likes
1,067

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.

Read only

0 Likes
1,067

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

Read only

0 Likes
1,067

<b>THANKS MAX.</b>