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

POPUP_TO_CONFIRM_LOSS_OF_DATA: how to remain in same screen when "NO"

Hi all,

I am using POPUP_TO_CONFIRM_LOSS_OF_DATA function module to give a pop-up message when the data is changed in the screen.

I am triggering this POP-UP when the 'BACK' button is hit.

But I when we select 'NO' also in the Pop-up it is coming out of the screen. How to handle the answer = 'N' option? how to remain in the same screen when we select 'NO'.

Can anyone help me plz?

Regards,

Nag

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Nov 19, 2007 at 07:26 PM

    You can use like this:

          CALL FUNCTION 'POPUP_TO_CONFIRM_LOSS_OF_DATA'
               EXPORTING
                    TEXTLINE1 = TEXT-PC1
                    TEXTLINE2 = TEXT-PC2
                    TITEL     = TEXT-PC3
               IMPORTING
                    ANSWER    = LV_ANSWER.
    
          IF LV_ANSWER = 'N' OR LV_ANSWER = 'A'.
            STOP.
          else.
    *       process of loosing       
          ENDIF.

    Regards,

    Naimesh Patel

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 20, 2007 at 09:54 AM

    What is the code following your call to the function module?... the logic will not normally exit the screen flow unless you tell it to, so set a break-point after the call and watch where it goes next.

    Jonathan

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      It should not leave the screen unless you tell it to... check the PF-STATUS you are using and what is defined for the "BACK" button - does it have a special function type, or is it blank or "E"... if it has "E" then that should cause the flow logic to head into your "Module dxxx_exit-check AT EXIT-COMMAND" in PAI where you may have implemented your popup, yes? And unless you "leave screen", "set screen" etc etc, or call some other code then your logic should just follow through the subsequent PAI modules. So what happened when you put a break-point in -> where do you see it exiting your logic?

      Jonathan

  • author's profile photo Former Member
    Former Member
    Posted on Nov 30, 2007 at 08:48 AM

    &----


    *& Module exit INPUT

    &----


    • text

    ----


    *

    *on selecting the cancel button

    module exit input.

    case ok_code2.

    when 'CANCEL'.

    data answer type c.

    set hold data on.

    • if sy-datar eq 'X'.

    call function 'POPUP_TO_CONFIRM'

    exporting

    text_question = 'Would you like to save the data?'(a02)

    importing

    answer = answer

    exceptions

    text_not_found = 1

    others = 2.

    case answer.

    when '1'.

    perform save.

    when '2'.

    message 'SUCCESS: EXITING...SUCCESSFUL' type 'S'.

    leave program.

    when 'A'.

    set screen 200.

    endcase.

    set hold data off.

    • else.

    • leave program.

    • endif.

    *on selecting the exit button

    when 'EXIT'.

    leave program.

    endcase.

    endmodule. " exit INPUT

    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.