cancel
Showing results for 
Search instead for 
Did you mean: 

New page command

Former Member
0 Kudos

Hi Experts,

I have the following problem :

I have an sapscript form with first page and next page.

On each page i have 2 windows : Main and Total.The total window is INSIDE the main window.

I need to print an invoice with the conditions :

- subtotal has to be on a fixed place.

- The invoice rows can get on the whole page.

If the invoice contains many rows how to get the subtotal windows printed on a new page?

I tried iside the element of the total window to use the new-page with a condition ( if &page& <> &wa_footer_page&. new-page endif )

but it doent't work.

The problem is when the invoice rows can be printed on 1 page but the last rows are inside the total windows.

Thanks

Accepted Solutions (0)

Answers (7)

Answers (7)

srinivasa_maruvada
Active Contributor
0 Kudos

Hi,

see the third option in that and declare a variable in the driver program like data n type i.

then declare like sum and write that in an & &. it men amperson.

bye .

Former Member
0 Kudos

Hi Moo,

Include the subtotal text in BOTTOM ..ENDBOTTOM command in the main window.

Regards,

Sravanthi

Former Member
0 Kudos

hi,

if u want 'subtotal has to be on a fixed place' at a fixed place u can define the window in a fixed position.

(after the main window).Don't put subtotal window in a Main window.

Other wise u can have a "LAST(Element)" in Main window.In that u can specify u r subtotal value. Then u can get u r subtotal value after the line items.

Eg:

/E LAST

&sub&------Sub total value.

Former Member
0 Kudos

As per my understanding, you have main window and total window on first and next page.

And you want to display the total in total window. But as invoice rows occupying more sapce ,your total is not getting diaplyed.

Now, do one thing, After main window ,crete a total window on first page and also on next page.

In total window code , write the very first statement as follows :

If &nextpage& = 0.

your code to calculate the total

endif.

Purpose of creting the total window on first page is ,if data in main window is very less then in that case total should get display on first page itself.

Or if you want to trigger the last page,then at the end of main window, write the code as follows:

/E : last_page

/: new-page last

In above code 'last' is a page name which you give to your last page. that can be anything.

Then in the diver program call the WRITE_FORM to call that element.

Regards,

Anuja

Former Member
0 Kudos

Sorry avinash i didnt understand your answer.

In the driver abap program i have the following code.

Loop at it_items assigning wa_item.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'ITEM_LINE'.

endloop.

wa_footer_page = xxx (let's say 2)

so far so good.

and now i want to print the total of the invoice within a frame.

so i have 2 elements on the total window : /e BOX and total.

now i need to print the elements BOX and total on page 2 (wa_footer_page).

so i tried the condition inside the BOX element :

if &page& < &wa_footer_page(C)&.

/E new-page

endif.

This doenst work .. so that is my problem ..maybe you have better suggestion.

Thanks in advance

Former Member
0 Kudos

Create the new text element for the Total display and Call the text element from the driver program after complete display of condition records.

I created the element total on the total window.

In the driver program i count the rows of an invoice, and stop the result on wa_footer_page.

But the condition &page& < &wa_footer_page& doenst worl on the driver program beiacause &page& is a variable of the sapscript

Former Member
0 Kudos

Hi,

To display the condtion data in the main window...you should be calling the Write_form for main window in the loop of the condition data table in driverprogram.

After complete display of the item condidtion again call the Write_Form Fm with variable window whoch you have used to display total.

Former Member
0 Kudos

Hi,

Create the new text element for the Total display and Call the text element from the driver program after complete display of condition records.