Application Development and Automation 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: 
Read only

for enter

Former Member
0 Likes
794

how to use enter button instead of pushbutton for calling another screen?

6 REPLIES 6
Read only

Former Member
0 Likes
762

Hi,

normally the ok_code for Enter is 'ENTR'. So check sy-ucomm value equal to 'ENTR' and then call the required screen.

Regards,

Ankur Parab

Read only

0 Likes
762

>

> Hi,

> normally the ok_code for Enter is 'ENTR'. So check sy-ucomm value equal to 'ENTR' and then call the required screen.

>

> Regards,

> Ankur Parab

Sorry but this is not true. Normally pressing ENTER doesn't place any function code in sy-ucomm . This is one of the reason why you in PAI we should store ok_code in some save_code variable and then clear it. Simply after pressing ENTER in next screen without first clearing content of ok_code we might still have previous function code there, hence program logic would be wrong.

Refer for proof [Reading Function Codes|http://help.sap.com/saphelp_nw04s/helpdata/en/9f/dbaa1335c111d1829f0000e829fbfe/frameset.htm]

@ Priya.R

If you want to catch your ENTER, simply do the following


data: ok_code like sy-ucomm,  "ok_code assigned to screen
          save_code like sy-ucomm.

MODULE pai INPUT.
   save_code = ok_code.  
   clear ok_code.
   
   if save_code = space.  "as said above ENTER will generate empty function code
    CALL SCREEN ...
   endif.     
ENDMODULE.

Regards

Marcin

Read only

Former Member
0 Likes
762

Hi,

Go to the GUI status -> Application Tool bar -> In the Enter button (a tick mark), assign a function code 'ENTER', check and activate the GUI status.

Now your sy-ucomm value for Enter is 'ENTER'. Start coding using this sy-ucomm value in your program.



      IF ( sy-ucomm EQ 'ENTER' ).
        CALL SCREEN 0120.
      ENDIF.

Read only

Former Member
0 Likes
762

Hi priya,

For handling enter button event, you create a pf-status. In your pf-status, there will be "tick" symbol ( OK ). Under that you create a function code and then if you press enter button, your sy-ucomm value will be the function code which you gave in your pf-status.

Try it. It will work.

Thanks and regards,

Venkat

Read only

Former Member
0 Likes
762

Hello Priya,

For ENTER key sy-ucomm value is initial.

Thanks,

Augustin

Read only

Former Member
0 Likes
762

Hi, For Enter key, Function code is space.

use code like.

if sy-ucomm eq 'SPACE'.

.

.

.

ENDIF.