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

Two main windows with same content

Former Member
0 Likes
2,130

Hi All

My requirement is that there has to be two main windows containing the same content. This is for a three part cheque form wherein the first two parts will look similar with the same data on all pages and the third part is the cheque.

I modified the SAP best practice cheque form by copying the main window again and named it as MAIN 01. Hence now there are two main windows (MAIN , MAIN 01) .

I added the command /:NEW-WINDOW at the end of the MAIN window , but the data is not getting displayed in MAIN 01 , the second main window.

I called using WRITE_FORM, but this did not work .

In the SAPSCRIPT debugging , I am unable to see the MAIN 01 window.

What is it that I am missing?

Please help!

Many Thanks

Bala

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,807

Hi Balambika,

You have created an instance of the <b>MAIN</b> window, literally its not two main windows its the same <b>MAIN</b> window being used at two different places. If you check the <b>MAIN</b> & <b>MAIN 01</b>. It would contain the same data.

What you can do is, create a new page with just the MAIN window in it. lets say <b>PAGE3</b>. give this command where you have given NEW-WINDOW

/: NEW-PAGE PAGE3

The control will goto the PAGE3

after this call the WRITE_FORM to write in this page.

This would definitely work. I have done this also.

Reward if helpful.

Regards,

Tushar

17 REPLIES 17
Read only

Former Member
0 Likes
1,807

Hi,

I hope you have defined the layout in Sapscript for both windows and activated the same. Then select window MAIN01 and goto editor and add the texts which are to be displayed.

Activate the script.

In the print program, using WRITE_FORM, call the MAIN01 window as well.

Best regards,

Prashant

Read only

former_member186741
Active Contributor
0 Likes
1,807

Hi Bala,

have you related the new window to each page as a page-window?

Read only

Former Member
0 Likes
1,807

I have had a similar task in the past. If you do it with two MAIN windows, you will have to modify (or create a custom version) of the print program RFFOUS_C. Do you have other changes or is the three part check the only enhancement?

You can duplicate the invoice information without modifying the print program. You can use a series of DEFINE statements to capture the data in the first MAIN window and print it in the second area. If you post an email address, I might be able to send you a copy to load with RSTXSCRP. This example prints the check on top, then the billing documents, then it repeats the billing document information.

Read only

0 Likes
1,807

could you please also send me a copy of this Sapscript. I have the same requirements for check printing. My email is freek.cavens@punchgraphix.com.

thanks in advance,

Freek

Read only

0 Likes
1,807

Hi Salter,

Can you please send me the logic & solution for the same requirement.

Thanks in advance.

Rama

Read only

0 Likes
1,807

Hi Norman!

I have the same requirement as did earlier.

I was wondering if you can help me out with that.

I have to print the same contents on two main windows on a page and on all subsequent pages.

thanks

jawad

Read only

Former Member
0 Likes
1,807

HI

GOOD

AS YOU HAVE MENTIONED IN YOUR QUERY PROPBABLY THERE IS SOME PROBLEM IN THE MAIN AND MAIN01,CHECK WHEATHER THE MAIN01 WINDOW IS CREATED OR NOT,OUT THE POSTION OF THE BOTH THE WINDOWS AND THAN GIVE THE NEW-WINDOW COMMAND IN THE IST MAIN WINDOW.

THANKS

MRUTYUN

Read only

Former Member
0 Likes
1,808

Hi Balambika,

You have created an instance of the <b>MAIN</b> window, literally its not two main windows its the same <b>MAIN</b> window being used at two different places. If you check the <b>MAIN</b> & <b>MAIN 01</b>. It would contain the same data.

What you can do is, create a new page with just the MAIN window in it. lets say <b>PAGE3</b>. give this command where you have given NEW-WINDOW

/: NEW-PAGE PAGE3

The control will goto the PAGE3

after this call the WRITE_FORM to write in this page.

This would definitely work. I have done this also.

Reward if helpful.

Regards,

