Skip to Content
avatar image
Former Member

How we can create more than one 'MAIN' window in script.

I came to know that we can create 99 main windows in script.

When I tried to create another window of window type as ‘MAIN’. I am getting an error. Can any body tell how to create 99 main windows in scripts?

How we can create a script with out a main window ?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Feb 20, 2007 at 02:06 PM

    Hi!

    Nope, in a SAPScript there's one and only one MAIN window! And this window is obligatory!

    This is because this window controls the data flow, this window handles the automatic new pages and so on...

    But you can create VAR type windows as many as you want.

    Of course you can make some tricks, for example you are printing only a SPACE in your MAIN window, reuduce its size to 1 mm * 1 mm and you handle the new pages manually...

    Regards

    Tamá

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 20, 2007 at 02:07 PM

    No u can not create a SCRIPT without a main window but thisis possible with SMARTFORMS.

    Difference with SMARTFORMS vs. SapScript(SE71)

    The Following are the differences :-

    a) Multiple page formats are possible in smartforms which is not the case in SAPScripts

    b) It is possible to have a smartform without a main window .

    c) Labels cannot be created in smartforms.

    d) Routines can be written in smartforms tool.

    e) Smartforms generates a function module when activated.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 20, 2007 at 02:15 PM

    Hi,

    Only one main window can be defined in the SAP Script whereas upto 100 instances of main window can be created in a page.

    Regards

    Sudheer

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 20, 2007 at 02:16 PM

    You are correct that we can create up to 99 instances of the MAIN window.

    When creating a Main window in Page Windows notice the number after the 'Window Type'. Here you will need to give the number of your instance.

    What error are you getting?

    I think I know what your problem is.

    You are trying to create multiple MAIN's under the 'Window' option. This is not allowed.

    As stated previously, you can have multiple instances of the MAIN window under the 'Page Windows' option.

    Message was edited by:

    Matt Nagel

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      I have used multiple Main windows to print labels.

      The label paper has two labels per page, so I have two Main windows in my Sapscript.

      The Main windows are the same (you can have only one Main window, but can have multiple instances of it on a page). They have the same text elements etc. But there are two instances on the page.

      In the print program you switch between the Main windows like this:

        call function 'CONTROL_FORM'
             EXPORTING
                  command   = 'NEW-WINDOW'
             EXCEPTIONS
                  unopened  = 01
                  unstarted = 02.

      I'm not sure exactly what you are asking for, but hopefully this helps.