cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in Printing Multiple Invoice data

Former Member
0 Kudos

Hi,

My re quirement goes like this...

My SMARTFORM receives 2 internal tables :

1. Header data for all Invoices

2.Item data for all invoices.

Now I need to print each invoice in a new Page.

I have done like this.

First I am reading the header table with Index. After that I am incrementing the Index number.

v_index = v_index + 1.

READ TABLE HEADER index v_index.

So, first time the fist invoice will be processed and Its item data will be printed in the main window.

In the MAIN WINDOW after Item Table, i kept one COMMAND as Go TO NEW PAGE.

So, that its starts processing the page again. and Next invoice will be read.

Its working fine and Printing all the header data and footer data respective to that Invoice.

But, its not displaying that data which is there in MAIN window. Its displaying MAIN window as EMPTY.

I have seen in the debugging, when the NEW PAGE command is triggered, its processing all the secondory windows and PROGRAM LINES under that. But, it is not going into MAIN window Program Lines.

Please let me know, how can I solve My problem.

Thanks,

Sandeep

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi

I am also getting same problem like this

i have add a new clounm in DB table and achive it.

I have add flage statement 'X' in final internal table

In driver program

loop at itab

on change of Document number.

itab-flag = 'x'

modify table itab transporting flag.

endloop.

In smartform in conditon i have mentioned itab-flag = 'X' new page will be display the new doc number and it's corresponding line item

Former Member
0 Kudos

HI,

You can give a page break after every new header invoice. using a command window just assign the first value of the table to a local variable when it is passing into the loop and whenever the value changes, GOTO newpage.

Check the wiki,

[Pagebreak in smartforms|https://wiki.sdn.sap.com/wiki/display/ABAP/PageBreakin+SMARTFORMS]

Regards

Sarves