cancel
Showing results for 
Search instead for 
Did you mean: 

Printing Two tables on one page

Former Member
0 Kudos

Hi ,

I have a requirement of printing two tables having different structures in main window. One table is on left side of form and another on right side .

Any of these two tables can go to next page means tables are floating in nature.

Please help me out in this situation.Example layout Looks like as below

Left align right align

VAT Rate Value Excl VAT VAT Sub-total Delivery Donation

xxxxx xxxxx xxxxx xxxxx xxxx xxxx

xxxxx xxxxx xxxxx xxxxx xxxx xxxx

xxxxx xxxxx xxxxx xxxxx xxxx xxxx

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I believe this is a typical requirement.

Try this ...

Loop the two tables one under the other with appropriate linetypes and the total width of the tables as desired and without connecting the two tables with any condition ( i believe ) .

Then print the tables fields accordingly first with the row of the left table then append directly with the row of the right table.

Else...

Define a single table with the desired linetypes accomodating the rows of the two tables.

Then use loops to loop the two internal tables into their respective structure types and display the row1 of the left table and then the row1 of the right table with the desired linetype.

Hope this is clear...

Regards,

Ram

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

I think this solution might work.

Say tables are itab_left and itab_right. Find out which table has greater number of records by DESCRIBE TABLE statment. Then loop at that table. Say here itab_right has greater number of records.

Loop at itab_right into gv_right.

lv_index = sy-tabix.

read table itab_left into gv_left index lv_index.

call function 'WRITE_FORM'

****

****

endloop

Now in the Sapscript it would be written as:

&gv_left-tax&,,&gv_left-GST&,,,,,,&gv_right-tax&,, and so on..

Please reward if useful.

thanks

MV