Skip to Content

Pop-up message only upon report execution

Dear forumers,

I will need to generate a pop-up message for a report with the following requirements:-

- If a combination of certain selection-screen elements are NOT filled up at the selection screen, generate pop-up message with two buttons, CONTINUE and CANCEL.

- This pop-up message should only be generated upon executing the report / via F8 key.

- The pop-up message must be displayed with the selection-screen still in the background.

- If the user clicks on CANCEL, the report will not be executed and the selection screen should be shown with all of its values intact as before.

- If the user clicks on CONTINUE, the report will be executed, eventually displaying an ALV output.

To achieve this, I used the function module, POPUP_TO_CONFIRM in the event, AT SELECTION-SCREEN but with the condition, SSCRFIELDS-UCOMM = 'ONLI'.

AT SELECTION-SCREEN.

  IF SSCRFIELDS-UCOMM = 'ONLI'.
    IF   R_MATNR IS INITIAL  AND
       ( R_AUFNR  IS INITIAL AND R_AUART  IS INITIAL AND
         P_SELID  IS INITIAL AND R_OBJNR  IS INITIAL AND
         R_OUTDEL IS INITIAL AND R_QMNUM  IS INITIAL AND
         P_NTWK_L IS INITIAL AND P_ACTV_L IS INITIAL AND
         P_NTWK_H IS INITIAL AND P_ACTV_H IS INITIAL AND
         P_REVNR  IS INITIAL AND R_POSTP  IS INITIAL AND
         R_COSTC  IS INITIAL ).
      CLEAR LV_ANSWER.

*     display pop-up message
      CALL FUNCTION 'POPUP_TO_CONFIRM'
        EXPORTING
          TITLEBAR              = TEXT-095
          TEXT_QUESTION         = TEXT-096     " Performance-related text message
          TEXT_BUTTON_1         = TEXT-097     " CONTINUE
          TEXT_BUTTON_2         = TEXT-098     " CANCEL
          DEFAULT_BUTTON        = '2'
          DISPLAY_CANCEL_BUTTON = ' '
          IV_QUICKINFO_BUTTON_1 = TEXT-099
          IV_QUICKINFO_BUTTON_2 = TEXT-098
        IMPORTING
          ANSWER                = LV_ANSWER
        EXCEPTIONS
          TEXT_NOT_FOUND        = 1
          OTHERS                = 2.

*     check return code
      IF SY-SUBRC = 0.
        IF LV_ANSWER <> '1'.
          LEAVE SCREEN.
        ENDIF.
      ENDIF.
    ENDIF.
  ENDIF.

Problem:

- A user runs the report for the first time, displaying the selection screen.

- He hits the 'Enter' key at any of the selection screen elements - nothing happens, no pop-up message appears.

- Once he hits the 'F8' key / executes the report and if a combination of certain selection-screen elements are NOT filled up at the selection screen, the pop-up message appears (with the selection screen in the background).

- If he chooses the CANCEL option, the report will not be executed and the selection screen is shown again with its values intact as before.

- But from this point onwards, whenever he hits the 'Enter' key at any of the selection screen elements again, the same pop-up message appears - it should only appear upon the 'F8' key / report execution only. How can I better control this?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on May 03, 2011 at 10:14 AM

    Hi.,

    Instead of SSCRFIELDS-UCOMM = 'ONLI' try using if sy-ucomm = 'ONLI' ...

    hope it may help u.,

    Thanks & Regards

    Kiran

    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.