Tushar

Read only

0 Likes
1,807

With two MAIN windows, you have to change the RFFOUS_C print program.

Any issues with check processing will be handled as a "consulting request" through OSS. It is now a custom program.

You will miss out on any corrections/changes made in support packages and upgrades.

SAP recommends using user exits in the ABAP program first. There are none.

The second approach is to use PERFORMs if needed in the layout set. You do not need them.

The third step is to handle custom logic in the layout set. You can do this to meet the task.

The last step is to modify/copy the ABAP program. From what I have read, you do not have to change the ABAP.

Read only

0 Likes
1,807

Hi

Thanks for the replies. This is my emailID balambika_r@yahoo.com .

It would be helpful if any sample code can be given.

Yes, this three part form is the only enhancement needed.

I have copied the RFFOUS_C and changed the subroutine SCHECK with write_form calls for MAIN01. But as mentioned earlier this is not working.

Read only

0 Likes
1,807

Hi Salter

Thanks a lot for your file. When I tested your program it works. However in my sapscript , the duplicate main window ontent are not getting displayed. When I check texts, there are quite number of syntax errors. I am in the process of resolving the same. Could this be the reason for th data not getting duplicated in the second window?

Anyway thankyou for the program. It certainly helped.

Bala

Read only

0 Likes
1,807

Hi Bala. Check your email. I just replied. Here is part of the message for the other folks...

If you are getting the UNKNOWN SYMBOL errors, that is okay. The symbols are defined in a different PAGE WINDOW than they are used. It will generate this error, but it can be ignored.

It may be the placement of the PAGE WINDOWS. The page windows with the DEFINEs have to be above the page windows where they are used.

For example, MAIN has to be above (physically higher on the page) than the ZDUP page window. CARRYFWD has to be higher than ZCARRY. TOTAL has to be higher than TOTAL2.

If you put ZDUP above MAIN, the duplicated data will be blank. SAPscript works top-down.

Read only

0 Likes
1,807

None of the PAGE WINDOWS where the data is duplicated can have text elements (/E symbols).

The print program (RFFOUS_C) will call the necessary text element sections.

In these sections, the defined ZZ* variables will be populated.

The duplicated windows should just print them out. If they are blank, nothing prints.

Read only

0 Likes
1,807

Hi Salter

I have the same problem to display the same data on 2 different main windows. Can you send me your custom file RFFOUS_C/RFFORI01 at shaq.peld@gmail.com

Read only

0 Likes
1,807

Norman,

I have a similar requirement. Any chance you could forward your code to vaguettl@silabs.com.

Thanks!

~Valerie

Read only

Former Member
1,807

All the above posts are overly complicated. I solved this problem easily years ago. I refer to this as a 2-stub check. The easiest way to do this is to have one MAIN window for stub 1 and a second "fake" MAIN window that is NOT a type MAIN for stub 2. You want to have only one type MAIN per page to control the page overflow to subsequent pages.

Pseudocode:

SAPScript Form:

-


Window MAIN (TYPE MAIN) (size & position to be 1/3 of the page)

/E 525 (text-element 525)

&field1&,,&field2&,,&field3&

Window MAIN2 (TYPE VAR - type VAR makes it a "fake" MAIN) (size & position to be 1/3 of the page)

/E 525 (text-element 525)

&field1&,,&field2&,,&field3& (same field names as MAIN-525)

Window CHECK (size & position to be 1/3 of the page)

So you could have stub-stub-check, check-stub-stub, or stub-check-stub printed out.

Print Program:

-


You will need to change the print program to do a WRITE_FORM for MAIN2-525 right after the WRITE_FORM for MAIN-525:

WRITE_FORM

element = '525'

function = 'APPEND'

window = 'MAIN'

WRITE_FORM

element = '525'

function = 'APPEND'

window = 'MAIN2'

Read only

Former Member
0 Likes
1,807

But the script is triggered from a standard program RWSNASTV. Any other alternative ?