Вы находитесь на странице: 1из 36

AB1009 Smartforms - v1.

India SAP CoE, Slide 1

Smartforms
1 2

Introduction Syntax Description


3

Demonstration
Exercises HelpMe

5
India SAP CoE, Slide 2

Smartforms
1 2

Introduction Syntax Description


3

Demonstration
Exercises HelpMe

5
India SAP CoE, Slide 3

Introduction
Purpose Use

India SAP CoE, Slide 4

Purpose
Smartform is a template that simplifies the process of designing business forms. You need smartform to print, distribute or display business forms. Smartform tool includes utilities for designing forms and for defining the interface to the application programs that use forms for data output. The output of application data is placed into a dynamically expandable table where the size and layout of the output table is determined by the number of records being retrieved.

India SAP CoE, Slide 5

Use
Smartform tool includes utilities for designing forms and for defining the interface to the application programs that use forms for data output. The output of application data is placed into a dynamically expandable table where the size and layout of the output table is determined by the number of records being retrieved.

India SAP CoE, Slide 6

Use of Smartform
Smartforms are used for designing and printing various types of

application documents across the various SAP modules like SD, FI, PU, IM, WM etc.

India SAP CoE, Slide 7

Smartforms
1 2

Introduction Syntax description


3

Demonstration
Exercises HelpMe

5
India SAP CoE, Slide 8

Syntax Description
Smartform has 3 driving components : Print Program, Layout Set and Function module.
1. Application Data is fetched by the Print Program from the database depending upon the selection screen parameter. 2. Function module of a Layout Set is called in a program for placement of the data.

3. The output of application document is sent to printer or mail or fax.

India SAP CoE, Slide 9

Smartform Development
To develop a smartform object one needs to develop following objects : 1. Smartform Layout : Layout decides the format of data to be displayed on the paper. Layout can be developed using Form Painter provided by SAP 4.6C. Once the smartform is activated its corresponding function module is generated by SAP. The function module name can be obtained by calling another function SSF_FUNCTION_MODULE_NAME by passing smartform name as input parameter. Transactions to use : Smartforms Smartstyles - To design our own style. 2. Print Program : Print program performs all required data selection depending upon the specified selection criteria. This program calls the function module of a smartform and passes the data to smartform function module. This function module then puts the data in a format defined by layout. Transaction to use : SE38 to develop a print program.
India SAP CoE, Slide 10

Smartform screen Components


Smartform screen is divided in following 3 components.

India SAP CoE, Slide 11

Smartform screen components


Navigation Menu This screen appears on the left of the screen.

Maintenance frame This frame appears in the middle of the screen. Form painter frame This frame appears on the right of the screen. If form painter is not visible on the screen , then choose Form Painter. You can control whether form painter is hidden or visible.

A form consists of following components :


- Pages - Output areas i.e. windows, - Graphics, - Data or text contents.

India SAP CoE, Slide 12

Node Types Overview


Smartform components are always maintained in a hierarchical manner where each component is referred as Node. Under Smartform Node 2 sub nodes are maintained : 1. Global Settings : It consists of Form Attributes, Form Interface and Global Definitions. 2. Pages and Windows : Using combination of these nodes different types of layouts can be designed.

India SAP CoE, Slide 13

Global Settings Integration with application program


1. Form attributes Contains administrative info of the form. Also defines the page format. 2. Form interface Through Form Interface application program can interact with smartform and vice a versa. It has Import, Export and Tables tab which define the set of data passed between a program and a smartform. 3. Global Definitions All the variables that are global across the smartform are declared here. Any user defined type can be declared under Types tab. Initialization tab is for initializing values ( like initializing a date to a system date ). 4. Integration application program consists of 3 parts :

a. Data selection from the database.


b. Determining the name of generated function module using SSF_FUNCTION_MODULE_NAME.
India SAP CoE, Slide 14

Integration with application program


c. Actual form processing: The generated function module is called for
each document to be created.

India SAP CoE, Slide 15

Pages
- On the pages of a form you determine the page layout and the

sequence of pages with different structures.The page layout includes the page format (for example, DIN A4, Letter, DIN A5 landscape) and the position of the windows on a page.
- The individual pages of a form may differ in their structure. For each page, you must specify a next page to make the page sequence clear. -Many forms contain only two pages of different structure: the first page, which calls the next page, and the next page, which calls itself. If the text does not entirely fit onto the second page, another document page is automatically displayed.

India SAP CoE, Slide 16

Main window and subwindows


- On a page, there are two different types of output areas for texts

and data: the main window and the subwindow.


- You can position windows anywhere on a page, even overlapping. You can position the same window (determined by the technical name) on several pages of a form, so that the same contents are displayed on all these pages. You can choose a different size for the window on each page, except for the main window. - Main Window : In a main window you display text and data, which can cover several pages (flow text). As soon as a main window is completely filled with text and data, the system continues displaying the text in the main window of the next page. It automatically triggers the page break.

India SAP CoE, Slide 17

Subwindows
- In a subwindow you display text and data in a predetermined
output area. There is no flow text display with page break. If you position a subwindow with the same name on several pages, the system displays the contents of this subwindow on each page. - Text and data that do not fit into the subwindow are truncated and not displayed.

India SAP CoE, Slide 18

Tables and Templates


