Application Development 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: 

smartform - problem with main window

Former Member
0 Kudos

Hi all,

I have following windows in my smartform first page.

First Page

-> secondary window 1

-> secondary window 2

-> main window

1 template1

2 template2

3 command node

-> secondary window 3

I have the same windows in my next page. I am using the command node in main window for some specific condition to implement page break to next page. I am getting the next page with all the contents from the secondary windows but for some reason the main window in second page is not diplayed.

Please help me. Waiting....

1 ACCEPTED SOLUTION

Former Member
0 Kudos

I think your problem is that your main window is done when it gets to the command node. Do you have a loop in Main? If so, the command node needs to be inside the loop (if I understand your problem).

15 REPLIES 15

Former Member
0 Kudos

I think your problem is that your main window is done when it gets to the command node. Do you have a loop in Main? If so, the command node needs to be inside the loop (if I understand your problem).

0 Kudos

Hi,

Thanks for the reply.

You are correct the main window contents are done when it reaches the command node. But my requirement is:

I am using the templates in main window to print about 13 columns. If I have data in more than 13 columns I have to print that data in main window of next page. So for this I used a command node at the end of the main window and said if the data is in more than 13 columns go to next page. I am getting all the contents from secondary windows in the next page except main window. Nothing in the main window is printed in the next page.

Can you please tell me what am I doing wrong here.

Thanks

0 Kudos

If you mean more than 13 rows, then you don't need the command node. If the main window overflows it will go to the next page specified in the Page's 'Next Page' field in the output options.

0 Kudos

Hi,

I know that if it is rows the data flows to next page.

But I mean 13 COLUMNS. Right now I am printing only 13 columns in my main window. If I have data in more than 13 columns, I want to go to next page.

PLease help.

0 Kudos

I'm not sure I understand. But if you want to print columns 14, 15, etc. on page 2, then I think you will need another template after the command node to print these columns.

Or am I not understanding your problem?

0 Kudos

Hi Matt,

Let me explain.

In main window, I am printing 13 columns. For column headings I am using a template. After the template I am using a loop node which prints the data from 13 columns of an internal table in the 13 columns in main window. Now if I have data in more than 13 columns of the internal table, I want to print the data from the 14th column of the internal table on next page.

So for this purpose I placed a command node after the loop node and at the end of the main window and said if the data is in more than 13 columns go to next page. I dont see any contents from the main window on the next page.

PLease let me know if it is still not clear. Waiting for help...........

0 Kudos

I'm not sure I'm understanding the issue still.

But, I think you need to add another template after the command node. This template will have the column headings for column 14 on. Then you will need to loop again and print the data for column 14.

0 Kudos

Hi Raju,

In the first place how are you determining that there is data in a coloum that is after 13th column.

How many rows your internal table contains? Do you really think that this is possible if your internal table is going to have any(n) number of rows(not columns).

We can do it, that too with dumb hard coding of number of rows that are going to be printed in a single page, if your rows in the internal table are fixed.

Thanks and Regards,

Bharat Kumar Reddy.V

Message was edited by: Bharat Reddy V

0 Kudos

Hi Matt,

Let me ask one thing.

Let us say I have an internal table with 26 columns. I want the data from 1 to 13 columns to be printed on the first page and the data from 14 to 26 columns printed on next page. How can I do this.

0 Kudos

Well, let me ask you how you want to handle the possible overflow of main. If you have 5 rows in your table with 26 columns, and main overflows after row 3; page 1 would have rows 1,2,3 with columns 1-13. Would page 2 have rows 1,2,3 with columns 14-26, or would page 2 have rows 4,5 with columns 1-13? Do you see what I'm getting at?

0 Kudos

Hi Matt,

I understand what exactly you are asking. Even I am not sure at this point. What I can do if the main overflows. Do you have any possible solution for this problem. Like taking care of overflow of rows and columns at the same time. Is it really possibile to do this?

PLease help. waiting...............

0 Kudos

At this point I would go ahead and keep what you have. Then after the command node you should add a template for columns 14,15, etc. headers and loop to fill columns 14, 15 etc. data.

If you have to account for overflow of main, then you will have to come up with some counters etc. and some complicated logic to handle this.

0 Kudos

Hi Raju,

One possible solution can be... first fix number of rows in a page. Then in the INITILIZATION use DESCRIBE command on your internal table. Then divide the number of lines by the number of line you have already fixed to be printed on a page. This will give the number of pages.

Now what you can do is... in your first page take a table node. In that create a table line with 13 columns and place the first 13 columns in that.

Then take a ALTERNATIVE node with condition sy-page = the number of pages which you have already calculated.

For this ALTERNATIVE node in the TRUE node take a COMMAND NODE with NEXT_PAGE(second page) in GO-TO-NEW-PAGE field.

And in the FALSE node take another COMMAND NODE with FIRST_PAGE(current page) in the GO-TO-NEW-PAGE field.

Untill unless you will reach the last page(which we have calculated) this condition will become false and hence the COMMAND NODE in the FALSE node will trigger and the current page will be triggered. This completes the printing of 13 columns for all your internal table rows.

Now in the NEXT_PAGE(second page) take another TABLE node and again create a new table line with the next 13 columns(14 to 26). And assign NEXT_PAGE in the Next Page field of this page(next page... hope you are not confused ). This will print the remaininig 13 lines.

But the problem with this solution is that the user has to sort the pages after getting the printouts and also the number of rows that will be printed are fixed on a page.

Thanks and Regards,

Bharat Kumar Reddy.V

0 Kudos

Hi Matt,

Thanks for trying to help me out. One final question is

The internal table sometimes has data only till 13 columns and sometimes in more than 13 columns. So my requirement is only if the data is in more than 13 columns go for next page.

Right now I am printing the column headings and data for the first 13 columns using the template and loop nodes in main. What should I do now. As you said if I use the command node and use the template and loop nodes for the headings and the data for columns 14 and more, what happens if the data is only till 13 columns.

PLease clarify.

0 Kudos

The second template and loop should have the same conditions as the command node. You can do this individually in each node, or you can place all of them in a folder that has the conditions, or you could use an alternative node with the conditions and place all the nodes under True and put nothing under false.