Vous êtes sur la page 1sur 17

Forcing a page break within table loop

Create a loop around the table. Put a Command node before the table in the loop
that forces a
NEWPAGE on whatever condition ou want. !hen onl loop through a subset of the
internal table "based
on the conditions in the Command node# of the elements in the !able node.
Font stle and Font si$e
Goto !ransaction %&A'!%!()E%.
!here ou can create Paragraph formats etc *ust like in sapscript.
!hen in our window under +,!P,! +P!-+N% ou include this %&A'!%!()E and use
the Paragraph and
character formats.
)ine in %martform
Either ou can use a window that takes up the width of our page and onl has a
height of . mm.
!hen ou put a frame around it "in window output options#.
!hus ou have drawn a bo/ but it looks like a line.
+r ou can *ust draw 0110 accross the page and pla with the fonts so that it *oins
2i3erence between 4forminterface4 and 4global de5nitions4 in global settings of
smart forms
!he 2i3erence is as follows.
!o put it ver simpl6
Form -nterface is where ou declare what must be passed in and out of the
smartform "in from the
print program to the smartform and out from the smartform to the print program#.
Global defs. is where ou declare data to be used within the smartform on a global
ie6 anthing ou declare here can be used in an other node in the form.
%martforms function module name
+nce ou have activated the smartform7 go to the environment 89 function module
name. !here ou can
get the name of funtion module name.
!he ke thing is the program that calls it. for instance7 the invoice %&A'!F+'&
):1:-)1-N;+-CE is
ran b the program '):1-N;+-CE.
!his program uses another F& to determine the name of the F& to use itself. !he
ke thing is that
when it calls this F& "using a variable to store the actual name#7 that the
parameters match the
paramters in our smartform.
Another thing to note is that the F& name will change wherever the %F is
transported to.
%o ou need to use the F& to determine the name of the %F.
<ere is the code that can be use to determine the internal name of the function
if sf1label".# =9 4>4. 0 need to resolve b name
move sf1label to e/ternalname.
call function 4%%F1F,NC!-+N1&+2,)E1NA&E4
formname ? e/ternalname
fm1name ? internalname
no1form ? .
no1function1module ? @
others ? A.
if s8subrc =9 B.
message 4eC@D4.
move internalname to sf1label.
-t checks to see if the sf1label starts with a 4>47 which is how the internal names start.
if it
does7 the name has alread been converted. -f not7 it calls the F& and converts the
(ou would then CA)) F,NC!-+N sf1label.
%martforms FAE Part !wo
%martforms output di3erence
Problem with %martforms6 in a certain form for two di3erentl con5gured printers7
there seem to be
a di3erence in the output of characters per inch "the distance between characters
which gives a
laout problem 8 te/t in two lines instead of one.
-t happens when the two printers having di3erent Printer Controls4 if ou go to %PA2
&enu "%pool
Administrator &enu# ou can see the di3erence in the Printer Control and if ou
make the Printer
control setting for both the printers as same. then it will be ok. and also u have to
check what is
the device tpe used for both the output devices.
%martForms +utput to P2F
!here is a wa to download smartform in P2F format.
Please do the following6
.. Print the smartform to the spool.
@. Note the spool number.
A. 2ownload a P2F 5le "Acrobat 'eader# version of the spool b running Program
'%!FP2F!C and
entering the
noted spool number.
%martForm 2oublesided printing Guestion
(our customer wants our P+ %martForm to be able to print 0!erms and Conditinos0
on the back side of
each page. !he don4t want to purchase pre8printed forms with the compan4s logo
on the front and
terms H conditions on the back. Now this presents an interesting problem.
<as anone else ever had a reGuest like thisI -f for e/ample there was a A page P+
to be printed7
the want A pieces of paper7 the front side of each to containe the P+ information
"page .7 @7 and
A# and the back side of each piece of paper to containg the static 0!erms H
Conditions0 information.
Anone have a clue how to force this outI
Eas 8 page F'+N! lists page C+N!AC!% as ne/t page and C+N!AC!% lists F'+N!
as ne/t page. %ince
C+N!AC!% does not contain a &A-N window7 it will print the contacts info and then
continue on to
F'+N! for the rest of the main items. Additionall7 set print mode on F'+N! to 2
"duple/# and set
C+N!AC!% to 4blank4 "for both resource name and print mode 8 this is the onl wa
to get to the back
of the page#.
!ransport %mart Forms
<ow does one transport %&A'!F+'&I %EB.I
<ow do ou make sure that both7 the %&A'!F+'& H it4s function module gets
transportedI +r does the
F& with same name gets generated automaticall in the transported clientI
A smartform is transported no di3erentl than an other ob*ect. if it is assigned to a
class that is atteched to a transport laer7 it will be transported.
!he de5nition is transported7 and when called7 the function module is regenerated.
!his leads to an interetsing situation. +n the new machine7 it is ver likel the
function module
name will be di3erent than the name on the source sstem. &ake sure7 before ou
call the function
module7 ou resolve the e/ternal name to the internal name using the
function module.
!picall7 generate the %F7 then use the pattern to being in the interface. !hen
change the call
function to use the name ou get back from the above function module.
%martforms6 protect lines in main window.
<ow to protect lines in the main window from splitting between pagesI
-t was eas with %APscript7 but how to do it with %F4s. For C.D version if ou are
using tables7
there are two options for protection against line break6
8 (ou can protect a line tpe against page break.
8 (ou can protect several table lines against page break for output in the main area.
Protection against page break for line tpes
8 2ouble8click on our table node and choose the !able tab page.
8 %witch to the detail view b choosing the 2etails pushbutton.
8 %et the Protection against page break checkbo/ in the table for the relevant line
tpe. !able
lines that use this line tpe are output on one page.
Protection against page break for several table lines
8 E/pand the main area of our table node in the navigation tree.
8 -nsert a 5le node for the table lines to be protected in the main area.
8 -f ou have alread created table lines in the main area7 ou can put the lines that
ou want to
protect again page break under the 5le using 2ragH2rop. +therwise7 create the
table lines as
subnodes of the 5le.
8 Choose the +utput +ptions tab page of the 5le node and set the Page Protection
option. All table
lines that are in the 5le with the Page Protection option set are output on one page.
-n C.J7 Alternativel in a paragraph format use the Page protection attribute to
determine whether
or not to displa a paragraph completel on one page. &ark it if ou want to avoid
that a paragraph
is split up b a page break. -f on the current page "onl in the main window# there is
not enough
space left for the paragraph7 the entire paragraph appears on the ne/t page.
What are the di3erences between %AP %cripts and %martformsI
%AP %cripts are client dependent whereas %martforms are client independent.
%AP %cripts reGuire a driver program to displa the output whereas in smartforms
the form routines
can be written so that it is standalone.
An integrated Form :uilder helps to design %martforms more easil than %AP %cripts
An !able Painter and %martstles to assist in building up the smartforms
+n activation a function module is generated for %martforms
-t is possible to create a %martform without a main window
%martforms generates F&) output which can be viewed through the web
&ultiple page formats is possible in smartforms
<ow can - insert smbols in %martformsI
%elect the !e/t node.
Change Editor "Click the button above Check near the Editor#
Go to menu -nclude89Characters89%AP %mbols
Choose the %AP smbol that ou want to insert.
- have a smartform which works 5ne in 2E;. After trasnsporting it to P'+27 there is
no Function
module generated for this smartform. As a result m program dumps in P'+2I
!he %martform that is created in the 2evelopment ma not have the same name in
the Production
server. %o it is alwas advised to use the Function &odule
%%F1F,NC!-+N1&+2,)E1NA&E to get the
Function &odule name b passing the %martform name.
2A!A6 fm1name !(PE rsAKl1fnam.
CA)) F,NC!-+N 4%%F1F,NC!-+N1&+2,)E1NA&E4
formname ? 4L%&A'!F+'&4
fm1name ? fm1name
no1form ? .
no1function1module ? @
+!<E'% ? A.
-F s8subrc =9 B.
&E%%AGE -2 s8msgid !(PE s8msgt N,&:E' s8msgno
W-!< s8msgv. s8msgv@ s8msgvA s8msgvC.
CA)) F,NC!-+N fm1name
formatting1error ? .
internal1error ? @
send1error ? A
user1canceled ? C
+!<E'% ? M.
-F s8subrc =9 B.
&E%%AGE -2 s8msgid !(PE s8msgt N,&:E' s8msgno
W-!< s8msgv. s8msgv@ s8msgvA s8msgvC.
EN2-F.<ow can - make the %martforms to choose a printer name b defaultI
-n the CA)) F,NC!-+N of the %martform Function &odule7 set the output options
parameter to set the
printer name.
!he output options is of the tpe %%FC+&P+P which contains the 5eld !22E%!. %et
the !22E%! 5eld to
our default printer name.
<ow can - make the %martforms to displa a print preview b default without
displaing the popup for
print parametersI
-n the %%F1+PEN function module7
%et the +,!P,! +P!-+N% paramter !22E%! to our printer name.
%et the C+N!'+) PA'A&E!E'% and control parameters as shown below7
control8preview ? 4F4.
control8no1open ? 4F4.
control8no1close ? 4F4.
control8no1dialog ? 4F4.
control8device ? 4P'-N!E'4.
control1parameters8no1dialog ? 4F4.
control1parameters8no1open ? 4F4.
control1parameters8no1close ? 4F4.
+,!P,!1+P!-+N%8!22E%! ? 4P'-N!E' NA&E4.
+,!P,!1+P!-+N%8!2N+P'-N! ? 4F4.
CA)) F,NC!-+N 4%%F1+PEN4
output1options ? output1options
control1parameters ? control
user1settings ? 4 4
formatting1error ? .
internal1error ? @
send1error ? A
user1canceled ? C
+!<E'% ? M.
-F s8subrc =9 B.
&E%%AGE -2 s8msgid !(PE s8msgt N,&:E' s8msgno
W-!< s8msgv. s8msgv@ s8msgvA s8msgvC.
<ow can - displa the total number of pages in %martformsI
,se %F%(8F+'&PAGE% to displa the total number of pages in the %martforms
H%F%(8PAGEH Current page number
H%F%(8F+'&PAGEH !otal number of pages in the currentl formatted laout set
H%F%(8N+:PAGEH !otal number of pages in the currentl formatted print reGuest
H%F%(8C+P(C+,N!H +riginal8.7.st cop8@
H%F%(82A!EH 2ate
H%F%(8!-&EH !ime
H%F%(8,%E'NA&EH ,sername
-4m using the variable %F%(8F+'&PAGE%7 - get a star 0O0 instead of the total number
of pages.
!here ma not be enough space in the window to displa the variable7 either
increase the window
dimensions or condense the spaces using H%F%(8F+'&PAGE%"C#H
What are the various te/t formatting options in %martformsI
Hsmbol"L#H +mit )eading Leros
Hsmbol"%#H +mit )eading %ign
Hsmbol"=#H 2ispla )eading %ign to the )eft
Hsmbol"9#H 2ispla )eading %ign to the 'ight
Hsmbol"C#H Compress %paces
Hsmbol".N#H 2ispla upto N decimal places
Hsmbol"!#H +mit thousands separator
Hsmbol"'#H 'ight *usti5ed
Hsmbol"-#H %uppress output of the initial value
<ow can - provide a background shading to the tableI
-n the !able Painter7 ou can specif the color and shading for the table lines.
Where can - provide the input parameters to the smartformI
!he input parameters for the smartform can be de5ned in Global %ettings89Form
!he Associated !pe must be de5ned in the A:AP 2ictionar.
Where can - de5ne m own global tpes for the smartformI
!he global tpes"within the smartform# can be de5ned in Global %ettings89Global
!he tpes de5ned here will be global through the entire smartform.
Also the form routines can be de5ned Global %ettings89Global 2e5nitions89Form
- have de5ned m own Program )ines7 where - have used a global variable G1!EF!. -
get an error
G1!EF! is not de5nedI
Whenever using the global variables in the Program )ines7 enter the variable name
in -nput
Parameters if ou are going to use"read# the variable. -f ou are going to both
read>write the
variable value enter the same in +utput Parameters.
- have created a table node for displa. Where can - check the condition which must
satisf to
displa the tableI
!he conditions can be de5ned in the Conditions tab. -n smartforms all the nodes
have a condition
tab where ou can specif the condition to be satis5ed to access the node.
<ow can - de5ne Page Protect in %martformsI
!o de5ne Page Protect for a node go to the +utput options and check the Page
Protection checkbo/.
What is the di3erence between !emplate and !able in %martformsI
!he !emplate contains a 5/ed number of rows and columns7 where the output is
!he !able can have variable number of rows
Where can - de5ne the paragraph and character format for the smartformsI
!he paragraph and character format for the smartforms can be de5ned in the
transaction %&A'!%!()E%
<ow to add watermark to smartform outputI
Go to the properties of 4PAGE47 tab 4:ackground Picture4. Add the grapic image name
<+W !+ A22 :,!!+N% AN2 'A2-+:,!!+N% E!C -N %&A'!F+'&%I
:,!!+N% -% N+! P+%%-:)E -N %&A'!F+'&%"+N)( -N A2+:E F+'&% -! -%
:,! (+, CAN -N%E'! C<ECP:+FE% AN2 'A2-+:,!!-+N% -N %&A'!F+'&%.
(ou can print a check bo/ in di3erent was.. b inserting smbols and making
window as
check bo/..

once go through the thread u will get to k now di3ernt was

putting checkbo/es in smartformI
'e6 Euick Euestion on %martforms

%olution @6
!o use Check bo/ in smartform do the following6
Change the editor to 4PC Editor4 and take the menu.
in te/t editor of !EF! E)E&EN!%..
-nsert 89 Characters 89 %AP %mbols
in print preview u can4t see these changes..