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: 

Table control and Enter

oliver_am
Active Participant
0 Kudos
408

Hello, i know is a basic question but I'm stuck with this...

I've created a table control in a custom screen with the wizard. Adding buttons to add and remove rows.

It's all working fine. If I use the button to add a new row this new line is added, but now if a hit enter another new line is added, and with enter again another... and again and again...

How to avoid this?

I've tried to clear ok_code and sy-ucomm in tc_MY_TABLE_CONTROL_user_command after the action is finished, but have no effect, with a new enter the action TC_MY_TABLE_CONTROL_INSR is triggered...

I've tried to find if the is some key assigned to this button in the screen, but couldnt find where...

I've also read that you can assign a function to Enter in the pf-status to avoid this behaivor, but there is no Enter in my status (i can see this in a dialog status, buy this key is not in my standard status)

So, how to avoid add new lines everty time the user hit enter?

If i use other options, like remove, or edit some field in an existing line and then press enter is all working fine. Only happens if I just pressed the add button.

Thanks in advance.

4 REPLIES 4

Sandra_Rossi
Active Contributor
0 Kudos
344

Your code is buggy, it executes APPEND each time you press Enter. As you didn't post any code, I can only say that you should debug your program and fix it.

oliver_am
Active Participant
0 Kudos
344

Well... i didnt put any code because all the code was generated by SAP with the wizard...

I didnt put any code to append lines neither to change the ok_code or sy-ucomm...

The unique thing is that the table control is inside a subscreen called from other screen. (inside a tabstrip)

I've already debug the code and see what i said, the routine tc_MY_TABLE_CONTROL_user_command is triggered with each Enter, with the ok_code of INSR, and dont know why.

The routine tc_MY_TABLE_CONTROL_user_command is called inside the subscreen, and i tried to clear ok_code and sy-ucomm, but when i return to the main screen (after the call subscreen of the tabstrip in the PAI) the sy-ucomm recover the function INSR...

oliver_am
Active Participant
344

ok, solved... clearing sy-ucomm in the user_command module of the main screen where the subscreen is called.

Sandra_Rossi
Active Contributor
0 Kudos
344

Nice to see it's solved, thanks for feedback!