Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Print text in two main windows

Former Member
0 Kudos

For printing label have created two main windows on a page. calling function write_form In ABAP Program under do loop for two times.

but program prints only one window. why is it so? how can i print text on two windows.

do 2 times.

COUNT = COUNT + 1.

loop at itab WHERE DEPTT LT 200.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'TEST'

FUNCTION = 'SET'

TYPE = 'BODY'

  • WINDOW = 'MAIN'

EXCEPTIONS

ELEMENT = 1

FUNCTION = 2

TYPE = 3

UNOPENED = 4

UNSTARTED = 5

WINDOW = 6

OTHERS = 7.

endloop.

enddo.

Please guide.

4 REPLIES 4

Former Member
0 Kudos

Hi,

Have two page windows in your SAPscript. For example :

WINDOW1 Left 0.00 cm Upper 2.00 cm Width 15cm Height 5 cm

WINDOW2 Left 15.00cm Upper 2.00 cm Width 15cm Height 5 cm

Have the same elements output in each of the windows.

For each label you want, call WINDOW1 & WINDOW2

Hope this helps.

Cheers

Colin

0 Kudos

still not clear. by two page windows u mean main windows or variable ones.

0 Kudos

Since the information is variable and coming out of the print program, I can assume you want to print many labels but two to a page. Also, any page numbering, etc will need to be updated. This is easily accomplished with SAPScript but a feature people rarely use I believe. Here are the simple steps:

1) On the Windows Screen: Creat a main window for the size of the label, etc knowing that you will be putting multiple windows on a page. For example, if page size is 8.5 x 11, maybe your window size is 6 X 4 or something similar. You only need one main window defined.

2) Now go to Page Windows Screen. Add a window MAIN and down at the bottom where it says Window Type put in MAIN. Next to this field is a little field about two characters long. In here put in '01'.

3) Now Add another window MAIN and down at the bottom put in '02'.

Hopefully this gives you the idea. I've done this with up to 30 small windows in order to print variable window for labels on label stock such as Avery 8167, etc.

Good Luck!

Tim Stadler

Menasha Corporation

0 Kudos

Tim, Thanks for your detailed reply. I can actually got as many main windows as i want on a page using label option under create window. Using this i have created two windows which are main & main 01 on a page. Can see the preview in graphical mode, two windows with same text are

there.

Problem i'm facing in ABAP program. how to call this sapscript. do i have to call write_form two times by mentioning rspective windows names. Or have to call it in a do loop on no. of windows. Not getting success by any method. whenever i execute program i get only one label.

thanks