Application Development and Automation 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: 
Read only

multiple main windows in sapscript

Former Member
0 Likes
2,340

Hi All,

How to use multiple main windows in SAP Scritp?

Thx,

Sofia

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,298

Hi,

create main window in windows.

in page windows goto->create element then select main window.

like that we can use.

we can't create multiple main windows.only we can reuse the main window from 00 to 99 times.

regards,

bharat.

7 REPLIES 7
Read only

Former Member
0 Likes
1,298

Hi Sofia,

You can have multiple Main window using the Element Line i.e Main 00,Main 01 where 00,01 are the element line

MAIN - A layout set can have only one MAIN window which is created by default. This window can flow over multiple pages.

But all the main window contains the same structure either you have to use Elements or create a new window

Regards,

Priyanka.

Read only

Former Member
0 Likes
1,298

hi sofia

u can hav only one main window on a single page.u can create one more window only in d next page..if u hav further doubts get bac to me

with regards

vijay

Read only

Former Member
0 Likes
1,299

Hi,

create main window in windows.

in page windows goto->create element then select main window.

like that we can use.

we can't create multiple main windows.only we can reuse the main window from 00 to 99 times.

regards,

bharat.

Read only

former_member673464
Active Contributor
0 Likes
1,298

hi,

You can create mutiple main windows when we want to print address details etc.You can create 99 main windows on a script.you can use multiple windows using following code.

tables:

adrc.

*"Selection screen elements............................................

select-options:

s_adno for adrc-addrnumber. " Address number

*" Data declarations...................................................

"----


  • Work variables *

"----


data:

w_count type i, " Count

w_size type i, " Size

w_result type i, " Result

w_from type adrc-addrnumber. " From

*" Data declarations...................................................

"----


  • Data declaration of the structure to hold address data *

"----


data:

fs_adrc type adrc.

"----


  • Internal table to hold address data *

"----


data:

t_adrc like

standard table

of fs_adrc.

perform select.

perform open_form.

perform write_form.

perform close_form.

----


  • Form select *

----


  • This subroutine retrieves data from yash_programmer table *

----


  • There are no interface parameters to be passed in this subroutine *

----


form select .

select *

from adrc

into table t_adrc

where addrnumber in s_adno.

if sy-subrc ne 0.

message text-001 type 'E'.

endif. " IF SY-SUBRC NE 0

endform. " SELECT

----


  • Form open_form *

----


  • This subroutine used to call open form for form *

----


  • There are no interface parameters to be passed in this subroutine *

----


form open_form .

call function 'OPEN_FORM'

exporting

form = 'YH634_060201'

exceptions

canceled = 1

device = 2

form = 3

options = 4

unclosed = 5

mail_options = 6

archive_error = 7

invalid_fax_number = 8

more_params_needed_in_batch = 9

spool_error = 10

codepage = 11

others = 12.

if sy-subrc <> 0.

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif. " IF SY-SUBRC NE 0

endform. " OPEN_FORM

----


  • Form write_form *

----


  • This subroutine used to call write_form for form *

----


  • There are no interface parameters to be passed in this subroutine *

----


form write_form .

describe table t_adrc lines w_size.

loop at t_adrc into fs_adrc.

add 1 to w_count.

w_result = w_count mod 9.

if w_result eq 1.

w_from = fs_adrc-addrnumber.

endif. " IF W_RESULT EQ 1

call function 'WRITE_FORM'

exporting

element = 'ADDRESS'

exceptions

element = 1

function = 2

type = 3

unopened = 4

unstarted = 5

window = 6

bad_pageformat_for_print = 7

spool_error = 8

codepage = 9

others = 10.

if sy-subrc <> 0.

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif. " IF SY-SUBRC NE 0

endloop.

endform. " WRITE_FORM

----


  • Form close_form *

----


  • This subroutine used to call close_form for form *

----


  • There are no interface parameters to be passed in this subroutine *

----


form close_form .

call function 'CLOSE_FORM'

exceptions

unopened = 1

bad_pageformat_for_print = 2

send_error = 3

spool_error = 4

codepage = 5

others = 6.

if sy-subrc <> 0.

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif. " IF SY-SUBRC NE 0

endform.

regards,

veeresh

Message was edited by:

veereshbabu ponnada

Read only

Former Member
0 Likes
1,298

you select the window as a Main window. Right side of the window you get the box in the you choose that window as Main Window.

bye..

Read only

Former Member
0 Likes
1,298

hi

u can split the main window into multiple windows..

in page windows...

edit -


>mainwindow.

there give the number of windows u want to split

in number option.

give the width and height

it will split the main window into the number times.

hope this helps...

Read only

Former Member
0 Likes
1,298

Hi Sofia,

In SAP Scripts first you create one window and make it the main window, later you can create a maximum of 98 main windows which are actually replicas of the first main window.

So in total, there can be a maximum of 99 Main windows.

Hope this resolves your query.

Reward all the helpful answers.

Regards