Application Development and Automation 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: 
Read only

Smartforms next page command issue

konstantinos_vassiliadis
Active Participant
0 Likes
8,266

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

1 ACCEPTED SOLUTION
Read only

Private_Member_7726
Active Contributor
0 Likes
6,435

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

15 REPLIES 15
Read only

romit_raina
Active Participant
0 Likes
6,435

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

Read only

0 Likes
6,435

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

Read only

0 Likes
6,435

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

Read only

Private_Member_7726
Active Contributor
0 Likes
6,436

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

Read only

0 Likes
6,435

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

Read only

0 Likes
6,435

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

Read only

0 Likes
6,435

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

Read only

0 Likes
6,435

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

Read only

0 Likes
6,435

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

Read only

0 Likes
6,435

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

Read only

0 Likes
6,435

thank you very much, I will give it a shot and let you know.

Cheers!

Read only

0 Likes
6,435

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

Read only

0 Likes
6,435

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!

Read only

0 Likes
6,435

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

Read only

0 Likes
6,435

Ok, cool - even brilliant