Workshop SmartForms

Post on 18-Apr-2017

246 views 6 download

Transcript of Workshop SmartForms

IBM Global Services

© Copyright IBM Corporation 2003

Smart Forms

2

IBM Global Services

© Copyright IBM Corporation 2003

What is Smart Form

New generation tool to create & maintain Forms for mass printing Supports a printer, a fax, e-mail, or the Internet (XML) as output medium Faster development Completely GUI based, no or less programming effort involved

The SAP Smart Forms replace the SAPscript forms. SAPscript forms will also be supported in the future; you can use them without making any changes for years to come. You can use SAPscript texts in the Smart Forms. Migration of SAPscript forms into Smart Forms is supported.

3

IBM Global Services

© Copyright IBM Corporation 2003

Features

Program for data retrieval and Form Logic for formatting are separated Data flows from driver/application program to the layout through a function

module (generated when a Smart Form is activated) The form logic is represented by a hierarchy structure (tree structure) that

consists of individual nodes, such as nodes for global settings, nodes for texts, nodes for output tables, or nodes for graphics

Static and dynamic tables, triggering events for table headings and subtotals, and sorting data before output

Graphics as background or as part of the form Client independent

4

IBM Global Services

© Copyright IBM Corporation 2003

Architecture

Layout of the form – pages & windows

Individual elements – text, graphics, address, tables

Form logic to read application data from internal tables & to control process flow

Form interface to transfer application data to form definition

5

IBM Global Services

© Copyright IBM Corporation 2003

Creating Smart Forms

The transaction is 'SMARTFORMS' The transaction is 'SMARTFORMS' menu path-> ‘SAP menu->Tools->Form Printout->Smart Forms'.menu path-> ‘SAP menu->Tools->Form Printout->Smart Forms'.

Smart form can be created by either migrating an existing SAPscript or either by copying Smart form can be created by either migrating an existing SAPscript or either by copying existing smart form, apart from creating it afresh.existing smart form, apart from creating it afresh.

6

IBM Global Services

© Copyright IBM Corporation 2003

Testing/Running Smart Forms

Execute the associated function module which has the pattern, /1BCDWB/SFxxxxxxxx. Execute the associated function module which has the pattern, /1BCDWB/SFxxxxxxxx. For exact name follow the menu path (in form builder screen), 'Environment->Function For exact name follow the menu path (in form builder screen), 'Environment->Function Module Name'.Module Name'.

7

IBM Global Services

© Copyright IBM Corporation 2003

Form Builder Components Form builder of SAP Smart

Forms consist of- Navigation tree (for form

logic)- Form Painter (layout of form)- PC editor (entering texts into

output area)- Table Painter (template /

table layout) Two root nodes

- Global Setting- Pages & Windows

8

IBM Global Services

© Copyright IBM Corporation 2003

Global Setting: Form Attributes

9

IBM Global Services

© Copyright IBM Corporation 2003

Global Setting: Form Interface

Standard Import

10

IBM Global Services

© Copyright IBM Corporation 2003

Global definition

Global Data

11

IBM Global Services

© Copyright IBM Corporation 2003

Global definition

Types

12

IBM Global Services

© Copyright IBM Corporation 2003

Global definition

Field Symbols

13

IBM Global Services

© Copyright IBM Corporation 2003

Global definition

Initialization Subroutine interface - Input & Output parameters

14

IBM Global Services

© Copyright IBM Corporation 2003

Global definition

Form Routines Here, you define all your subroutines (for eg., conversion before output).

These can be accessed from 'program line' nodes or INITIALIZATION

15

IBM Global Services

© Copyright IBM Corporation 2003

Pages & Windows

2nd Node in the Tree structure Subnode ‘Page’ can be created under this node System automatically creates the first page and ‘MAIN’ window under it The basic concept of Page, Window & Text element remain the same as in

SAPScript

16

IBM Global Services

© Copyright IBM Corporation 2003

Node ‘Page’

Three main attributes- General attributes- Output Options- Background Picture

Form Painter shows the individual layout Page may be called statically or dynamically

17

IBM Global Services

© Copyright IBM Corporation 2003

PAGE: General Attributes

Give the page structure, which the subsequent page should adopt

Give the format of page counters and the way in which they are to be incremented

18

IBM Global Services

© Copyright IBM Corporation 2003

PAGE: Output Options

Tray of the printer from which papers for printing this page are to be taken

Print mode SIMPLEX, DUPLEX, or TUMBLE DUPLEX

19

IBM Global Services

© Copyright IBM Corporation 2003

PAGE : Background Picture

