Smartform Question
Smartform Question
Smartform Question
SMARTFORMS
WHAT IS SMARTFORM IN SAP
Smartform is SAP’s print form technology and is an alternative to SAP-Scripts. Whenever you activate a
Smartform , a function module is generated for that Smartform. The program that calls this function
module is called the Driver Program for Smartform. The T.code for Smartforms is SMARTFORMS.Unlike SAP-
Scripts, Smartforms are client independent.
An SAP R/3 system has 2 clients 200 & 210. You create an SAP Script Z_Script and a Smartform
Z_Smartform in client 200. Will both Z_Script and Z_Smartform be available in client 210 as well?
Client 200 will have just the Smartform Z_Smartform and not the SAP Script Z_Script.SAP-Script is client
dependent whereas SMARTFORM is client independent.Many people don’t understand what this is all
about. The above answer should su ce. However, if you still do not understand this, 粔nd an SAP system
where you have 2 clients. Create a dummy Smartform / script in one client and check whether they exist in
the other client.
You have created a Smartform in DEV environment. Then you migrated the Smartform to PROD
environment. Will the name of the function module be same in DEV and PROD?
Once you transport the Smartform from DEV to PROD environment, a new function module name for the
Smartform in generated in the PROD environment. For a particular Smartform , generated function module
names are di꣠erent in di꣠erent systems.One can get the name of the function module for Smartform by
passing the Smartform name to FM SSF_FUNCTION_MODULE_NAME.
EXPORTING
formname = ‘Z_SMARTFORM’
IMPORTING
fm_name = lv_fm_name
https://sapabapfaq.wordpress.com/form/smartforms/ 1/14
28/07/2016 SMARTFORMS | SAP ABAP QUESTIONNARE
There is a tricky solution here.But let’s keep that for the last. Let us 粔rst discuss the conventional way of
getting a PDF output for Smartform. For that you need to keep in mind the following two function modules
and their importing/exporting parameters:
CONVERT_OTF
CONVERT_OTF_2_PDF
In the Driver program, import the parameter ‘job_output_info’ from the Smartform FM and utilize that info
in ‘OTF’ parameter of the two aforementioned function modules.Here is one more and probably the easiest
way to see PDF output for a Smartform.Type PDF! in the command prompt and hit enter .To see the
Smartform Print Preview output as list output,Type SLIS in the command prompt and hit enter.
Step1: Use SE73 i.e. SAP-Script Font Maintenance and create a Bar code say ZDEMO.
Step 2: For Smartform, create a character format C1 and use the recently created Barcode ZDEMO.
If you go to the properties of a page in Smartform, you will 粔nd a tab for Background Image.Specify the
source of the image you need here and it can be used as background image / Watermark in
Smartforms.Graphics can be maintained using T.code SE78.Background Image for Smartforms
At the Page level in Smartforms, you can 粔nd something called as Print Mode.Set the Print mode to duplex
to print on both sides of the Smartform.Duplex Print mode in Smartforms
A Template has 粔xed number of Rows and Columns whereas a Table can have variable rows and columns
i.e. you can have a internal table with contents associated to a Table element but not to a Template.You
should use a template when the tabular output is 粔xed!
While one can use the PROTECT ….. ENDPROTECT command for SAP-Scripts, for Smartforms the Page-
Protection checkbox can be used to ensure page protection:Note: You have Page-protection property only
for Text Elements in the Main Window.
Can you move a Smartform from one SAP system to another without using transports
https://sapabapfaq.wordpress.com/form/smartforms/ 2/14
28/07/2016 SMARTFORMS | SAP ABAP QUESTIONNARE
Yes, this can be achieved using the Upload/Download feature for Smartforms.One can download the
Smartform from one system and save it as an XML 粔le.Once that is done, the XML 粔le can be used to upload
the Smartform in another system.
Yes, you can create a Smartform without a Main Window. But there is no need to do anything of such
sort.Whenever you create a Smartform, a main window is created by default. I can’t think of a situation ,
where you will have a situation in which it is mandatory for you to remove the Main Window. But still I have
seen this question in ABAP interviews. So I have put it here.
How do you 粔nd the name of the Function Module for a Smartform?When is this function module
created?
The function module for Smartform is created when the Smartform is activated.You can 粔nd the name of
the Function Module for a Smartform by going to Environment –> Function Module Name.
A copies window is similar to a secondary window,in that you can de粔ne multiple copies windows for one
form with any size and positioning on the page, and a copies window cannot contain continuous text. A
special feature of the copies window is the additional feature that you can decide to make processing
depend on whether the form is printed as an original or as a copy (if you are printing more than 1copy). It is
therefore possible to identify copies individually.You can determine where to print the inferior nodes of a
copies window:
Final Window is called after all the other windows are called in a Smartform.You may want to display or
query values on the 粔rst page that are determined only during processing. For example, you may want to
name the grand total in the letter text of an invoice. However, this amount is determined only after listing all
individual items. Or you may want to query on the 粔rst page within a condition the total number of pages,
which the system calculates only after processing all pages.In such a case, you use the 粔nal window:
Processing 粔rst skips all windows of this type in the tree and works its way to the end of the tree. Only after
the actual processing is 粔nished, the 粔nal windows are processed in the order in which they appear in the
tree (from top to bottom). Now any information is available that is known only at the end of the form
processing
Method 1:
https://sapabapfaq.wordpress.com/form/smartforms/ 3/14
28/07/2016 SMARTFORMS | SAP ABAP QUESTIONNARE
You will get a pop-up, in that function module name will be displayed copy that function module number
Click on display, select Attributes tab. In that tab double click on Program Name 粔eld
In this include 粔rst few lines will be system generated code, followed by our code
Select the Text node.Change Editor (Click the button above Check near the Editor)Go to menu Include-
>Characters->SAP Symbols Choose the SAP symbol that you want to insert.
Folder option allows u to place all the contents into a single place. this is useful when u have so many no.of
windows and with each window u have di꣠erent graphics, texts, tables, templates used so to di꣠erentiate
b/w 2 windows we generally go for folders and place all contents of one window in a folder and wise versa.A
folder can be used for two purposes
1. Page protection. like Protect end protect in scripts(so all come on one page)
2. Logical grouping
If u want to put a condition on a group of text elements u can put them in a folder and apply the condtion
once to the folder Folder nodes Combine successor nodes to logical groups.Possible direct successors are
All except window and page nodes The more extensive a form becomes, the less clear becomes the node
hierarchy in the treestructure. To avoid this, you can combine related nodes by appending them under a
folder node.
Procedure
1. To create a folder node call the context menu for that node in the tree structure that shall
https://sapabapfaq.wordpress.com/form/smartforms/ 4/14
28/07/2016 SMARTFORMS | SAP ABAP QUESTIONNARE
2. Enter a unique name for the node and a description (for example, cells of the third line).
3. To assign other nodes to the folder, use Drag&Drop to pull them to the folder node or insert
They help adapting forms without any programming knowledge due to entirely graphical user
interface
When activating the smart form the system automatically generates the function module and at the
runtime .
To make any changes we have to use the Drag & Drop, Cut & Paste. These actions do not include
writing of coding lines or using a script language.
We can insert static and dynamic tables. These include the line feeds in the individual table cells,
triggering events for table headings and subtotals and sorting data before output.
The smart forms allow the user to include graphics, which can be displayed as a part of the form or as
background graphics. During printout the user can suppress the background graphic as and when
necessary.
Web Publishing is possible using the generated XML output
Main
Secondary
Copies windows
Final window
Main Window
In a main window you display text and data, which can cover several pages ( ow text). As soon as a main
window is completely 粔lled with text and data, the system continues displaying the text in the main window
of the next page. It automatically triggers the page break.You can de粔ne only one window in a form as main
window.The main window must have the same width on each page, but can di꣠er in height.A page without
main window must not call itself as next page, since this would trigger an endless loop. In such a case, the
system automatically terminates after three pages.
Secondary Windows
In a secondary window you display text and data in a predetermined output area. There is no ow text
display with page break. If you position a secondary window with the same name on several pages, the
system displays the contents of this secondary window on each page.Text and data that do not 粔t into the
secondary window are truncated and not displayed.
https://sapabapfaq.wordpress.com/form/smartforms/ 5/14
28/07/2016 SMARTFORMS | SAP ABAP QUESTIONNARE
Create a loop around the table. Put a Command node before the table in the loop that forces a NEWPAGE
on whatever condition you want.Then only loop through a subset of the internal table (based on the
conditions in the Command node) of the elements in the Table node.
Goto Transaction SMARTSTYLES.There you can create Paragraph formats etc just like in sapscript.Then in
your window under OUTPUT OPTIONS you include this SMARTSTYLE and use the Paragraph and character
formats.
Line in Smartform
Either you can use a window that takes up the width of your page and only has a height of 1 mm.Then you
put a frame around it (in window output options).Thus you have drawn a box but it looks like a line.Or you
can just draw “__” accross the page and play with the fonts so that it joins each UNDER_SCORE.
Di꣠erence between ‘forminterface’ and ‘global de粔nitions’ in global settings of smart forms
Form Interface is where you 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 you
declare data to be used within the smartform on a global scope.
Problem with Smartforms in a certain form for two di꣠erently con粔gured printers.There seem to be
a di꣠erence in the output of characters per inch (the distance between characters which gives a
layout problem – text in two lines instead of one.
It happens when the two printers having di꣠erent Printer Controls’ if you go to SPAD Menu (Spool
Administrator Menu) you can see the di꣠erence in the Printer Control and if you make the Printer control
setting for both the printers as same. then it will be ok.check what is the device type used for both the
output devices.
Your customer wants your PO SmartForm to be able to print “Terms and Conditinos” on the back side of
each page. They don’t want to purchase pre-printed forms with the company’s logo on the front and terms
& conditions on the back. Now this presents an interesting problem.
Example: If for example there was a 3 page PO to be printed, they want 3 pieces of paper, the front side of
each to containe the PO information (page 1, 2, and 3) and the back side of each piece of paper to containg
the static “Terms & Conditions” information.
Easy – page FRONT lists page CONTACTS as next page and CONTACTS lists FRONT as next page. Since
CONTACTS does not contain a MAIN window, it will print the contacts info and then continue on to FRONT
for the rest of the main items.Additionally, set print mode on FRONT to D (duplex) and set CONTACTS to
https://sapabapfaq.wordpress.com/form/smartforms/ 6/14
28/07/2016 SMARTFORMS | SAP ABAP QUESTIONNARE
‘blank’ (for both resource name and print mode – this is the only way to get to the back of the page).
How can I make the Smartforms to display a print preview by default without displaying the popup
for print parameters?
In the SSF_OPEN function module,Set the OUTPUT OPTIONS paramter TDDEST to your printer name.Set the
CONTROL PARAMETERS and control parameters as shown below,
control-preview = ‘X’.
control-no_open = ‘X’.
control-no_close = ‘X’.
control-no_dialog = ‘X’.
control-device = ‘PRINTER’.
control_parameters-no_dialog = ‘X’.
control_parameters-no_open = ‘X’.
control_parameters-no_close = ‘X’.
OUTPUT_OPTIONS-TDNOPRINT = ‘X’.
EXPORTING
output_options = output_options
control_parameters = control
user_settings = ‘ ‘
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
https://sapabapfaq.wordpress.com/form/smartforms/ 7/14
28/07/2016 SMARTFORMS | SAP ABAP QUESTIONNARE
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
ENDIF.
SAP provides a conversion for SAPscript documents to SMARTforms.This is basically a function module,
called FB_MIGRATE_FORM. You can start this function module by hand (via SE37), or create a small ABAP
which migrates all SAPscript forms automatically.You can also do this one-by-one in transaction
SMARTFORMS, underUtilities -> Migrate SAPscript form.You could also write a small batch program calling
transaction SMARTFORMS and running the migration tool.
I’m using the variable SFSY-FORMPAGES, I get a star “*” instead of the total number of pages.
There may not be enough space in the window to display the variable, either increase thewindow
dimensions or condense the spaces using &SFSY-FORMPAGES(C)&
https://sapabapfaq.wordpress.com/form/smartforms/ 8/14
28/07/2016 SMARTFORMS | SAP ABAP QUESTIONNARE
In the Table Painter, you can specify the color and shading for the table lines.
The input parameters for the smartform can be de粔ned in Global Settings->Form
The global types(within the smartform) can be de粔ned in Global Settings->Global De粔nitions->Types The
types de粔ned here will be global through the entire smartform. Also the form routines can be de粔ned
Global Settings->Global De粔nitions->Form Routines
I have created a table node for display. Where can I check the condition which must satisfy to
display the table?
The conditions can be de粔ned in the Conditions tab. In smartforms all the nodes have a condition tab
where you can specify the condition to be satis粔ed to access the node.
Where can I de粔ne the paragraph and character format for the smartforms?
The paragraph and character format for the smartforms can be de粔ned in the transaction SMARTSTYLES
Go to the properties of ‘PAGE’, tab ‘Background Picture’. Add the grapic image name here
In the CALL FUNCTION of the Smartform Function Module, set the output options parameter to set the
printer name.The output options is of the type SSFCOMPOP which contains the 粔eld TDDEST. Set
theTDDEST 粔eld to your default printer name.
The adaption of forms is supported to a large extent by graphic tools for layout and logic, so that no
programming knowledge is necessary (at least 90% of all adjustments). Therefore, power user forms
https://sapabapfaq.wordpress.com/form/smartforms/ 9/14
28/07/2016 SMARTFORMS | SAP ABAP QUESTIONNARE
can also make con粔gurations for your business processes with data from an SAP system. Consultants
are only required in special cases.
Displaying table structures (dynamic framing of texts)
Output of background graphics, for form design in particular the use of templates which were
scanned.
Colored output of texts
User-friendly and integrated Form Painter for the graphical design of forms
Graphical Table Painter for drawing tables
Reusing Font and paragraph formats in forms (Smart Styles)
Data interface in XML format (XML for Smart Forms, in short XSF)
Form translation is supported by standard translation tools
Flexible reuse of text modules
HTML output of forms (Basis release 6.10)
Interactive Web forms with input 粔elds, pushbuttons, radio buttons, etc.
TCode:SO10
There are texts that frequently appear in your forms. You can use text modules to store these texts
centrally in the system. This detaches text maintenance from form maintenance, with the result that you do
not need to call the Form Builder to edit individual texts.
Integration
To include text modules in forms, you use text nodes. The text node can either refer to the text module or
copy its text. In the latter case, you can change or supplement the text according to the requirements of the
form.
SAP Smart Forms provides a text module maintenance function that allows you to create and edit text
modules. Like text nodes, text modules have the following attributes:
In text module maintenance, you can also download the current text module to your local PC as a XML 粔le
so that you can upload it at a
https://sapabapfaq.wordpress.com/form/smartforms/ 10/14
28/07/2016 SMARTFORMS | SAP ABAP QUESTIONNARE
later time and use it again, for example, in another system. To do this, choose Utilities ® Download or
Utilities ® Upload.
In a Smart Style you de粔ne the paragraph and character formats, which you can then assign to texts and
粔elds in the Smart Form
OTF Standard Output This is the established format for printing forms in the SAP System. It can be
(Output Text converted into other formats, such as PDF.
Format)
XSF XSF Output This is an XML scheme that contains the form contents of the processed
(XML for SAP form without any layout information.
Smart Forms)
HTML XSF Output + HTML In addition to XSF, you can tell SAP Smart Forms to generate layout
Markup
Language)
XDF XDF Output This is an XML scheme that describes neither the form nor its layout, but
(XML Data for simply the data the application passed at the form interface.
Forms)
No, But if you want to test the data also which has been retrieved from main program , You need driver
program to execute
How can we download the smart form & sub tree?How can we upload the smart form & sub tree?
https://sapabapfaq.wordpress.com/form/smartforms/ 11/14
28/07/2016 SMARTFORMS | SAP ABAP QUESTIONNARE
System
Character formats to assign special output attributes to sections of texts or character strings within a
paragraph
Font family, size , style ,bar code setting, Underline setting, E꣠ects , Color
Use
Integration
Forcontrol breaks before or after which you want to make a certain output (for example, subtotals)
Event Description
page
not on 粔rst Output appears on all print pages except the 粔rst.
page
only after end Output starts only after all nodes within the main window are processed. It makes no sense to
of main activate this event for a node within the main window, since it would never be printed.
window
only before Output appears as long as the system still processes nodes of the main window. This event is of
https://sapabapfaq.wordpress.com/form/smartforms/ 12/14
28/07/2016 SMARTFORMS | SAP ABAP QUESTIONNARE
end of main interest for nodes that appear before or after the main window de粔nition in the navigation tree of the
window Form Builder.
only on Output appears only on print pages that are de粔ned usingdraft page <S>.
page<S>
SE78
Continous output
Smartform FMs are tracked by internal numbering and thats saved in the table STXFADMI
PLEASE GO THROUGH THE FOLLOWING SITES FOR REFRESHING CONCEPTS STEP BY STEP
https://sapabapfaq.wordpress.com/form/smartforms/ 13/14
28/07/2016 SMARTFORMS | SAP ABAP QUESTIONNARE
http://wiki.scn.sap.com/wiki/display/ABAP/SMARTFORM+BASICS
http://help.sap.com/saphelp_nw70/helpdata/EN/8a/8c8a43def411d3969600a0c930660b/frameset.ht
m
http://saptechnical.com/Tutorials/Smartforms/SFMain.htm
Follow
Sign me up
https://sapabapfaq.wordpress.com/form/smartforms/ 14/14