53050243 sap smartforms training material

47
7/27/2019 53050243 SAP SmartForms Training Material http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 1/47 AB1009 AB1009 ±  ± Smartforms Smartforms - v1.0 v1.0

Upload: rossienbono

Post on 14-Apr-2018

234 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 1/47

AB1009AB1009 ± ± SmartformsSmartforms -- v1.0v1.0

Page 2: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 2/47

SmartformsSmartforms

1 Introduction

2 Syntax Description

3 Demonstration

4 Exercises

5 HelpMe

Page 3: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 3/47

SmartformsSmartforms

1 Introduction

2 Syntax Description

3 Demonstration

4 Exercises

5 HelpMe

Page 4: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 4/47

IntroductionIntroduction

PurposePurpose

UseUse

Page 5: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 5/47

PurposePurpose

SmartformSmartform isis aa templatetemplate thatthat simplifiessimplifies thethe processprocess

of of designingdesigning businessbusiness formsforms.. You You needneed smartformsmartform toto

print,print, distribu

tedistribu

te or  or displaydisplay bu

sinessbu

siness formsforms..SmartformSmartform tooltool includesincludes utilitiesutilities for for designingdesigning formsforms

andand for  for definingdefining thethe interfaceinterface toto thethe applicationapplication

programsprograms thatthat useuse formsforms for for datadata outputoutput.. TheThe outputoutput

of of applicationapplication datadata isis placedplaced intointo aa dynamicallydynamically

expandableexpandable tabletable wherewhere thethe sizesize andand layoutlayout of of thetheoutputoutput tabletable isis determineddetermined byby thethe number number of of recordsrecords

beingbeing retrievedretrieved..

Page 6: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 6/47

Use of SmartformUse 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. Smartforms are used for mass printing like monthly invoices sent by

telecom companies or salary statements.

Page 7: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 7/47

SmartformsSmartforms

1 Introduction

2 Syntax description

3 Demonstration

4 Exercises

5 HelpMe

Page 8: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 8/47

Syntax DescriptionSyntax Description

Smartform has 3 driving components :Print Program, LayoutSet 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 generated

when the smartform is

activated.

3. The output of application

document is sent to

 printer or mail or fax.

Page 9: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 9/47

Smartform DevelopmentSmartform DevelopmentTo develop a smartform object one needs to develop following

objects :

1. Smartform Layout :

Can be developed in the FormPainter 

Decides the data format

Transactions to use : Smartforms

Smartstyles - To design our own style.

2. Print Program :

Performs data selection based on selection criteria

Passes data to the smartform f unction module

Transaction to use : SE38 to develop a print program.

Page 10: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 10/47

Smartform Initial ScreenSmartform Initial Screen

Page 11: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 11/47

Smartform Builder ComponentsSmartform Builder ComponentsSmartform screen is divided in following 3 components.

 Navigation Menu Maintenance Frame Form Painter  

Page 12: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 12/47

Smartform screen componentsSmartform 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 option Form Painter .

 You can control whether form painter is hidden or visible.

A form consists of following components :

-Pages -Table

-Windows -Template

-Graphics -Flow Logic

- Data or text contents -Folder 

- Address

Page 13: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 13/47

Node Types OverviewNode Types Overview

Root Nodes Global Settings

Pages and Windows.

Attributes General Attributes

Output Options

Conditions

Page 14: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 14/47

Successors of Node Pages and WindowsSuccessors 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 su

ccessors:

Successors of Node Pages and WindowsSuccessors of Node Pages and Windows

Page 15: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 15/47

Page 16: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 16/47

On the pages of a form you determine the page layout andthe sequence of pages with different str uctures.The pagelayout includes the page format (for example, DIN A4, Letter,DIN A5 landscape) and the position of the windows on apage.

The individual pages of a form may differ in their str ucture.For each page, you must specify a next page to make thepage sequence clear.

Many forms contain only two pages of different str ucture: the

first page, which calls the next page, and the next page,which calls itself. If the text does not entirely fit onto thesecond page, another document page is automaticallydisplayed.

PagesPages

Page 17: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 17/47

Main window and subwindowsMain window and subwindows

 You can position windows anywhere on a page, evenoverlapping. You can position the same window (determinedby the technical name) on several pages of a form, so that thesame contents are displayed on all these pages. You can On

a page, there are two different types of output areas for textsand data: the main window and the subwindow.

choose a different size for the window on each page, exceptfor 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 mainwindow is completely filled with text and data, the systemcontinues displaying the text in the main window of the nextpage. It automatically triggers the page break.

Page 18: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 18/47