- Table size is decided at runtime depending upon the type and
number of records. - Template size is determined at design time in the Form Painter. - Both tables and templates are designed with the table painter.

India SAP CoE, Slide 19

Table Painter Contd.


- Line Types : Table width is determined from line types. Line type

specifies how many lines a table line should hold and what width these cells should have.

India SAP CoE, Slide 20

Smartforms
1 2

Introduction Syntax description Description


3

Demonstration
Exercises HelpMe

5
India SAP CoE, Slide 21

Configuration
- The basic configuration required to do for smartform is creating

output type and attaching the smartform to the output type. - NACE is the transaction to set the output type. - In this transaction first the application is selected ( e.g.V1 Sales, V2 Shipping etc) - Then output type is selected. Sometimes output type is created newly if driver program and smartform are custom program and not SAP standard ones. - Whenever new output type is created , 3 parameters are required. They are : - Smartform Name - Driver Program Name - ENTRY routine name.
India SAP CoE, Slide 22

Smartforms
1 2

Introduction Syntax description Description


3

Demonstration
Exercises HelpMe

5
India SAP CoE, Slide 23

Quick Overview of Node Usage before starting with exercise

India SAP CoE, Slide 24

Successors of Node Pages and Windows


As direct successors to root node Pages and windows you can create only page nodes. The tables below describe these page nodes and the other successors:

India SAP CoE, Slide 25

India SAP CoE, Slide 26

Exercises
Let us design one smartform for Billing Document. The layout specifications and data retrieval logic has been explained in these word documents.

Layout Specification :

Data Retrieval Logic

India SAP CoE, Slide 27

Transactions
SMARTFORMS
SMARTSTYLES SO10 SE38 SE78

Create Smartform
Create style Create standard Text Create print program Upload Logo

India SAP CoE, Slide 28

Smartforms
1 2

Introduction Syntax description Description


3

Demonstration
Exercises HelpMe

5
India SAP CoE, Slide 29

Tips and Tricks in smartform


Field List on / off

1. How to debug smartform?


- To debug smartform from the starting,
put the statement BREAK-POINT in Initialization part of Global Settings.
- To debug a particular window, create flow logic -> Program Lines for that window and write statement BREAKPOINT in the code as shown in the picture.

2. How to add variables in text node?


- Click on Field List on / Off button.
This will show all the variables getting used in the smartform. Pick the required field from list, drag it towards text area and drop it at required place.

Field List
India SAP CoE, Slide 30

Additional Interface parameters in detail


The generated function module has both required and optional parameters: Required parameters: You have entered these in the SAP Form Builder. These are application data to be output or used for calculations in the form. Optional parameters. These exist for each form. They are not ready for input on the form interface tabs of the SAP Form Builder. They include: - control_parameters: General output control - output_options: Output options (see structure ssfcompop in the Dictionary) - user_settings: If set to 'X', the user defaults for spool control are used. Otherwise, the

output_options values for the printer, immediate output and spool retention period are
evaluated. - archive_index, archive_index_tab, archive_parameters: Parameters for archiving - mail_appl_obj, mail_recipient, mail_sender: Parameters of the Business Communication Interface for sending forms as e-mails. - document_output_info: Number of pages output (field tdfpages) - job_output_info, job_output_options: Structures with information on the output (for example, with XML output)

India SAP CoE, Slide 31

Configuration required for Smartform


Output Type : Output type connects the application program
and the layout. The application program actually retrieves the data and layout defines the placement of this data. To attach the layout to an application program output type should be defined.

How to define Output type : For SD module

SPRO Sales and Distribution Basic Functions Output Control Output Determination Maintain output types.

India SAP CoE, Slide 32

How to migrate the SAP scripts to Smartforms?


You can convert individual forms on the initial screen of the SAP Smartforms transaction. Steps for migration are: 1. Enter the smartforms in command node. It will take you to smartform screen.

2. Enter the name of the SAP Smartform to be created in the Form field.
3. Choose Utilities at menu bar and select Migrate SAPscript form . 4. The program first tries to find the SAPscript form in the current client ; if the form does not exist there the system looks in client 000.If you choose Enter form is migrated.

India SAP CoE, Slide 33

Downloading of Smartform
1. Go to Smartforms transaction. Specify a form name that you

want to download. 2. Select to Utilities->Download Form at menu bar. You will get a popup to specify the location where you want to download. 3. On click on Save , smartform will be downloaded in .XML format to a specified location.

Uploading of Smartform
1. Go to Smartforms transaction. To upload smartform , enter the smartform name in Form field and select Utilities->Upload Form. 2. You will get a popup to specify .XML file . Specify the file name from which you want to create a smartform.

India SAP CoE, Slide 34

Smartforms - Advantages
Smartform offers following advantages : Creating and maintaining forms require half the time. Adapting to forms without any programming techniques due to GUI. Web publishing using generated XML output. High performance when printing in large quantities.

India SAP CoE, Slide 35

How smartforms are different than Sapscripts?


1. Multiple page formats are possible in smartforms which is not the case in Sapscripts.

2. It is possible to have smartform without a main window.

3. Routines can be written within smartform tool itself.

4. Smartforms generate a function module when activated. Because of which smartform can be called from any ABAP object type and thus increases reusability.

India SAP CoE, Slide 36

Вам также может понравиться