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

Use Enter key to execute report.

I have a report that needs to be executed in background.It has a selection screen.The program should get executed when user presses 'ENTER' while he is inside the selection screen.At present,when 'ENTER' key is pressed,only validation is done.To execute we are either pressing 'F8' key or click execute button in screen.

Now how to trap the 'ENTER' key press in a report?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 23, 2004 at 08:39 AM

    Hi Jayaprakash,

    All PAI processing will depend on the Function Code that has been triggered at the selection screen.

    The ENTER key has no function code, whereas the "Execute" button has the function code 'ONLI'. SO what can be done is, when the user hits the ENTER key, we can programmatically set the function code to 'ONLI'. I shall give you a very small peice of code to illustrate my point.

    ===================================

    tables sscrfields.

    parameters p_vblen like vbak-vbeln obligatory.

    at selection-screen.

    if sscrfields-ucomm eq space.

    sscrfields-ucomm = 'ONLI'.

    endif.

    start-of-selection.

    write p_vblen.

    ===================================

    The above code will trigger the report output on hitting the ENTER key at the selection screen.

    What you only have to note here is that unlike with screen processing, in selection-screen processing, the function code will be made available in the field UCOMM of the structure SSCRFIELDS. However, you will have to declare this structure in your program ( using the TABLES statement as shown above ).

    Hope the explanation has been clear enough to drive the point home for you. Please get back to me otherwise.

    Regards,

    Anand Mandalika.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 23, 2004 at 07:46 AM

    To my knowledge, only F8, CtrlP, F3, ShiftF3, and F12 leave selection-screen processing (i.e. the AT SELECTION-SCREEN event sequence).

    But check out the following:

    <b>REPORT <...>

    PARAMETERS p1.

    AT SELECTION-SCREEN.

    IF sy-calld = ' '.

    SUBMIT <...> WITH p1 = p1.

    ENDIF.

    START-OF-SELECTION.

    BREAK-POINT.</b>

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 23, 2004 at 09:08 AM

    The solution given by Anand Mandalika is working fine.

    Thanks for all who helped me.

    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.