cancel
Showing results for 
Search instead for 
Did you mean: 

Smartform new page

Former Member
0 Kudos

Hi all,

Im trying to print out Material Stock Turnover Balance Sheet with smartforms. I have an internal table and after it a COMMAND to go to next page. What im trying to do is, whenever the Storage Location (lgort) changes i want to jump onto the next page. If I put the command inside the table node i get error "No explicit page break possible in tables". How can I make this possible.

Thanks,

Alin

Accepted Solutions (1)

Accepted Solutions (1)

nivin_varkey
Active Participant
0 Kudos

hi alin..i am telling the steps i did to to solve this kind of issue..please COLLECT all the distinct storage locations into an internal table.

ie.. let IT_DATA be ur internal table which is to be printed with work area WA_DATA.

now declare a work area and an internal table

begin of wa_sloc,

lgort like mard-lgort,

end of wa_sloc,

it_sloc like table of wa_sloct.

IT_SLOC which holds the distinct storage locations.

so..

loop at it_data into wa_data.

wa_sloc-lgort = wa_data-lgort.

collect wa_sloc into it_sloc.

clear: wa_data, wa_sloc.

endloop.

now create a loop (say LOOP1) in the main window in such a way that the table (say TABLE1, which is used to print the internal table IT_DATA) --- is under LOOP1.

LOOP1 loops on IT_SLOC into WA_SLOC.

TABLE1 loops on IT_DATA into WA_DATA.

now.

in the "Data" tab of the TABLE1 place a condition.

wa_data-lgort = wa_sloc-lgort

and then create a command (say COMMAND1) after TABLE1 but under LOOP1 -with new page (this will trigger a new page).

so theoritically, the main window wud be like

loop at IT_SLOC into WA_SLOC. " LOOP1

loop at IT_DATA into WA_DATA " TABLE1

where LGORT = WA_SLOC-LGORT.

endloop. " TABLE1

COMMAND for NEW-PAGE "COMMAND1

endloop. " LOOP1

hope this reply is helpful to u..if so pls assign points..

thanks,

Nivin

Answers (5)

Answers (5)

Former Member
0 Kudos

Thank you all, esp. Nivin and Raj. I solved my problem.

Former Member
0 Kudos

thanks but I cant put a AT NEW statement because my loop is directly in the TABLE NODE. so i get the error "AT NEW" is allowed only within "LOOP ... ENDLOOP".

Former Member
0 Kudos

Hi Alin,

I had a similar issue where i was printing document headers and items and for each document i need to jump to a new page..

I did this like this...after the footer i just added the command to go to a new page....

by footer i mean the footer of the table....and itz fine for me...try out!!

Regards,

Narendra.

settipalli_raj
Explorer
0 Kudos

Hi

Instead of using Table node, use Loop node and inside loop node, create a template to print the lines. Have the internal table sorted. After the template node, create program lines node to check if the next line that you are going to print belong to same LGORT or not. If not, set a flag, a global variable like next_page.

After the program lines, create a command node which will create a page break. To this node add condition which will test/validates your next_page flag. If flag is set, then go to next page. Remember to craete another program lines node to clear this flag for every loop run.

Hope this helps.

Regards

Raj

Former Member
0 Kudos

Hi,

To trigger a new page use Create-> flow logic-> Command

In command , check the next page check box and specify the page.

For every line item in a new page :

Use AT NEW in the code lines in the loop and set a flag. Based on the flag setting, provide the flag in the conditions of the command. So if the flag is set , a new page will be called.

Clear the flag after AT NEW statement

Regards,

Satish

Former Member
0 Kudos

nope, i need the nodes header, main area, and footer, i dont know how i can do that. i tryed with a loop inside the main area of table but this also doesnt solve my problem.

Former Member
0 Kudos

Hi Alin,

Did you try using template and using COMMAND in this ?

Thanks,

Mark