Skip to Content
avatar image
Former Member

Calling a Screen as a Modal Dialog

Hi

I have created a 'Z' Transaction which has only one Screen which is of type 'Modal Dialog'. Whenever i run the Z Transaction, i get the screen in a full window size. Is there any way by which i can restrict this screen to a Modal Dialog. I know that we can use call Screen XX Starting at .. Ending at.. Option. But this will help me only when i have two screens.

Can anyone answer this as it is urgent !!!

Rgrds,

Murli.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

9 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 10, 2005 at 03:52 AM

    Hi Rich Heilman

    I had even tried that also. The problem is a Modal window appears above an empty window. But thanks anyway.

    When i call this transaction from a BADI, it throws the user from the standard transaction to another empty screen which has a Dialog Window also. So this would not meet my requirements.

    Rgrds

    Murli

    Add comment
    10|10000 characters needed characters exceeded

    • Here is an example of what I'm talking about. Here we have a small program with a selection screen. When you hit enter, it will call the function module which has the CALL SCREEN...Starting...Ending statement. This will thru the dialog box in front of the selection-screen. I believe that this is the functionality that you required.

      The program code......

      
      
      report zrich_0003.
      
      data:  br_itab type table of zbrbin with header line.
      
      parameters: p_check.
      
      at selection-screen.
      
        call function 'Z_BIN_LOC'
             tables
                  br_itab = br_itab.
      
      

      The function module....

      
      FUNCTION Z_BIN_LOC.
      *"----------------------------------------------------------------------
      *"*"Local interface:
      *"  TABLES
      *"      BR_ITAB STRUCTURE  ZBRBIN
      *"----------------------------------------------------------------------
      
        CLEAR: ITAB. REFRESH: ITAB.
        CLEAR: OK_CODE, SAVE_OK.
      
      *Loop thru parameter table and fill up screen.
        LOOP AT BR_ITAB.
      
      * Entry already exists........get bin location.
          SELECT SINGLE * FROM ZBRBIN
               WHERE VBELN = BR_ITAB-VBELN.
          IF SY-SUBRC <> 0.
            CLEAR ZBRBIN-BIN.
          ENDIF.
      
          ITAB-KDAUF = BR_ITAB-VBELN.
          ITAB-BIN = ZBRBIN-BIN.
          APPEND ITAB.
        ENDLOOP.
      
        REFRESH CONTROL 'ITABCON' FROM SCREEN '0100'.
      
      * call entry screen.
        CALL SCREEN 100 STARTING AT 10 5
                        ENDING AT 85 16.
      
      ENDFUNCTION.
      
      

      Regards,

      Rich Heilman

  • avatar image
    Former Member
    Aug 09, 2005 at 02:51 PM

    I also would like to make a note that you cannot issue a Call Screen from a BADI.

    Add comment
    10|10000 characters needed characters exceeded

    • First, let me say that I would definitly suggest doing this via a function module. But if you really want to do it with a module pool program, then here is a solution. You need to have a dummy screen. In this example it is 100. Call this screen from your tcode. In the PBO of that screen, call the modal dialog box screen, here it is 500. Make sure that you leave program in the PAI 500

      
      program sapmztest .
      
      data: ok_code type sy-ucomm.
      
      *&---------------------------------------------------------------------*
      *&      Module  STATUS_0100  OUTPUT
      *&---------------------------------------------------------------------*
      module status_0100 output.
      *  SET PF-STATUS 'xxxxxxxx'.
      *  SET TITLEBAR 'xxx'.
      
        call screen 0500 starting at 10 50
                    ending   at 80 80.
      
      endmodule.
      *&---------------------------------------------------------------------*
      *&      Module  USER_COMMAND_0100  INPUT
      *&---------------------------------------------------------------------*
      module user_command_0100 input.
      
      endmodule.
      *&---------------------------------------------------------------------*
      *&      Module  STATUS_0500  OUTPUT
      *&---------------------------------------------------------------------*
      module status_0500 output.
      *  SET PF-STATUS 'xxxxxxxx'.
      *  SET TITLEBAR 'xxx'.
      
      endmodule.
      *&---------------------------------------------------------------------*
      *&      Module  USER_COMMAND_0500  INPUT
      *&---------------------------------------------------------------------*
      module user_command_0500 input.
      
        leave program.
      
      endmodule.
      
      

      Regards,

      Rich Heilman

      Message was edited by: Rich Heilman

  • avatar image
    Former Member
    Aug 09, 2005 at 02:14 PM

    Hi,

    You can configure the screen size from the "Other attributes" - Lines/Columns parameters or using the graphical screen painter to limit the screen size.

    If your screen is defined as modal dialog box, you call it with:

    CALL SCREEN STARTING AT <top left>

    ENDING AT <bottom right>.

    If you don't want to use the addition "ENDING AT", define your screen as normal and call it with CALL SCREEN STARTING AT <top left>.

    Svetlin

    Message was edited by: Svetlin Rusev

    Add comment
    10|10000 characters needed characters exceeded

    • You can call the popup screen when the screen is defined as a modal dialog box and also is called by using the

      CALL SCREEN STARTING AT
                  ENDING AT

      I don't have any background about your program, so I can't offer a perfect solution yet.

      What kind of program is it, dialog, report?

      Regards,

      Rich Heilman

  • avatar image
    Former Member
    Aug 09, 2005 at 02:21 PM

    Hi

    I tried giving values in Line/Column and also reduced the size of the screen in the Graphical painter. Its still giving a Full screen when i run the transaction.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 09, 2005 at 02:33 PM

    Hi

    I am just writing a Test Module Pool program that has only one screen( which i have marked as Modal Dialog Box in its properties). I have attached this screen to a Tcode. Now when i run this Tcode, all that i need is a small dialog window and not a full size window. I have set other screen properties like the Line/Cloumn and also tried reducing the screen size in the Graphical painter. If i had two screens in my Module pool, i can call the screen using Call Screen XX Starting At .. Ending At.. But all i have is just only one screen. So i cannot call this screen using any ABAP code.

    Later,I will be using this Modal window from a BADI, using call Transaction.

    I hope you got a clear picture now !!!

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 09, 2005 at 02:42 PM

    I am not sure if it is possible to do it that way. What I would suggest is to implement your transaction logic as a function module and use the syntax CALL SCREEN within that logic(see all POP-UP function modules for clues). This way you need only one screen and in your BADI you can do a CALL FUNCTION instead of a CALL TRANSACTION.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 09, 2005 at 02:47 PM

    Yeah i do agree with the fact that a CALL FUNCTION is much simpler than CALL TRANSACTION, and this is how i have been doing it (G_POPUP_FOR_ENTERING_VALUES). But now all of a sudden lot of validations are to be done on the Text Field in the Popup.

    So i have dropped the idea to use a FM to issue a Popup and instead trying to make a Popup using CALL TRANSACTION. Thats why i am trying for a Modal Dialog screen in that transaction.

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 09, 2005 at 04:13 PM

    Hi,

    Create any Screen in SE51 and in the Attributes tab, say it is a Modal Dialog Type.

    I hope this will work.

    Thanks

    kumar

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 11, 2005 at 07:27 AM

    Hi Rich Heilman

    Thanks a lot. I have got it and u have been rewared.

    Add comment
    10|10000 characters needed characters exceeded