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

Information Window (Message)

Hi,

I have to display an information message if company code 3000 is chosen.

So, I have used MESSAGE-ID I000 with.......

Now, in the window, if i click on continue(tick icon) then i should get my output

which I am able to do that part.

the problem is that : if I click on cancel (cross icon) , then i should go to the selection

screen ,rather than going to the report.

Can anyone please let me know how to do this?

Thanks

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 13, 2005 at 05:38 PM

    You can also use the POPUP_TO_CONFIRM_WITH_MESSAGE function module.

    http://help.sap.com/saphelp_bw31/helpdata/en/85/dae5024bac11d1890e0000e8322f96/content.htm

    This way you can check which button the user chooses and control the flow.

    Brad

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 13, 2005 at 05:41 PM

    Hi JD,

    You cannot achieive what you are trying to achieve with

    MESSAGE I001...

    The program will only flow past this statement , no matter whatever you click on popup window.

    You should use function POPUP_TO_CONFIRM instead and analyze the parameter "ANSWER" in your program to check the user action. See the FM documentation for help.

    Cheers

    Add a comment
    10|10000 characters needed characters exceeded

    • Did you use my code as it is? I am asking because, that code will not work for 'Execute in Background'. If you need the pop-up for that as well, then you need to change it this way.

      REPORT ztest1 .
      
      TABLES: sscrfields.
      DATA: v_answer,
            v_bukrs LIKE t001-bukrs.
      
      DATA: BEGIN OF itab_bukrs OCCURS 0,
              bukrs LIKE t001-bukrs.
      DATA: END OF itab_bukrs.
      
      SELECT-OPTIONS: s_bukrs FOR v_bukrs.
      
      AT SELECTION-SCREEN.
      
        IF sscrfields-ucomm = 'ONLI' OR
           sscrfields-ucomm = 'SJOB'.
      *-- execute this code only if the user presses F8
          SELECT bukrs INTO TABLE itab_bukrs
                       FROM t001
                      WHERE bukrs IN s_bukrs.
          SORT itab_bukrs BY bukrs.
          READ TABLE itab_bukrs WITH KEY bukrs = '0103' BINARY SEARCH.
          IF sy-subrc = 0.
      *-- 3000 is used
            CALL FUNCTION 'POPUP_TO_CONFIRM_WITH_MESSAGE'
              EXPORTING
      *       DEFAULTOPTION        = 'Y'
                diagnosetext1        = 'CC = 3000 is for ABC Process'
      *       DIAGNOSETEXT2        =
      *       DIAGNOSETEXT3        = ' '
                textline1            = 'Do you wish to Continue? '
      *       TEXTLINE2            = ' '
                titel                = 'Message'
      *       START_COLUMN         = 25
      *       START_ROW            = 6
      *       CANCEL_DISPLAY       = 'X'
              IMPORTING
                answer               = v_answer .
            IF v_answer = 'J'.
      *-- Yes, leave the ucomm as it is
            ELSE.
              CLEAR sscrfields-ucomm.
            ENDIF.
          ENDIF.
        ENDIF.
      
      START-OF-SELECTION.
      
        WRITE:/ 'I started executing the program!!'.
      

  • author's profile photo Former Member
    Former Member
    Posted on Oct 13, 2005 at 06:02 PM

    Hi JD,

    rich srinivas sanjay all are correct

    try this way....

    DATA: POPUP_TXT(200).
    DATA: ANSWER(1).
    
    Start-of-selection.
    
    if pcode eq '0003'.
    
     POPUP_TXT =' Do you really want continue.'.
    
            CALL FUNCTION 'POPUP_TO_CONFIRM'
                 EXPORTING
                      TITLEBAR              = 'Save'
                      TEXT_QUESTION         = POPUP_TXT
                      TEXT_BUTTON_1         = 'Yes'
                      ICON_BUTTON_1         = 'ICON_OKAY'
                      TEXT_BUTTON_2         = 'No'
                      ICON_BUTTON_2         = 'ICON_CANCEL'
                      DEFAULT_BUTTON        = '2'
    *              DISPLAY_CANCEL_BUTTON = ' '
                      START_ROW             = 15
                 IMPORTING
                      ANSWER                = ANSWER.
    
            IF ANSWER EQ '2'.
            exit.
            endif.
    ENDIF.

    reward points for helpfull answers and close the thread if your question is solved.

    regards,

    venu.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 13, 2005 at 05:27 PM

    Here is one way....

    
    report zrich_0002 .
    
    parameters: p_check type c.
    
    
    
    start-of-selection.
    
      if p_check is initial.
        message i000(01) with 'P_CHECK is initial'.
    <b>    stop.</b>
      endif.
    
      write:/ 'Start of selection has been executed'.
    
    

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Rich Heilman

      Hi Rich,

      The code is likee this:

      parameters: pcode like t001-bukrs.

      if p_code = '3000'.

      MESSAGE ID 'DB' TYPE 'I' NUMBER '000'

      WITH 'CC = 3000 is for ABC Process'

      ENDIF.

      Now, i get a window saying " CC = 3000 is for ABC Process"

      In this window,if i click on continue then it goes to the output, which i want.

      The problem is that in this window if i click on cancel or crosss icon then it goes to the output which i dont want.

      when clicked on cancel icon in the information window ,it should go to the selection screen.

      Please let me know if you want more information.

      Thanks

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.