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: 

Pop-up message only upon report execution

former_member367551
Participant
0 Kudos

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?

4 REPLIES 4

former_member184578
Active Contributor
0 Kudos

Hi.,

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

hope it may help u.,

Thanks & Regards

Kiran

0 Kudos

Dear Kiran,

Problem:

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

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

3. 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).

4. 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.

5. 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?

The problem with SY-UCOMM = 'ONLI' - this is true even in scenario 5 above. So, I still won't be able to better control the pop-up message too.

0 Kudos

Hi.,

I think that still SSCRFIELDS-UCOMM holds that value., so clear SSCRFIELDS-UCOMM after popup message.

or

data ok_code type sy-ucomm.

ok_code = sy-ucomm.

if ok_code = 'ONLI'.

processing logic..

endif.

clear ok_code.

hope this will helps u.,

Also put a breakpoint , debug and check what value it holds.,

reply if u need some more clarifications.,

Thanks & Regards

Kiran

0 Kudos

Thanks, Kiran. This was helpful.