SubwindowsSubwindows

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

tr uncated and not displayed.

Page 19: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 19/47

Tables and TemplatesTables and Templates Table size is decided at r untime depending upon the type and

number of records.

Line Types : Table width is determined from line types. Line typespecifies how many lines a table line should hold and what widththese cells should have.

Page 20: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 20/47

Table and TemplatesTable and Templates -- Contd.Contd.

Template size is determined at design time in the Form Painter.

Page 21: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 21/47

Text TypeText Type

Form Text types

Text elements

Text modules

Include texts

Dynamic texts

Page 22: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 22/47

Parameterized TextParameterized Text

In order to avoid hardcoding we canuse the concept of parameterized text. Here you can assign a text or value to a

variable or pass in a ztable and then use this variable (or table

field) directly instead of hardcoding the text or value.

e.g.

In the above example we can also pass &nast-spras& or &sy-langu& instead of hardcoding the language as µEN¶ 

Page 23: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 23/47

Event and ConditionsEvent and Conditions

Conditions: You can define

conditions for 

individual nodes, or 

for whole sub

hierarchies of thecontext.

Events:

With this option you can decide where you want to

display the text or data of that particular node.

Page 24: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 24/47

Global SettingsGlobal Settings ± ± Integration withIntegration with

application

programapplication

programForm attributes ± Contains administrative info of the form.

1)General attributes like created by, creation date, creation time.

2)Output options a) Style

b)Page format

c)Output formats(Standard/XSF/XSF+HTML).

Form interface ± Through Form Interface application (print) program

can interact with smartform and vice a versa. It has four tabs

Import

Export

Tables

Exceptions

Page 25: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 25/47

Global Definitions ± All the variables that are global across thesmartform are declared here. Here we have five tabs

Global

Data Types

Initialization Field

Symbols Form Routines.

Page 26: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 26/47

Integrating the Smart Form with theIntegrating the Smart Form with the

application

program.

application

program.

Application program consists of 3 parts :

a. Data selection from the database.

b. Determining the name of generated f unction module using

µSSF_FUNCTION _MODULE_ NAME¶.c. Actual form processing: The generated f unction module is

called for each document to be created.

The form is triggered by calling two f unction modules. The first

modu

leu

ses the name of the form to determine the name of thegenerated f unction module. Then you call this module.

Page 27: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 27/47

The name of the generated function module is unique only within onesystem. Therefore, always call the function module first that uses the formname to determine the current name of the generated function module.

Procedure to carry out in Print Program:

First define the form interface in your form and activate the form.

In the form builder call the function Environment  Function Mod ul e

Name and copy its name.

In the application program define a variable of type RS38L_FNAM for thename of the generated function module:

data fm_ name type RS38L_FNAM

Call function module SSF_FUNCTION _ MODULE_ NAME . It retur ns thename of the generated function module:

CALL FUNCTION 'SSF_FUNCTION _MODULE_ NAME'

EXPORTING

FORMNAME = '<form name>'

IMPORTING

FM_ NAME = fm_name

EXCEPTIONS

NO _FORM = 1NO _FUNCTION _MODULE = 2

OTHERS = 3.

IF SY-SUBRC <> 0.

<error handling>

ENDIF.

Page 28: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 28/47

Call the generated function module .

CALL FUNCTION fm_name

EXPORTING

* ARCHIVE_INDEX =

* ARCHIVE_PARAMETERS =

* CONTROL_PARAMETERS =

* OUTPUT_OPTIONS =

* USER_SETTINGS = 'X'

G _CARRID = <variable>

G _CONNID = <variable>

*IMPORTIN

G

* JOB_OUTPUT_INFO =

* JOB_OUTPUT_OPTIONS =

TABLES

GT_SBOOK = <internal table>

EXCEPTIONS

FORMATTING _ERROR = 1

INTERNAL_ERROR = 2

SEND_ERROR = 3OTHERS = 5.

IF SY-SUBRC <> 0.

<error handling>

ENDIF.

Page 29: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 29/47

SmartformsSmartforms

1 Introduction

2 Syntax description

Demonstration

4 Exercises

5 HelpMe

3

2 Syntax Description

Page 30: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 30/47

ConfigurationConfiguration

- The basic configuration required to do for smartform is creatingoutput 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, V2Shipping etc)

- Then output type is selected. Sometimes output type is creatednewly if driver program and smartform are custom program and notSAP standard ones.

- Whenever new output type is created , 3 parameters are required.They are :

- Smartform Name

- Driver Program Name

- ENTR Y routine name.

- Incase of FI forms, configuration is done using BTEs (BusinessTransaction Events) since NACE cannot be used to configure FIforms.

