2006 Sep 24 5:10 AM
<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.
2006 Sep 24 8:54 AM
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
2006 Sep 24 5:13 AM
Hi Sara,
All user actions are captured in SY-UCOMM field.
and the ok_code field used in ur module pool.
Cheers
VJ
2006 Sep 24 6:05 AM
Thanks VJ,
Can I use CASE statement as follows:
case sy-ucomm.
when 'ENTER'.
.......................
....................
endcase.
2006 Sep 24 8:41 AM
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
2006 Sep 24 9:03 AM
2006 Sep 24 7:03 AM
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>
2006 Sep 24 8:54 AM
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
2006 Sep 24 9:12 AM
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.
2006 Sep 24 9:23 AM
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
2006 Sep 24 10:05 AM