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: 

UserExit Clarification

silentbull
Participant
0 Kudos

Hi,

My userexit is working when i press the enter key after inputting a field as well as while pressing the save button.

How do i make the code working only when i press the save button.

Is there any standard variable where i can capture the key stroke and use it in the userexit.

Please clarify

Regards

Sam

1 ACCEPTED SOLUTION

former_member188827
Active Contributor
0 Kudos

Which user exit are you using? You can make use of sy-ucomm field. Please check the function code of SAVE button in debugging and then write code as:

if sy-ucomm = '<function_code_save>'.

"Write your code here...

endif.

Regards

6 REPLIES 6

former_member188827
Active Contributor
0 Kudos

Which user exit are you using? You can make use of sy-ucomm field. Please check the function code of SAVE button in debugging and then write code as:

if sy-ucomm = '<function_code_save>'.

"Write your code here...

endif.

Regards

former_member201275
Active Contributor
0 Kudos

Linked to every button is an ok-code, so you can debug and determine which you need, and then code accordingly?

VijayaKrishnaG
Active Contributor
0 Kudos

Hi Sam,

You can place a condition like IF SY-UCOMM = 'SAVE'. ENDIF. (Once check the Sy-Ucomm for SAVE button and place condition on that) in your code written for Exit.

Thanks & Regards,

- Vijay

silentbull
Participant
0 Kudos

Hi,

I am facing new issues now. After capturing the sy-ucomm code I made sure to process my user exit while pressing save button.

If i press the enter key and then press the save button, the user exit is not getting triggered at all.

If i press save button without pressing enter key, the user exit is triggering.

The end users normally tend to press the enter key to check the content and then only press the save button.

Why is this behaviour and what should i do to this?

Regards

Sam

0 Kudos

Hi-

May I know which User exit are you using? in which t.code? And share the function code which you are using?

Thanks,

Venkat

0 Kudos

Hello

Found relevant user exit only for save button.

The user exit is for the tcode QA11 and the relevant one for save button is ZXQEVU09.

Regards

Sam