cancel
Showing results for 
Search instead for 
Did you mean: 

Enter Button skips code

shyamnairm
Discoverer
0 Kudos

Hi Experts,

I have a clarification in code. In SD Module in the object "MV45AFZZ" there is some custom code to pop up a warning message if a user tries to create/modify a contract through VA41/VA42 tcodes with existing data.

This logic works when the save button is pressed.

When we press the enter button, the code is skipped and flow continues leading to saving of the data which is not the expectation.

At the point of pressing enter the SY-UCOMM value is 'SICH' and 'SY-DYNNR' value is '4001' same as for Save.

Can anyone please help.

Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

rajkumarnarasimman
Active Contributor
0 Kudos

Hi Shyam Nandan,

"there is some custom code to pop up a warning message if a user tries to create/modify a contract 

Use Authorization and allow the authorized users to use VA41 and VA42 transactions. If it is Warning Message, the message will populate in the screen, once enter button is pressed, the remaining code will execute (i.e Saving).

"At the point of pressing enter the SY-UCOMM value is 'SICH' and 'SY-DYNNR' value is '4001' same as for Save.

While 'Enter' action, the SY-UCOMM contains Null Value(' '). During 'Save' action, SY-UCOMM contains 'SICH' value.

"When we press the enter button, the code is skipped and flow continues leading to saving of the data which is not the expectation.

You can trigger Error message instead of the warning message if saving should not happen.

Regards

Rajkumar Narasimman