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: 

Triggering save function when pressing Enter

Akshayvjd07
Explorer
0 Kudos

Created a screen . In GUI status given save but didn't given enter function.

Written the code as

if ok_code = 'save' .

Perform save_data.

But the problem is the, data get saved even if we press enter sometimes not only the save.

Point here is i didn't given any function to catch enter and didn't defined it in GUI status too.

So how to solve this?

1 ACCEPTED SOLUTION

Akshayvjd07
Explorer
0 Kudos

Your grammar is mostly correct, but there are a few minor changes that could be made to improve clarity and readability. Here's a revised version of your text:

The problem has been solved. I defined "enter" in the GUI status, which I hadn't done before because it didn't seem necessary. However, there was an inconsistency that was resolved by doing this.

Now, when Ok_code = 'save', The data is now being saved and is not saved when pressing enter.

If anyone could explain the actual reason for this, I would really appreciate it.

Thank you.

2 REPLIES 2

Akshayvjd07
Explorer
0 Kudos

Your grammar is mostly correct, but there are a few minor changes that could be made to improve clarity and readability. Here's a revised version of your text:

The problem has been solved. I defined "enter" in the GUI status, which I hadn't done before because it didn't seem necessary. However, there was an inconsistency that was resolved by doing this.

Now, when Ok_code = 'save', The data is now being saved and is not saved when pressing enter.

If anyone could explain the actual reason for this, I would really appreciate it.

Thank you.

Sandra_Rossi
Active Contributor
0 Kudos

By default, and by design, with Enter, the function code remains unchanged. It will be useful when the user presses SAVE and there's an error in a field, the user can fix the field value and press Enter that will run the same function SAVE again.

You can find more information here: Reading Function Codes.

And here: dynpro - GUI Statuses and Function Codes.