2014 Nov 18 2:19 PM
Hello experts,
I am using Smartforms and the requirement is to print in Main window each line item found in a delivery. I want each page to include all windows - in fact, they will have the same content - and MAIN window to include item-specific data for one item per page.
I am using Table in MAIN window and at the end I have a COMMAND where I go to NEXT page (NEXT is the next page of FIRST and NEXT is the next page of NEXT. FIRST and NEXT are exact copies of each other).
When execution is at the second page for a delivery with two items and SFSY-WINDOW is MAIN of NEXT page the program (transaction vl03n) returns error
I looked into SCN and Google in general, only related issue that may be the problem is that I need to use table with calculations tab whereas my Table has no such tab - has Events tab,
Thanks in advance for any help,
Konstantinos
2014 Nov 19 7:39 AM
Hi,
Have you already searched OSS using the message class and number? Is the main window of second page indeed the same main window as that of the first? Could you show using picture, where in the table node do you have the page break node?
cheers
Jānis
Message was edited by: Jānis B
2014 Nov 19 4:06 AM
Hello ,
As i correctly understand your need , below is my suggestion :
If you do not want specific line item (say 8 lines only) in first page , then there is no use to put Command line . Remove the command line data will flow to the next page , after first page is completely filled. Only take care Next page will be the Exact same as First page.
Please have a look to image of Next Page :
Let me know if does't work for you.
Thanks
Romit Raina
2014 Nov 19 7:35 AM
Hello Romit and thanks for the answer.
My requirement is to allow only one line item per page so if the delivery has 3 items I will need 3 pages to be printed. So your suggestion is only if I wanted to fill the first page and let it flow to the next and so forth but this is not the case.
Do you have an alternative solution for my requirement of one line item per page?
Thanks in advance,
Konstantinos
2014 Nov 19 11:01 AM
Hello ,
So we have a solution for this , can you put the complete table inside the LOOP .
So inside LOOP , first Command & then table like below :
Define Internal Table in LOOP itself , no need to put internal table in TABLE.
Thanks
Romit Raina
2014 Nov 19 7:39 AM
Hi,
Have you already searched OSS using the message class and number? Is the main window of second page indeed the same main window as that of the first? Could you show using picture, where in the table node do you have the page break node?
cheers
Jānis
Message was edited by: Jānis B
2014 Nov 19 7:47 AM
Hello Janis,
yes I searched, not much info out there...Yes the main windows are exactly the same. Below is the page break in, say, page FIRST
Thank you in advance for your help,
Konstantinos
2014 Nov 19 8:02 AM
Hi,
Do not put the page break within a cell... put it only after the end of row...
1 is ok, 2 is not. Don't ask me why - I didn't programm the SF composer . Though the challenges the composer programmers need to deal with are not to be underestimated...
cheers
Jānis
2014 Nov 19 8:23 AM
Hi again and thanks,
unfortunately I am not using a table with ROW, it looks like below image so I am not using specifically CELL construct but use the cell information within the Output Options of each object
So how can I overcome the problem?
Konstantinos
2014 Nov 19 8:32 AM
Hmm, that looks like the "old" kind of table node...
If I remember correctly, "converting" old tables to new was a bit of a "female dog" to do, but it's probably the best option... That means - creating a new table node, with proper row definitions and all, and reassigning the content. Let me think a bit, if there is some other option at all... because creating those "old" tables is not possible anymore (impossible for me to test)...
Whatever you do - make copies of the form
cheers
Jānis
2014 Nov 19 8:41 AM
Yes, that is why in my initial post I wrote:
"I looked into SCN and Google in general, only related issue that may be the problem is that I need to use table with calculations tab whereas my Table has no such tab - has Events tab,"
That was the only relevant item I thought I found...
Konstantinos
2014 Nov 19 9:48 AM
I can't find a form with old table node in our system unfortunately, so I can't test anything or look at the code of generated SF function module...
One way I can think of - if the old table node supports outputing from/to records, you could try put the node inside another loop (over the same table) and always output one record only (current record of the loop node) in the table node. That way, you should be able to move the pagebreak within loop node (after the table output should be finished). The number of records in the table is not too high, is it?
I think it's worth a try, if including existing table within loop does not force you to convert to the new table node.
Or, if you can change the "driver" program and the table contents are passed from there, one could try to program the loop there and call the form per record, avoiding explicit pagebreak entirely...
I have no other ideas at the moment.
cheers
Janis
Message was edited by: Jānis B
2014 Nov 19 10:04 AM
thank you very much, I will give it a shot and let you know.
Cheers!
2014 Nov 19 10:36 AM
Janis one clarification...what you suggest is put an outer loop in MAIN window where I loop into the internal table. Then within this loop put the table TABLEITEM I already have?
Thanks
2014 Nov 19 10:48 AM
Dear Janis,
I managed to do it with existing "old" table node. I placed the table into a loop where in the loop's definition I put the internal table and the structure (work area). In the table node I have no data defined or conditions. After the table node I put the command for page break as shown below, then I have as many pages as the delivery items.
Thanks again!
2014 Nov 19 10:56 AM
Yes, but now I see that Table node seems to only support hard coded from/to indexes - not a variable... That means, the logic becomes more complex. You'd have to:
- copy the original internal table the table node is using to another internal table and clear it (in INITIALIZATION part of form);
- loop over the copy internal table in loop node, transfer current record to the original table (using abap node)
- after the record has been transferred the table node should output it;
- after the table node comes the pagebreak
I hope there is no other parts of the form that are relying on the original table containing all records. If there is, you'd need to control the record table node has to output using conditions on all nodes within table node. Or maybe the table node permits to group all the table node contents under a folder (without destroying the cell assignments), so you can code condition only once?
Hope this is still making sense...
cheers
Janis
2014 Nov 19 10:57 AM