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: 

Smart Form - Preventing a Paragraph being Split to different Page

Former Member
0 Kudos

Hi,

I have 2 tables in the main window. I am looping into the 1st table and process the 2nd table to make a single Paragraph. A Single Pparagraph will have 1 line from 1st table and multiple lines from 2nd table. My requirement is to prevent the paragraph getting split into different pages. What should I do to make this work? Please let me have your suggestion.

Thanks,

Kannan.SA

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Kannan,

Please use Protect and EndProtect command.

PROTECT .... ENDPROTECT:

The text which we want to be printed without any break i.e printed completely in a page is

inserted between PROTECT and ENDPROTECT . If sapscript finds that the text cannot be printed on that page completely a implicit page break occurs and the text is printed on the next page

Hope this helps.

Thanks,

Srinivasa

Message was edited by:

Srinivasa

5 REPLIES 5

Former Member
0 Kudos

Hi Kannan,

Please use Protect and EndProtect command.

PROTECT .... ENDPROTECT:

The text which we want to be printed without any break i.e printed completely in a page is

inserted between PROTECT and ENDPROTECT . If sapscript finds that the text cannot be printed on that page completely a implicit page break occurs and the text is printed on the next page

Hope this helps.

Thanks,

Srinivasa

Message was edited by:

Srinivasa

0 Kudos

Hi Srinaivas,

Thanks for your reply. This is Smart Form. I used PROTECT.... ENDPROTECT in SAPScript. Can you please suggest me a solution for the same requirement in Smart Form?

Thanks,

Kannan.

Former Member
0 Kudos

Hi,

It was easy with SAPscript, but how to do it with SF's. For 4.7 version if you are using tables, there are two options for protection against line break:

- You can protect a line type against page break.

- You can protect several table lines against page break for output in the main area.

Protection against page break for line types

- Double-click on your table node and choose the Table tab page.

- Switch to the detail view by choosing the Details pushbutton.

- Set the Protection against page break checkbox in the table for the relevant line type. Table lines that use this line type are output on one page.

Protection against page break for several table lines

- Expand the main area of your table node in the navigation tree.

- Insert a file node for the table lines to be protected in the main area.

- If you have already created table lines in the main area, you can put the lines that you want to protect again page break under the file using Drag&Drop. Otherwise, create the table lines as subnodes of the file.

- Choose the Output Options tab page of the file node and set the Page Protection option. All table lines that are in the file with the Page Protection option set are output on one page.

In 4.6, Alternatively in a paragraph format use the Page protection attribute to determine whether or not to display a paragraph completely on one page. Mark it if you want to avoid that a paragraph is split up by a page break. If on the current page (only in the main window) there is not enough space left for the paragraph, the entire paragraph appears on the next page.

Regards,

Bhaskar

Former Member
0 Kudos

Hi Kannan,

What I understood from your message is :

E.g.

You have 1st internal table with :

This is first line of 1st internal table

This is second line of 1st internal table

............

You have 2nd internal table with :

This is first line of 2nd internal table

This is second line of 2nd internal table

This is third line of 2nd internal table

.............

Now the output should be :

This is first line of 1st internal table

This is first line of 2nd internal table

This is second line of 2nd internal table

This is third line of 2nd internal table

.............

Now to achieve this what you can do is :

Build an internal table with the text lines those are required in output and create standard text using function module 'SAVE_TEXT'. Make sure you should have unique name for that(e.g. ZTEST1).

Now in smartform create an include text node. And use this standard text (e.g. ZTEST1) to print. Now here you can set page break settings in 'OUTPUT' tab of the include text.

I hope it will solve your problem.

Thanks,

Sagar V.

0 Kudos

Hi Sagar,

Thanks for your Reply.

itab1-line1

itab2-line1

itab2-line2

itab2-line3

-


itab1-line2

itab2-line4

itab2-line5

itab2-line6

-


itab1-line3

itab2-line7

itab2-line8

itab2-line9

This is my output requirement. I want to keep the header info (itab1-line) and the Items (itab2-lines) in one page.

Thanks,

Rajan.SA