Skip to Content
avatar image
Former Member

Jump Between Main Windows

Hi,

I have three mainwindows(M1,M2,M3) in sap script.

All the three windows should be in single page and sapscript has only one page.

I need to print some text in M1 and need skip M2 and print some text in M3. and based on some values i need to skip M1 those should be printed on M2 only.

Basically how can we control text to print on required mainwindow only .

Regards,

Rams

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Jul 29, 2008 at 03:34 AM

    HI

    You can use the NEW-WINDOW command to call the next main window explicitly, even if the current main window is not yet full. If you are in the last main window of the page, the command has the same effect as the NEW-PAGE command.

    Syntax:

    /: NEW-WINDOW

    Regards

    Pavan

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 29, 2008 at 04:19 AM

    Hi Rams,

    You can make use of the control command new-window. it moves to next main window.... if it is the last window in the page then new-window works as new-page.

    Regarding skipping of the window.. i have an idea but didnt work on it...

    in the text element place if condition before display

    if <condition>

    new-window.

    else

    <display data>

    new-window.

    endif

    regards

    padma

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 29, 2008 at 05:47 AM

    Hi,

    Try to use three different text elements for three main windows. and then call write form basing on conditions according to your requirements in your driver program with corresponding text elements.

    Hope this will give you some idea,

    Regards,

    Aswini.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 29, 2008 at 06:20 AM

    you just create different text elements in windows and use the function module write_form to control the display...

    for eg

    if condition 1.

    CALL FUNCTION 'WRITE_FORM'

    • EXPORTING

    • ELEMENT = TE1

    • FUNCTION = 'SET'

    • TYPE = 'BODY'

    • WINDOW = 'MAIN1'

    • IMPORTING

    • PENDING_LINES =

    • EXCEPTIONS

    • ELEMENT = 1

    • FUNCTION = 2

    • TYPE = 3

    • UNOPENED = 4

    • UNSTARTED = 5

    • WINDOW = 6

    • BAD_PAGEFORMAT_FOR_PRINT = 7

    • SPOOL_ERROR = 8

    • OTHERS = 9

    .

    ELSE.

    CALL FUNCTION 'WRITE_FORM'

    • EXPORTING

    • ELEMENT = TE2

    • FUNCTION = 'SET'

    • TYPE = 'BODY'

    • WINDOW = 'MAIN2'

    • IMPORTING

    • PENDING_LINES =

    • EXCEPTIONS

    • ELEMENT = 1

    • FUNCTION = 2

    • TYPE = 3

    • UNOPENED = 4

    • UNSTARTED = 5

    • WINDOW = 6

    • BAD_PAGEFORMAT_FOR_PRINT = 7

    • SPOOL_ERROR = 8

    • OTHERS = 9

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 29, 2008 at 07:57 AM

    Hi,

    Use control command NEW-WINDOW FOR jumping between mainwindows.

    Thanks,

    Phani Diwakar.

    Add comment
    10|10000 characters needed characters exceeded