I need to put two MAIN windows functionality on one page of the printout in Smartforms.
It is possible that in one table there will be many lines which should spread to many pages, and it is possible that second table will have also many lines which should spread to many pages. Which table has more lines, the bigger the printout in pages in this table would be.
Is that possible to be done? I defined two main windows with the same window width, but only second main window is filled with data.
You can define 2 tables in the same main window. So what is the necessity of having other main window.
if your requirement is to print the data available in the 2 tables (one after the other) then it is possible.
Just declare both the tables and your problem is resolved.
what you need to do is to give the internal table loop in the data tab of the table with the first internal table and the other internal table in the second table. it will automatically print the data of the first table and then go for the second one,
1. Just create 2 TABLE under MAIN WINDOW and pass the header ,main area and footer details to it.
2. copy the main window to your SECOND page. Incease the size of the main window in SECOND
page as per your requirement.
3. Under FIrst page "General attribute" assign next page as SECOND page. and for SECOND page
keep the next page as SECOND page.
Hope this solves your problem. In case of any problem please revert back.
Two tables cannot occur one by another. They have to be printed at the same pages.:
Build the table itab3 which contains all the fields from two table (itab1 and itab2). Now use these table in the smartform Main window to print as per your requirement.
DO. CLEAR L_COUNT. READ TABLE ITAB1 INDEX SY-INDEX. IF SY-SUBRC NE 0. L_COUNT = L_COUNT + 1. ENDIF. READ TABLE ITAB2 INDEX SY-INDEX. IF SY-SUBRC NE 0. L_COUNT = L_COUNT + 1. ENDIF. IF L_COUNT EQ 2. EXIT. ENDIF. " APPEND data to itab3 ENDDO.
Create a third internal table Itab3 and add one more flag variable in itab3 and do the following changes in itab3.
a) Add five(This number depends on your requirement ) records of itab1 into itab3 and at fifth record keep the value of flag variable to 'X'.
b) After adding the first five records from itab1 proceed the same procedure with Itab2 and add the five records of itab2 at the fifth record of itab2 keep the value of flag variable to 'X'.
Then in the smartform do the following change.
a) Loop at the internal table itab3.
b) Create one more table line for empty space and give that one after printing the line item data.
c) There in the newly created table line give the condition as Flag = 'X'.
Then activate the smartform and run it.
Hope this dicussion will help you.