Name of the Graphic Objectmostly, GRAPHIC

BMAP or TIFF

dynamically determined by mentioning the field e.g., &V_CHROME&

to expand the fields, so that, parameters can be used

'Print preview' or 'print preview and print'

Higher the DPI, lesser the size (use original DPI)

20

IBM Global Services

© Copyright IBM Corporation 2003

Windows

Creating a window General Attributes of a 'window' node Output Options Conditions

21

IBM Global Services

© Copyright IBM Corporation 2003

Windows :Creating a window

22

IBM Global Services

© Copyright IBM Corporation 2003

Windows :General Attributes

This has to be opted for if the window is to be a main window.

23

IBM Global Services

© Copyright IBM Corporation 2003

Windows :Output Options

This has to be opted for, if you want a box to appear on the window

0- not filled at all, 100- black

24

IBM Global Services

© Copyright IBM Corporation 2003

Windows: Output Condition

In Smart Forms, a node and all successor nodes are processed only if the respective output condition is true

A condition can either be a logical expression on field values or consist of events or position queries in the form processing

Output Option & Condition are same for ALL nodes

25

IBM Global Services

© Copyright IBM Corporation 2003

Windows : Conditions

this symbol appears if the node has a condition defined.

click here to select comparison operator

additional conditions like, node to be executed only in first page, etc can be mentioned here

26

IBM Global Services

© Copyright IBM Corporation 2003

Successor nodes of window/page

Broadly Two categories Basic Node

