cancel
Showing results for 
Search instead for 
Did you mean: 

Jump Between Main Windows

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

Use control command NEW-WINDOW FOR jumping between mainwindows.

Thanks,

Phani Diwakar.

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

bpawanchand
Active Contributor
0 Kudos

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