Page 31: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 31/47

SmartformsSmartforms

1 Introduction

2 Syntax description

Demonstration

4 Exercises

5 HelpMe

3

2 Syntax Description

Page 32: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 32/47

Quick Overview of Node Usage

before starting with exercise

Page 33: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 33/47

ExercisesExercises

Let us design one smartform for Billing Document. The layoutspecifications and data retrieval logic has been explained in these

word documents.

Layou

t Specification :

Data Retrieval Logic

Layout Specification

Data retrieval forbilling document 

Page 34: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 34/47

TransactionsTransactions

SMARTFORMSSMARTFORMS Create SmartformCreate Smartform

SMARTSTYLESSMARTSTYLES Create styleCreate style

SO10SO10 Create standard TextCreate standard Text

SE38SE38 Create print programCreate print program

SE78SE78 Upload LogoUpload Logo

Page 35: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 35/47

SmartformsSmartforms

1 Introduction

2 Syntax description

Demonstration

4 Exercises

5 HelpMe

3

2 Syntax Description

Page 36: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 36/47

Tips and Tricks in smartformTips and Tricks in smartform

1. Debugging smartform

2. Adding variables in text

node

Field List

Field List on / off 

Page 37: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 37/47

 Additional Additional ± ± Interface parameters in detailInterface parameters in detail

Page 38: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 38/47

Required parametersRequired parameters

Optional parametersOptional parameters

control_parameterscontrol_parameters

output_optionsoutput_options

user_settingsuser_settings

 job_output_info, job_output_options job_output_info, job_output_options

 Additional Additional ± ± Interface parameters in Interface parameters in 

detail«continueddetail«continued

Page 39: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 39/47

Configuration required for Configuration required for 

SmartformSmartform 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.

Page 40: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 40/47

How to migrate the S AP scripts toHow to migrate the S AP scripts to

Smartforms?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.

Page 41: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 41/47

Downloading of SmartformDownloading of Smartform

1. 1. Go to Smartforms transaction. Specify a form name that youGo to Smartforms transaction. Specify a form name that you

want to download.want to download.

2. Select to2. Select to U ti l itiesU ti l ities-->Downl oad >Downl oad Form at menu bar . You will get aForm at menu bar . You will get a

popup to specify the location where you want to download.popup to specify the location where you want to download.

3.O

nclick o

nSave , smartform will be dow

nloaded i

n .XM

L format3.O

nclick o

nSave , smartform will be dow

nloaded i

n .XM

L formatto a specified location.to a specified location.

Uploading of SmartformUploading of Smartform1. Go to Smartforms transaction. To upload smartform , enter the1. Go to Smartforms transaction. To upload smartform , enter the

smartform name in Formsmartform name in Formfield and selectfield and select U ti l itiesU ti l ities-->Upl oad F orm.>Upl oad F orm.

2. You will get a popup to specify .XML file . Specify the file2. You will get a popup to specify .XML file . Specify the file

name from which you want to create a smartform.name from which you want to create a smartform.

Page 42: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 42/47

SmartformsSmartforms --  Advantages 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.

Page 43: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 43/47

How smartforms are differentHow smartforms are different

than Sapscripts?than Sapscripts?1. Multiple page formats are possible in smartforms

which is not the case in Sapscripts.

2. It is possible to have smartform withou

t a mainwindow.

3. Routines can be written within smartform tool itself.

4. Smartforms generate a f unction module when

activated. Because of which smartform can be calledfrom any ABAP object type and thus increases

reusability.

Page 44: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 44/47

 Another Method to Debug a Smartform Another Method to Debug a SmartformMethod 1.Method 1.

Goto SE37 and give the f unction module name of a Smartform.Goto SE37 and give the f unction module name of a Smartform.

Open the Function ModuleOpen the Function Module

Page 45: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 45/47

GotoGoto Main ProgramMain Program

Page 46: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 46/47

It will display three includes:It will display three includes:

First Include will have the Global Data Declaration.First Include will have the Global Data Declaration.

Second Include will have the Form Interface.Second Include will have the Form Interface.

Third Include will have the Main Program.Third Include will have the Main Program.

Page 47: 53050243 SAP SmartForms Training Material

7/27/2019 53050243 SAP SmartForms Training Material

http://slidepdf.com/reader/full/53050243-sap-smartforms-training-material 47/47

Open the third Include and set the BreakOpen the third Include and set the Break--Point wherever necessaryPoint wherever necessary

Method2.Method2.

In same way we can do it through transaction SE80.In same way we can do it through transaction SE80.