2. 2
Introduction
▪ Smartforms are layouts in SAP.
▪ We design the layouts using smartforms.
▪ The transaction code to create a smartform is Smartforms.
▪ Every smartform on execution generates a function module.
3. 3
Various Parts of Smartforms
▪ Form attributes - It provides the generic information of smartform like date, time,
package etc.
▪ Form interface - The purpose of form interface is to pass input and output parameters.
▪ Global definition - It is a global part of smartform which is accessible by all the elements
of the smartform.
4. 4
Various Parts of Global Definition
▪ The various parts of global definition are as follows:
Global data - This tab is used for global declarations.
Types - This tab is used for user defined types.
Field-symbols - This tab is used to declare the field-symbols.
Initialization - This tab is used to write the logic.
Form routines - This tab is used to declare the subroutines.
5. 5
Various Parts of Global Definition(Contd.)
Currency/Quant. Fields - The purpose of this tab is to declare the currency/quantity
fields.
6. 6
Concept of Windows
▪ For every individual section of the layout, we need to create a window in smartform.
▪ We can create windows by right clicking on the page or through form painter.
▪ Every window has 4 dimensions: left, upper, width and height.
7. 7
Template in Smartforms
▪ Template is used for fixed number of rows and columns.
▪ When we need to display the static data, template is preferable.
8. 8
Table in Smartforms
▪ When number of rows are not fixed, we need to create table in smartforms.
▪ When we need to display the dynamic data, table is preferable.
10. 10
Parts of Table
1. Header - It is used to display the column/field labels.
2. Main area - It is used to display the data.
3. Footer - It is used to display the information in the footer. Example - total of amount.
11. 11
Integration of Smartform into Programs
▪ Every smartform on execution generates function module.
▪ We can call the smartform in the program through the function module of the
smartform.
▪ We need to use the SAP function module SSF_FUNCTION_MODULE_NAME to return the
function module of the smartform.
12. 12
Types of Windows
▪ There are 4 types of windows in smartforms.
1. Main window
2. Secondary window
3. Copies window
4. Final window
13. 13
Types of Windows
1. Main window - It is used for the continues output such as table output.
2. Secondary window - It is used for output with a fixed length.
3. Copies window - It is also a kind of special secondary window which is used for making
pages as copy or original.
4. Final window - It is a special kind of secondary window used for details which are
needed to be processed only at the end of processing form.
14. 14
Types of Text
▪ There are 4 types of text in smartforms.
1. Text element
2. Text module
3. Include text
4. Dynamic text
15. 15
Types of Text
1. Text element - It is not a reusable text. This text is dedicated to one smartform only.
2. Text module - It is a reusable text. It is a reusable text for smartforms.
3. Include text - It is also a reusable text. It is a reusable text for smartforms, programs etc.
4. Dynamic text - This text is used to display the text at run time in smartform.
16. 16
Ways to Debug a Smartform
▪ Put the session or external break point in the generated function module of the
Smartform.
▪ Put the BREAK-POINT (user independent break point) or Break username (user
dependent break point) in the smartform.
17. 17
Downloading & Uploading
▪ It is possible to download a smartform to presentation server(local computer).
▪ Similarly, it is also possible to upload a smartform from presentation server(local
computer).
▪ The format of smartforms download and upload is XML (extensible mark-up language).
18. 18
Creation of Graphics
▪ Transaction code to upload graphics in SAP is SE78.
▪ SAP supports BMP(bitmap) images.
▪ We need to create a graphics in smartforms to display the bitmap Image.
19. 19
Creation of Address
▪ In SAP, addresses are getting stored in to ADRC table.
▪ We can display the address in smartforms by creating an address in smartforms.
▪ Pass the address number (ADRNR), system fetches data from ADRC table based upon
that address number and display in the smartform.
20. 20
Creation of Folder
▪ It is used to combine different node into logical groups.
▪ It is used to achieve page protection in smartforms, so that everything in folder will be
printed on same page.
21. 21
System Variables in Smartforms
▪ The various system variables related to smartforms are as follows:
SFSY-PAGE - System variable for current page number.
SFSY-FORMPAGES - System variable for total page number.
SFSY-COPYCOUNT- System variable for copy count.
22. 22
Concept of Smartstyles
▪ The smartstyles is used to provide the proper font, indentation, color to the output of
smartform.
▪ The transaction code to create a smartstyle is Smartstyles.
▪ We need to create paragraph format and character format using Smartstyles
transaction code and assign in the smartforms.
23. 23
Bar Code in Smartforms
▪ We can create the bar code using the transaction code SE73.
▪ We cannot directly use a bar code in smartforms.
▪ We need to create a character format for that bar code using Smartstyles transaction
code and assign that character format in smartforms.
24. 24
Converting Smartform Output to PDF
▪ There are 2 steps to convert the smartform output to PDF.
1. Get the OTF(Output Text Format) of the smartform.
2. Convert OTF to PDF - Use the function module CONVERT_OTF to convert OTF to PDF.
25. 25
Output Types in Smartforms
▪ Output type specifies the kind of output to be produced. Example: printed form, e-Mail,
fax etc.
▪ Transaction code for the mapping of output type, smartform and driver program is
NACE.
▪ SAP standard Table for the mapping of output type, smartform and driver program is
TNAPR.
26. 26
Smartforms Translation into Other Languages
▪ Transaction code to translate a smartform into other languages is SE63.
▪ Path : Other Texts- SAPscript: Forms and Styles-SSF SAP Smart Form
27. 27
Sending Smartform PDF as an E-Mail Attachment
▪ To send the smartform PDF as an e-mail attachment, we will make use of the various
standard classes of SAP related to BCS( Business Communication Services). The various
standard classes are as follows :
CL_BCS
CL_DOCUMENT_BCS
CL_SAPUSER_BCS
CL_CAM_ADDRESS_BCS
28. 28
Sending Smartform PDF as an E-Mail Attachment(Contd.)
CL_BCS - This class is used for creating the send request, adding the recipient, sending
the document etc.
CL_DOCUMENT_BCS - This class is used for creating the document, adding the
attachment etc.
CL_SAPUSER_BCS - This class is used to create SAP users.
CL_CAM_ADDRESS_BCS - This class is used to create the external recipients
29. 29
Steps to Send Smartform PDF as an E-Mail Attachment
1. Get the BIN_FILE of the smartform.
2. Convert the BIN_FILE from XSTRING format to binary format.
3. Create the send request.
4. Create the SAP user/external user( recipient)
5. Add the recipient
6. Create the document.
7. Add the attachment.
30. 30
Steps to Send Smartform PDF as an E-Mail Attachment(Contd.)
8. Set the document
9. Activate/deactivate immediate sending
10. Send
11. Commit
31. 31
Q & A
We can run a smartform without main window.
Answer : Yes, we can run a smartform without main window.
What is the transaction code to create a include text?
Answer : SO10
What is the function module to display a include text?
Answer : READ_TEXT
32. 32
Q & A
What is the pre-defined table type for dynamic text?
Answer : TSFTEXT
What is the full form of OTF?
Answer : Output Text Format.