Skip to Content
author's profile photo Former Member
Former Member

Handling Enter Event in a screen.

Hello Colleague,

I have a report. There are 4 screens inside it.

The function Code for F8/Execute Button is 'ONLI'

First screen is a normal screen. Second screen is a tabstrip control which contains 7 subscreens inside it.

One of the subscreen is made active for the tabstrip control.

When I choose some input parameters in my first screen and click on execute, I am redirected to second screen( tabstrip control )

Here when I press Enter on any input field, the value of sy-ucomm comes as 'ONLI', whereas its expected to be blank. If I switch between the tabs and then press on Enter on any input field, then the sy-ucomm value is NULL.

So the problem is initially when I come to my tabstrip control and raise an Enter event, value of SY_UCOMM is ONLI. I need to make it NULL.

How can I solve it ?

By NULL I mean Blank.

Thanks & Regards,

Rohit.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 30, 2013 at 06:46 AM

    Hi Rohit,

    From the first screen when you click on execute you are directed to the second screen, but you are not clearing the sy-ucomm. The best option is to use an ok_code and clear the ok_code after the PAI of first screen. Inn the second screen use the ok_code of the second screen for checking the enter event. You may also clear the sy-ucomm valu in the last of PAI of your first screen. But it is not recommended to clear a system field.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 30, 2013 at 07:28 AM

    Hi Rohit,

    Try this.

    In the PAI of the first screen take the value of sy-ucomm into a variable and use the value of the variable for processing. Also clear the variable containing sy-ucomm value at the end of screen processing(PAI). It will clear the already capture value of sy-ucomm in the first screen and the variable will be free to capture the value of sy-ucomm in the second screen.

    Regards

    Alex

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 30, 2013 at 06:49 AM

    Hi,

    try like this , Maintain Same group name(SCREEN-Group1) for all tabs in your tab-strip control.

    Regards,

    Praveen

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 30, 2013 at 07:47 AM

    Hello Rohit.

    For your second screen, create and assign a new GUI_STATUS with a function code for ENTER.

    Regards.


    GUI_STATUS.jpg (184.2 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 30, 2013 at 08:22 AM

    Hi Rohit,

    Decalare a vairable of type sy-ucomm. Then use that variable for your operation as shown below.

    DATA : ok_code TYPE sy-ucomm.

    Initially when you want to clear the ok_code, then use the below code.

    CLEAR ok_code.

    Hope this helps you.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 30, 2013 at 08:33 AM

    'Here when I press Enter on any input field, the value of sy-ucomm comes as 'ONLI', whereas its expected to be blank'

    this assumption is incorrect. Enter is the green tick in the gui status under Function Keys.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 30, 2013 at 08:37 AM

    Hi Rohit Bansal ,

    Problem here is u need sy-ucomm to be cleared but its not happening on enter event .

    Enter event dont have any sy-uccom value ,it wil be holding the previously given user command in this case ('ONLI ' )

    You can give any name istead of ok_code .

    You need to declare ok_code at Top Include

    data :

    ok_code type sy-ucomm .

    Instead of using sy-ucomm use OK_code and clear it just after using it .

    I hope you this that this ok_code can only be assigned to main screen not to subscreen .

    Regards ,

    Juneed Manha


    Capture4.PNG (44.1 kB)
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.