- contents are actually printed (either as a part of an output area (window) or independently as part of a page

- Graphics, Address & Text

Auxiliary Node- can be used to control the flow of the layout- basically used to incorporate the Form Logic (which in case of SAPscripts was

carried out by ABAP code written in driver program)- Template, Table, Complex Section, Loop, Alternative, Program Line, Folder,

27

IBM Global Services

© Copyright IBM Corporation 2003

Graphics

Company Logo Used same way as background picture Besides TIFF, BMP file may be used Maintain Graphics using SE78

28

IBM Global Services

© Copyright IBM Corporation 2003

Address

Address node

Parameter that has the address number

This has to be given along with address number for personal address

This determines the fomat of address

29

IBM Global Services

© Copyright IBM Corporation 2003

Text

To print out any text (and table contents/ data), but not address Three types

- Text element (enter text in PC Editor)- Include Text (Standard text as in SAPScript)- Text Modules

Parameters/global fields (defined in the form interface), system fields are printed using Text node

System fields are in a structure SFSY Fields available inside the form can be seen by setting Field List- On

30

IBM Global Services

© Copyright IBM Corporation 2003

Text: General Attributes

You can append the text directly to the output of the predecessor node or start it in a new paragraph or a new line.

31

IBM Global Services

© Copyright IBM Corporation 2003

Text Modules

Central storage of texts used frequently in the forms Text maintenance separate from the form maintenance Cross-client Connected to the transport system Attached to the translation tools in the system For maintenance, use transaction SMARTFORMS Can be used in two ways –

- Refer to the text module – text appears as Read only in PC editor- Copy the text module – system copies the text of the module and automatically

converts the text node into an editable text element

32

IBM Global Services

© Copyright IBM Corporation 2003

Text Module

To copy the contents of text module, instead of referring to it. After copying, the property of text changes to 'text element'

if this is opted for, then all the paragraph formats and char formats will come from the text module's style, else, default style of Form applies

33

IBM Global Services

© Copyright IBM Corporation 2003

Maintaining Text Modules

Transaction.. SMARTFORMSTransaction.. SMARTFORMS

This is a normal PC editor where you can enter the text (fields, which are populated dynamically during run-time can also be used). the bad news is, there is no text editor here.

34

IBM Global Services

© Copyright IBM Corporation 2003

Auxiliary Nodes

 TemplateTemplate- Output of a table containing static data- Output of a table containing static data TableTable - Output of a table containing application data - Output of a table containing application data Loop Loop - Processes successor node repeatedly.- Processes successor node repeatedly. AlternativeAlternative- Branches depending on condition.- Branches depending on condition. CommandCommand - Executes special commands - Executes special commands FolderFolder- Combines successor nodes to logical groups- Combines successor nodes to logical groups Complex SectionComplex Section- Combines all attributes of the - Combines all attributes of the node node types template, table, loop, foldertypes template, table, loop, folder Program LinesProgram Lines - Executes ABAP program code - Executes ABAP program code

35

IBM Global Services

© Copyright IBM Corporation 2003

Template Tabular layout for printing

data (tabs in SAPScript !) Static, no. of rows & columns

are known before runtime (e.g. heading for tabular data)

Linetype defines the pattern of each row (no. of cells, cell width, row height)

Length of a linetype exactly same as width of Table/Template

Pictorial representation through Table Painter

36

IBM Global Services

© Copyright IBM Corporation 2003

Display data in Template/Table

Text nodes to be created under the node Text Node definition will determine in which Linetype & Cell it will be displayed

37

IBM Global Services

© Copyright IBM Corporation 2003

Displaying Table Data

Data retrieval program sends the date through the internal table in the form interface

To display, table data are to be processed in a loop Following Node Types offer Data tab which can be used to read table lines in

a loop

Loop Accesses a tableOffers tab to determine data selection, Events (header & Footer)

Table Same as Loop, in addition offers Table LayoutUsed to display a table

Complex Section Combines all the attributes of Template, Loop & TableFor advances Form developers

38

IBM Global Services

© Copyright IBM Corporation 2003

Table

Configured through three Tabs Table Tab (Display Layout)

- LineType – same as in Template Data Tab (Method of Data Retrieval)

- Internal table- Workarea- row selection &/or Where Condition- Sorting & Control Level

Events Tab- Header & Footer at section &/or page level- If set, event nodes automatically added under Table node

39

IBM Global Services

© Copyright IBM Corporation 2003

Defining Table Layout

40

IBM Global Services

© Copyright IBM Corporation 2003

Defining Method of Data Retrieval

workarea, if 'INTO', otherwise Field Symbol

specify range of line numbers; if left blank, loops through all rows

to put an 'OR' condition click on this (default is 'AND')

if any of these two checkboxes are opted for, an event node gets generated (as a successor node of this table), which will be processed, when their respective contro breaks are triggered

sorts by pernr, in ascending order

41

IBM Global Services

© Copyright IBM Corporation 2003

More about Control Breaks

this event corresponds to' 'End of Control Level' declared above

print the subtotals here

In this case, a control break event is triggered every time In this case, a control break event is triggered every time the sorted field, PERNR changes its value (so, its similar the sorted field, PERNR changes its value (so, its similar to specifying, 'On Change Of PERNR' inside a loop in an to specifying, 'On Change Of PERNR' inside a loop in an ABAP program) and we can have special tasks ABAP program) and we can have special tasks performed inside this event, like printing subtotals in a performed inside this event, like printing subtotals in a text elements (which have to be created as successors of text elements (which have to be created as successors of this event).this event).

42

IBM Global Services

© Copyright IBM Corporation 2003

Defining Events

43

IBM Global Services

© Copyright IBM Corporation 2003

Loop

Same as ‘Table’ node, except the data layout For repeated processing of successor nodes (kind of flow control)

44

IBM Global Services

© Copyright IBM Corporation 2003

Complex Section

One more Tab – General Attribute, rendering it as either Template, Loop or Table

If this is ticked, then u can loop at an internal table(inside 'DATA' tab)

neither table not template, can be used as loop

For Table, ('table' tab appears)

instead of 'table' tab, u will see a 'Temmplate' tab

45

IBM Global Services

© Copyright IBM Corporation 2003

Flow Control node – Alternative

To apply ‘IF-ELSE’ logic, if successful, successor node is executed Condition tab in each node also helps building up such logic

46

IBM Global Services

© Copyright IBM Corporation 2003

Flow Control node – Command

used to change spool settings/trigger new page/change paragraph setting/setting printer control

47

IBM Global Services

© Copyright IBM Corporation 2003

Program Lines

Free flow ABAP code opportunity To calculate subtotal or for data refinement – e.g. conversion routine Interface defined thru input & output parameter (global fields not accessible if

not defined)

48

IBM Global Services

© Copyright IBM Corporation 2003

Folder

Non executed node To group all similar nodes – to better organize the nodes in a complex Form

49

IBM Global Services

© Copyright IBM Corporation 2003

Style Builder

Style Builder is a tool used to maintain ‘Smart Style Builder is a tool used to maintain ‘Smart Styles’ where we define character formats and Styles’ where we define character formats and paragraph formats. These are not explicitly paragraph formats. These are not explicitly defined in a smart form; but, the Smart Style in defined in a smart form; but, the Smart Style in which required Formats are defined is referred to which required Formats are defined is referred to in the smart form.in the smart form.

Transaction-> SMARTSTYLESTransaction-> SMARTSTYLES

50

IBM Global Services

© Copyright IBM Corporation 2003

Where to Get More Information

SAP Online help Try ‘F1’s and ‘F4’s wherever possible