SAP Smart Forms
SAP Smart Forms
SmartForms
SAP Smart Forms allow you to execute simple modifications to the form and in the form
logic by using simple graphical tools; in 90% of all cases, this won't include any
programming effort. Thus, a power user without any programming knowledge can
configure forms with data from an SAP System for the relevant business processes.
To print a form, you need a program for data retrieval and a Smart Form that contains the
entire from logic. As data retrieval and form logic are separated, you must only adapt
the Smart Form if changes to the form logic are necessary. The application program
passes the data via a function module interface to the Smart Form. When activating
the Smart Form, the system automatically generates a function module. At runtime,
the system processes this function module.
You can insert static and dynamic tables. This includes line feeds in individual table cells,
triggering events for table headings and subtotals, and sorting data before output.
You can check individual nodes as well as the entire form and find any existing errors in
the tree structure. The data flow analysis checks whether all fields (variables) have a
defined value at the moment they are displayed.
SAP Smart Forms allow you to include graphics, which you can display either as part of
the form or as background graphics. You use background graphics to copy the layout of
an existing (scanned) form or to lend forms a company-specific look. During printout,
you can suppress the background graphic, if desired.
Also read SAP Note No. 168368 - Smart Forms: New form tool in Release 4.6C
To make changes, use Drag & Drop, Copy & Paste, and select different attributes.
These actions do not include writing of coding lines or using a Script language.
Using your form description maintained in the Form Builder, Smart Forms generates a
function module that encapsulates layout, content and form logic. So you do not need
a group of function modules to print a form, but only one.
For Web publishing, the system provides a generated XML output of the processed
form.
Smart Forms provides a data stream called XML for Smart Forms (XSF) to allow the use
of 3rd party printing tools. XSF passes form content from R/3 to an external product
without passing any layout information about the Smart Form.
1. 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 can also make configurations for your business processes
with data from an SAP system. Consultants are only required in special cases.
3. Output of background graphics, for form design in particular the use of templates
which were scanned.
5. User-friendly and integrated Form Painter for the graphical design of forms
8. Data interface in XML format (XML for Smart Forms, in short XSF)
12. Interactive Web forms with input fields, pushbuttons, radio buttons, etc. (Basis-
Release 6.10)
According to SAP, you need neither have any programming knowledge nor use a Script
language to adapt standard forms. However, basic ABAP programming skills are required
only in special cases (for example, to call a function module you created or for complex
and extensive conditions).
• First Page -> Header Window (Cursor at First Page then click Edit -> Node ->
Create)
REPORT ZSMARTFORM.
TABLES: MKPF.
if sy-subrc <> 0.
WRITE: / 'ERROR 1'.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
You can create additional fonts and style with transaction SMARTSTYLES
This can then be define in the paragraph and character formats, which you can then be
assign to texts and fields in the Smart Form.
The character formats includes effects such as superscript, subscript, barcode and font
attributes.
a) Multiple page formats are possible in smartforms which is not the case in SAPScripts
It was said that it was provided in CRM 3.0 version, but not available in R/3. You can
download smartforms into Local PC in a XML format. In the same way you can upload
this XML format into Smartform. From the smartform editor itself you can call
download option, if you are working in CRM 3.0 environment.
In R3 also, you can download into XML format. However, it's not sure about uploading.
Refer to the program 'SF_XSF_DEMO'.
In 4.7 Enterprise, other have seen this utlity which is completey missing in 4.6c. There is
functionality to downlaod a complete form or only a particular node. (Utilities ->
Download form). It will create a XML file and save it in the hard disk.
For others, if you want to download/upload the Smartforms source, you will need
the help from the Basis people. What you can do is to create a Transport and then
FTP down to your local harddisk. When you need the Smartform source in another
system, you have FTP up the Smartforms file back to the SAP server. Finally, the
Basis team, will tp it into your system.
g) The protect and endprotect command in sapscript doesn't work with smartforms.
For example on a invoice: First data of position no 80. is printed on page one, other data
of position no 80 is printed on page 2. And there's nothing you can do about it. Actually,
there is something you can do about it. By using a folder node and checking the
'protect' checkbox, everything in that folder will be page protected.
I have heard that Smart Forms replaces SAPscript. What does "replace" mean?
It does not mean that SAPscript is removed from the Basis shipment. Even as of Basis
Release 4.6C, SAPscript remains part of the SAP standard and there are no plans to
remove it. Since Smart Forms is currently, and will continue to be, the tool for form
maintenance for mySAP.com solutions, our further development efforts will focus on
Smart Forms, not on SAPscript.
You could also write a small batch program calling transaction SMARTFORMS and
running the migration tool.
&SFSY-DATE&
Displays the date. You determine the display format in the user master record.
&SFSY-TIME&
Displays the time of day in the form HH:MM:SS.
&SFSY-PAGE&
Inserts the number of the current print page into the text. You determine the format of the
page number (for example, Arabic, numeric) in the page node.
&SFSY-FORMPAGES&
Displays the total number of pages for the currently processed form. This allows you to
include texts such as'Page x of y' into your output.
&SFSY-JOBPAGES&
Contains the total page number of all forms in the currently processed print request.
&SFSY-WINDOWNAME&
Contains the name of the current window (string in the Window field)
&SFSY-PAGENAME&
Contains the name of the current page (string in the Page field)
&SFSY-PAGEBREAK&
Is set to 'X' after a page break (either automatic [Page 7] or command-controlled [Page
46])
&SFSY-MAINEND&
Is set as soon as processing of the main window on the current page ends
&SFSY-EXCEPTION&
Contains the name of the raised exception. You must trigger your own exceptions, which
you defined in the form interface, using the user_exception macro (syntax:
user_exception <exception name >).
SF_EXAMPLE_02
Similar to SF_EXAMPLE_01 but with subtotals
SF_EXAMPLE_03
Similar to SF_EXAMPLE_02, whereby several customers are selected in the application
program; the form is called for each customer and all form outputs are included in an
output request
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.
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.
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.
ie: anything you declare here can be used in any other node in the form.
Once you have activated the smartform, go to the environment -> function module name.
There you can get the name of funtion module name.
The key thing is the program that calls it. for instance, the invoice SMARTFORM
LB_BIL_INVOICE is ran by the program RLB_INVOICE.
This program uses another FM to determine the name of the FM to use itself. The key
thing is that when it calls this FM (using a variable to store the actual name), that the
parameters match the paramters in your smartform.
Another thing to note is that the FM name will change wherever the SF is transported to.
Here is the code that can be use to determine the internal name of the function module:
Code:
It checks to see if the sf_label starts with a '/', which is how the internal names start. if it
does, the name has already been converted. If not, it calls the FM and converts the name.
It happens when the two printers having different Printer Controls' if you go to SPAD
Menu (Spool Administrator Menu) you can see the difference in the Printer Control and if
you 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 type used for both the output devices.
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 'blank' (for both resource
name and print mode - this is the only way to get to the back of the page).
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.
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.