©SAP AG 2009
HR280
Smart & Adobe Forms in HCM
THE BEST-RUN BUSINESSES RUN SAP © SAP AG 2009
HR280
Smart & Adobe Forms in HCM
SAP ERP Course version 92
©SAP AG 2008
Copyright
Copyright 2008 SAP AG. All rights reserved.
No part of this publication may be reproduced or transmitted in
any form or for any purpose without the express written
permission of SAP AG.
Some of the software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.
Microsoft, Windows, Excel, Outlook and PowerPoint are registered trademarks of Microsoft Corporation.
IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, iSeries, pSeries, xSeries, zSeries, System i, System i5, System p, System p5, System x, System z, System z9, z/OS, AFP, Intelligent Miner, WebSphere, Netfinity, Tivoli, Informix, i5/OS, POWER, POWER5, POWER5+, OpenPower and PowerPC are trademarks or registered trademarks of IBM Corporation.
Adobe, the Adobe logo, Acrobat, PostScript and Reader are trademarks or registered trademarks of Adobe Systems Incorporated in the USA and/or other countries.
JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology developed and implemented by Netscape.
MaxDB is a trademark of MySQL AB, Sweden.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned here are the trademarks of their respective owners. Data contained in this document is used for information purposes only. Product specifications may vary from country to country.
The information contained in this document is the copyrighted property of SAP AG. No part of this document may be reproduced or transmitted in any form or for any purpose without the express written permission of SAP AG.
This document is a preliminary version and it is not subject to your license agreement or any other agreement with SAP. The information contained in this document describes projected strategies, developments and functions of the SAP® product only, and in no way represents an obligation on the part of SAP AG to follow a particular company plan, a particular product strategy and/or particular development work. Note that this document is subject to change and SAP can make changes at any time without notice.
SAP assumes no responsibility for errors or omissions in this document. SAP assumes no responsibility for errors or omissions in the information, texts, graphics, links or other elements of this material. This document is provided without a warranty of any kind, either express or implied. This applies to (among other things) the fitness for a particular purpose or to exclusion of rights violations.
SAP assumes no responsibility for damages of any kind. These include (among other things), direct, special, indirect or consequential damages that arise from using these materials. These limitations shall not apply in cases of intent or gross negligence.
The statutory liability for personal injury and defective products is not affected. SAP cannot control the information that you access using the links contained in this document. Furthermore, SAP assumes no responsibility if you visit such third-party websites or for any set of circumstances involving third-party websites.
©SAP AG 2008
Unit 1 HR Metadata Workplace Unit 2 HR Forms Workplace
Unit 3 Adobe Interactive Forms in SAP ERP 6.0 – Overview Unit 4 Adobe Interactive Forms in SAP ERP 6.0 – Technical Part Unit 5 Adobe Interactive Forms in SAP ERP 6.0 – Practical Part
Preface
Course Content
©SAP AG 2008
Contents:
Overview of HR Forms Workplace
HR Metadata Workplace
©SAP AG 2008
Overview of HR Metadata Workplace: Unit
Objectives
At the conclusion of this unit, you will be able to:
Explain the process of creating HR forms and the
HR metadata model
Enhance the HR metadata model to provide
©SAP AG 2008
Overview of HR Metadata Workplace: Business
Scenario
You would like to recreate the form for the
remuneration statement with HR Forms to include the
weekly and monthly working times from the planned
working time infotype.
©SAP AG 2008
Overview of HR Forms Workplace: Unit Overview
Diagram
Unit Heading
Lesson 1: Overview of HR Forms Workplace
©SAP AG 2008
Overview of HR Forms Workplace: Unit Objectives
At the conclusion of this lesson, you will be able to
Describe the process of creating HR forms
©SAP AG 2008
Overview of HR Forms Workplace: Business
Scenario
You would like to recreate the form for the
remuneration statement with HR Forms. To do this,
you first need an overview of this tool.
©SAP AG 2008
HR Data Sources
z
Master data
z
Payroll
z
Time management
z
Other HR appl.
z
Function modules
The payroll form is created on the basis of the payroll results. This means that it is possible reprint remuneration statements that have already been created as often as required for previous payroll periods. The standard form is called SAP_PAYSLIP.
©SAP AG 2008
The Process of Creating HR Forms
Data selection and data retrieval with the Forms Workplace
Form logic and layout with SAP Smart Forms
(Form Builder) InfoNet InfoStar3 InfoStar1 Smart Form HR Form
Catalog of international and country-dependent data sources
MetaNet
MetaStar1 MetaStar2 MetaStar3
There are three basic steps in the process of creating a form:
1. Compile a catalog containing the required data from the master data and the payroll and time evaluation results
2. Select data from the catalog to be used in the forms
3. Prepare and arrange the graphical layout of the data selected
You use the HR Metadata Workplace for the first step and the HR Forms Workplace for the second. You can arrange the graphical layout with SAP Smart Forms.
The following two fundamental approaches can be taken when creating forms: You can create a new form from scratch or copy an existing form from the SAP standard delivery and adapt it to suit your requirements.
©SAP AG 2008
MetaNet
MetaNet
MetaFields MetaDimension1 MetaStar 1 MetaFields MetaDimension3 MetaDimension5 MetaDimension2 MetaDimensions MetaStar 3 MetaDimension4 MetaFigures MetaDimensions MetaFields MetaFields MetaDimensions MetaFigures MetaFields MetaStar 2 The MetaNet is a view showing the printable data in the ERP system. A MetaNet comprises all HR data sources that can be used in the process of creating forms and is provided by SAP for the remuneration statement. All data to be included on a form must be contained in the MetaNet.
The metadata in the MetaNet describes the printable HR data and the way in which this data is retrieved in the form of a catalog. You can edit this catalog with the HRFORMS_METADATA transaction. You define this metadata and save all required reading information in the Metadata Workplace. This
information is used at a later stage to generate the Data Dictionary structures on an HR form.
Each country has its own view of this data in HR since each country has its own country-specific data sources. Every country version contains the international part of the MetaNet.
©SAP AG 2008 Key MetaFields MetaDimension Key MetaFields Key MetaFields MetaDimension Key MetaFields MetaDimension
MetaStar
MetaStar
MetaDimensionKey Key Key Key
MetaDimensions MetaFigures
A MetaNet, together with its MetaStars, forms the catalog that contains all of the data used to create forms. It is a view of the data that can be read from a particular data source in the ERP system.
A MetaStar contains information revealing where the data comes from and how it has to be read. In the simplest case, the data is read directly from table fields. In most cases, however, reading the information is more complicated and function modules are used.
For example, one MetaStar might contain payroll payments/deductions, while another contains data pertaining to the absence type. It is both advisable and feasible to have different MetaDimensions for each of these MetaStars. For deductions, for example, the type of deduction (taxes or benefits-related deductions), and for the absence type, when the absence occurred and the amount that was paid to cover it.
©SAP AG 2008
MetaDimension
MetaStar
MetaDimensions MetaFigures
MetaDimensions and MetaFigures are used to describe a MetaStar. A MetaDimension is a full description of a business object or concept and comprises MetaFields,which are either key fields or attribute fields.
MetaDimensions and MetaFigures with their relationships make up a MetaStar and can be used in several MetaStars.
For example, the EMPLOYEE MetaDimension contains an employee's personnel number, name, address, and date of birth, while the WAGETYPE MetaDimension contains wage type data.
©SAP AG 2008
MetaFigure
MetaStar
MetaDimensions MetaFigures
A MetaFigure is a key figure that can be used in several MetaStars. When a key figure is connected to a unit, this unit is also part of the MetaFigure, for example an amount with currency (5 USD).
MetaFigures and MetaDimensions with their relationships make up a MetaStar and can be used in several MetaStars.
©SAP AG 2008
Overview of HR Forms Workplace: Summary
You are now able to:
Describe the process of creating HR forms
©SAP AG 2008
HR Metadata Workplace: Unit Overview Diagram
Unit Overview
Lesson 1: Overview of HR Forms Workplace
©SAP AG 2008
HR Metadata Workplace: Lesson Objectives
At the conclusion of this lesson, you will be able to
Enhance the HR metadata model to provide
©SAP AG 2008
HR Metadata Workplace: Business Scenario
The weekly and monthly working times from the
planned working time infotype are to be included
in the remuneration statement.
©SAP AG 2009
HR Metadata Workplace
If you create your own MetaNet, define that the MetaStars are inherited from the SAP_DEFAULT MetaNet. In this case, any changes to the SAP_DEFAULT MetaNet are also transferred to your MetaNet.
You process the MetaNet and the meta objects presented earlier with the HR Metadata Workplace. The metadata is displayed there in four overview trees:
• MetaFigures • MetaDimensions • MetaStars • MetaNets
You can hide trees and any settings you have changed remain intact. You have to display hidden trees again the next time you call the Metadata Workplace if required.
If you want to enhance the metadata, copy the SAP standard MetaNet for your country to the customer namespace. Alternatively, you can create a new MetaNet that inherits the MetaStars from the standard MetaNet.
Note: When you are maintaining metadata, the transaction is locked for all other users since the objects are dependent on each other.
©SAP AG 2008
CUMULATED_PAY MetaStar
Key field Attribute field Inherited object Legend Here, you can see the CUMULATED_PAY MetaStar (cumulated payroll results) in the forth column as part of the ZHR280 MetaNet.
The MetaDimensions that make up the CUMULATED_PAY MetaStar can be seen in the MetaStars column. The WAGETYPE MetaDimension consists of the COUNTRY and WAGETYPE key fields and the LONGTEXT and SHORTTEXT attribute fields (see also the MetaDimensions column), as well as the PAY_AMOUNT and PAY_NUMBER MetaFigures.
©SAP AG 2008
MetaStar Types (1)
A MetaStar is attributed a particular type. The CUMULATED_PAY MetaStar has type Payroll. For each type, different reading information is required to generate the program. If a MetaStar is used in
a form, an internal table is created for the MetaStar when the print program is generated.
The line structure specified determines the structure of the internal table of the print program. Once the print program has filled the table with the function module specified in the Read Function field, it has to read the MetaDimensions and MetaFigures from each row of the table.
You specify the information required here on the MetaDimensions, MetaFields, and MetaFigures tab pages.
©SAP AG 2008
MetaStar Types (2)
Depending on the MetaStar type, further information may be required to read the data. In the case of the Master data type, data is read directly from the infotype using the
HR_READ_INFOTYPE function module. These MetaStars, as well as those of the Time Evaluation Data type, are filled and processed in the print program at the time of GET PERNR.
MetaStars of the Payroll type are filled and processed on the basis of the payroll results at the time of GET PAYROLL.
Person-dependent data that does not belong to master data or payroll data is identified with Special type A.
Special type U is used for data that is not person-dependent. It is read at the time of START-OF-SELECTION.
©SAP AG 2008
MetaDimensions and MetaFields
MetaDimensions and MetaFigures are used to describe a MetaStar (the CUMULATED_PAY MetaStar has been selected in the example above). The MetaDimension is the full description of a business object or concept. A MetaDimension can be used in more than one MetaStar.
The MetaDimension consists of several information fields known as MetaFields. A MetaField is either a key field of a MetaDimension or an attribute that constitutes a further property of the MetaDimension.
©SAP AG 2008
MetaFields and MetaFigures
The MetaFigure is a key figure that can be used in several MetaStars. If it is connected to a unit, this unit is also part of the MetaFigure.
The tables created on the basis of the MetaStar are filled in the generated print program through the COLLECT ABAP statement. If the Cumulate Values indicator has been set, the values are cumulated if the key fields of the internal table are the same. If this indicator has not been set, the MetaFigure is treated as a key field of the table, that is to say, different values in this MetaFigure result in separate rows in the table.
©SAP AG 2008
Create Customer-Specific MetaDimension (1)
To provide additional information in the MetaNet, you want to include the working times (per week and per month) from infotype 0007. You want this information to be included in the MetaNet as a customer-specific MetaStar.
First, you need a MetaDimension with the required information from infotype 0007. This can be created directly from the metadata overview screen. The MetaDimension for the start and end date is already defined in the standard delivery as DATE_RANGE.
Since the information is obtained from the master data, a function module is not needed to read the data. If the Always Read w/ MetaStar indicator has been set, the attributes of the MetaDimension are filled
when the MetaStar is read. However, this is not necessary if the key of the MetaDimension has been created correctly.
©SAP AG 2008
Create Customer-Specific MetaDimension (2)
You can create MetaFields by right-clicking on the MetaDimension (see the context menu above). You can then see what you have created on the MetaFields tab page. Fields ZWT_MOSTD and
ZWT_WOSTD have been created.
You must then specify a data element for each of the new fields in the Field Type column. In the example above, the data elements MOSTD and WOSTD have been specified. This entry results in both fields being defined as key fields.
If you create your own MetaDimensions, define whether a field is a key field or an attribute (click on the icon in the Key column). There are two options for key fields:
a) Validity of selection options:
This allows you to define whether all possible uses of a given dimension are to be linked to the same selection conditions in the form or not. You can enter global (InfoNet-wide) or local here.
©SAP AG 2008
Create Customer-Specific MetaStar (1)
The Master data routines are used to read data from the customer-specific MetaStar for the specified infotype 0007.
©SAP AG 2008
Create Customer-Specific MetaStar (2)
You assign the DATE_RANGE standard MetaDimension and customer-specific ZWT_0007 to the customer-specific MetaStar that has already been created by means of drag and drop.
In addition, you have to assign the MetaFields with the read infotype's table fields, which can be selected from the input help shown.
©SAP AG 2008
Enhance MetaNet with Your Own MetaStar
Copy your MetaStar to the MetaNet by means of drag and drop to enhance it with the required data from infotype 0007.
©SAP AG 2008
HR Metadata Workplace: Summary
You are now able to:
Enhance the HR metadata model to provide
©SAP AG 2008
Overview of HR Metadata Workplace: Summary
You are now able to:
Explain the process of creating HR forms and the
HR metadata model.
Enhance the HR metadata model to provide
©SAP AG 2008
Contents:
Create Form
Pages and Windows
Data on the Form
Texts on the Form
Tables and Templates
Flow Control
©SAP AG 2008
HR Forms Workplace: Unit Objectives
At the conclusion of this unit, you will be able to:
Set up a form for the remuneration statement with
different windows, a logo, and a flow logic to
output retroactive accounting wage types
©SAP AG 2008
HR Forms Workplace: Business Scenario
Your company wants to redesign the
remuneration statement so that it has the company
logo, employee's personal data,
gross wage types, statutory deductions, and
net wage types on it in a well arranged layout. The
wage types that have resulted from
retroactive accounting from the previous period
are to be shown on a separate page.
©SAP AG 2008
Create Form: Unit Overview Diagram
Lesson 3: Data on the Form Lesson 4: Texts on the Form Lesson 5: Tables and Templates Lesson 6: Flow Control
Unit Overview
Lesson 1: Create Form
©SAP AG 2008
Create Form: Unit Objectives
At the conclusion of this lesson, you will be able to
Create a form for the remuneration statement
Set up the InfoNet with selections
Control the selection of data
Create global data definitions
©SAP AG 2008
Create Form: Business Scenario
Your company wants to redesign the form for the
remuneration statement using the HR Forms
Workplace.
©SAP AG 2008
Process Steps for Creating HR Forms
1.
Select data
2.
Generate an ABAP Dictionary structure
3.
Create the SAP Smart Form
4.
Generate the print program
Data selection and data retrieval with the Forms Workplace
Form logic and layout with SAP Smart Forms
(Form Builder) InfoNet InfoStar3 InfoStar1 Smart Form HR Form
Catalog of international and country-dependent data sources
MetaNet
MetaStar1 MetaStar2 MetaStar3
Select data
First, you select and logically group (business-related grouping) the part from the MetaNet that is later to be printed on the form.
The result is the InfoNet.
Generate an ABAP Dictionary structure
The HR Forms Workplace generates an ABAP Dictionary structure from the InfoNet containing the selected data. This structure will later act as an interface between the generated print program and SAP Smart Forms.
Create the SAP Smart Form
Next, you have to arrange the information from the generated ABAP Dictionary structure on the form and format it. The result is an SAP Smart Form. A function module is generated on the basis of this SAP Smart Form with the interface to the generated ABAP Dictionary structure. Form output is created from this interface using form logic.
Generate the print program
The HR Forms Workplace then generates a print program from the data structure and the SAP Smart Form. This program generates internal tables from the defined data structure, fills them with data from the system, and then calls the SAP Smart Form function module. The print program is an ABAP report that can be executed independently. Status management is performed in the HR Forms Workplace.
©SAP AG 2008
Objects of an HR Form
An HR form consists of several parts, which are shown here in an
example of a customer-specific form called Zform:
/1pyxxfo/Zform_prnt Print program
zpyxxfo_Zform SAP Smart Form
/1pyxxfo/Zform ABAP Dictionary structure
Zform
InfoNet (form name)
Name
Object
In the example here (form 'Zform'), the names shown above are generated for the individual objects. The objects and in particular the naming conventions are extremely important when you create a form manually. In this case, the names have to be altered in the right places.
©SAP AG 2008
Tools for Configuring the Form
HR Forms selects the data to be printed from the database.
HR Forms
Data is prepared for printing in SAP Smart Forms.
SAP Smart Forms
Database
+
The combination of HR Forms and SAP Smart Forms offers considerable benefits:
• It is simpler to adapt a form, firstly because the tools offer more functions (for example, the SAP Smart Forms Table Painter allows you to create tables with great ease), and secondly because the interface between form and application program is better laid out.
• You do not have to use special script language commands to realize particular requirements, for example additional data retrieval within the form. In addition, you can insert normal ABAP coding.
©SAP AG 2008
HR Forms Workplace (2)
The structure of the HR Forms Workplace is divided into three
parts:
Initial screen with overview of all HR forms (HR Forms)
Maintenance screen for data structure (HR Forms)
Maintenance screen for layout (SAP Smart Forms)
You can call up the HR Forms Workplace with transaction HRFORMS. In the HR Forms Workplace, you select the data to be printed from HR.
You design the layout in SAP Smart Forms, which you can call up directly from HR Forms by choosing the Layout button.
©SAP AG 2008
HR Forms Workplace: Initial Screen
All HR forms are displayed on the initial screen with the SAP List Viewer. Each line in the table represents an HR form. Each form has a name, a status, and information about changes.
The status is also indicated by a symbol at the start of the line. The symbols have the following meaning:
• Red – inactive form • Green – active form
You can change the appearance of the initial screen: • Show or hide columns containing information • Set filters
• Sort the HR forms
©SAP AG 2008
HR Forms Workplace: Data Structure
InfoNet InfoStar InfoDimension InfoFigure MetaNet MetaStar MetaDimension MetaFigure MetaNet tree
data to be provided for the purpose of printing
InfoNet tree data to be printed
Detailed information about InfoNet tree
You choose the data that is required on the form from the overview tree of the MetaNet. To do so, select the MetaStars, MetaDimensions, and MetaFigures in the MetaNet overview tree. You can then move the selected objects to the right-hand side of the screen into the InfoNet overview tree by means of drag and drop.
In this way, the objects corresponding to the objects in the MetaNet are created in the InfoNet. The InfoNet overview tree contains the data that you have selected to be printed. You can arrange this
data on the form and add formatting at a later stage. Additional information is provided on the individual tab pages for each node in the overview tree.
The MetaNet is a technical grouping, while the InfoNet is a business-related grouping of available data. The InfoStars tab page provides an overview of the InfoStars contained in the InfoNet of the form as
©SAP AG 2009
Create the InfoNet
You create the InfoNet in the HR Forms Workplace editor.
Using drag and drop, you move the required data (MetaStars, MetaDimenions, MetaFields, and MetaFigures) from the MetaNet to the InfoNet of the new form.
The statuses for the DDIC structure, the SAP Smart Form, the print program, and the HR Form are still inactive at this time.
InfoStars can contain the same InfoDimensions and InfoFigures. Their business significance varies on the basis of the wage types selected.
©SAP AG 2008
Insert Selections
There are two ways to further restrict the data you have selected.
• Variable selection, which is redefined every time the HR form is printed. • Fixed selection, which is specified when the form is designed.
In the example form, select the payroll period and personnel numbers using the selection screen of the subsequent print program with variable selections.
You can restrict the value area with the fixed selection by choosing the Insert Selection pushbutton. In the form shown here, the wage types to be printed are restricted to /101 (total gross), /559 (bank
transfer), and the wage type range from M000 to M400.
By choosing the Layout pushbutton, you exit HR Forms and enter SAP Smart Forms. At the same time, the ABAP Dictionary structure is generated and the Smart Form created.
©SAP AG 2009
HR Form Attributes
You can find and enter general information on the HR Form tab page. This is where the form class is specified (remuneration statement, time statement, other forms), and also where you choose the layout editor to be used.
If you choose flat structure in the Star Structuring field, the InfoStar tables also contain attribute fields. This means you do not have to execute LOOP statements to represent associated data. The HR Forms Workplace executes these automatically after it has read the data. The InfoDimension tables are available in both layout editors but are no longer required for the form. This considerably simplifies the process of creating a form.
In the Form Parts area, you can see the names and generation status of the previous mentioned HR form objects. Here, the following steps have already been performed successfully: Creation of the ABAP Dictionary structure (takes place when layout editor is called), form definition, and print program. You can make adjustments to the selection screen on the Select. Screen tab page. If the form class is a
©SAP AG 2008
Verify the Data Selection
Once you have created the InfoNet and activated everything, choose Form → Print Program (Test), to start the program and to check the data selection.
The print program selection screen appears.
Use an employee with payroll results and choose Execute. An overview tree containing the generated internal tables appears on the left-hand side and the table content is displayed on the right.
The example on the slide shows the relationships between the star and dimensions tables. You can see the STAR_PAY_RESULT table with the amounts. Each amount is characterized by the EMPLOYEE, INPERIOD, and WAGETYPE dimensions.
©SAP AG 2008
SAP Smart Forms: Form Interface
HR interface Field list
When an application program calls up an SAP Smart Form (or rather, the generated function module of the form), it must be possible to communicate with it. Data must be sent to the form and be returned by form to the calling program. All data is exchanged through the interface of the form. You define the interface in the global settings of the Form Builder.
All parameters of the interface are global, which means they are recognized in all nodes of the form. The HRDATA parameter can be found under the Form Interface node. This parameter represents the
HR data selected.
The other parameters are predefined by SAP Smart Forms. They contain print and archiving parameters. The associated type of the HRDATA parameter is the generated ABAP Dictionary structure of
HR Forms. The structure name consists of the namespace /1PYXXFO/ and the name of the HR form. In this case, the name is /Z99_PAYSLIP.
Choose Field list on/off to display the ABAP Dictionary structure as an overview tree.
You can use drag and drop to select fields to be printed from this list during subsequent processing steps.
©SAP AG 2008
SAP Smart Forms: Global Definitions
Here, you define the work areas required in form processing as line types of the tables. These are filled in a loop and output on the form.
The work area variables (WA_...) for use within the form relate to the structure of the HR form. Typing must relate to the dictionary structure generated. The name of the structure follows the naming
convention /1pyxxfo/Zform, with Zform standing for the name of the form you have created. It is useful to call up the generated dictionary structure (SE11) in a separate session when you are
creating the global definitions. That way, you can see the names of the components that you want to use (STAR_name or DIM_name).
Variables entered on the Global Data tab page are recognized in the entire form and can, for instance, be used as work areas of tables or loops.
©SAP AG 2008
Create Form: Summary
You are now able to:
Create a form for the remuneration statement
Set up the InfoNet with selections
Control the selection of data
Create global data definitions
Exercises
Unit: HR Forms Workplace
Lesson: Create Form
At the conclusion of this exercise, you will be able to: • Create a form for the remuneration statement • Set up the InfoNet with selections
• Control the selection of data • Create global data definitions
Your company wants to redesign the form for the remuneration statement using HR Forms.
1-1 Create a new form by copying the template called ZHR280_G00_EXE1. Call your form ZHR280_G##_EXE1 (## = group number).
1-1-1 Create an InfoStar called PAY_RESULT with InfoDimensions EMPLOYEE, FORPERIOD, and INPERIOD.
1-1-2 Create an InfoStar called PAY_RETRO (retroactive accounting wage types) with InfoDimensions EMPLOYEE, EVALCLASS02, FORPERIOD, INPERIOD, WAGETYPE, and InfoFigures PAY_AMOUNT, PAY_NUMBER, and PAY_RATE.
1-2 Create selections for wage types.
1-2-1 In the PAY_NET InfoStar, add the following selections for the WAGETYPE InfoDimension: /110, /550, /551, /552, and /560.
1-3 Create the global definitions required for form processing.
1-3-1 Add the WA_RESULT and WA_RETRO work areas and generate the form. 1-4 Test the form and check the data selected.
1-4-1 Test the form with the payroll period, payroll area, and personnel number provided by your instructor.
Solutions
Unit: HR Forms Workplace
Lesson: Create Form
1-1 Create a new form by copying the template called ZHR280_G00_EXE1. Call your form ZHR280_G##_EXE1 (## = group number).
Call up transaction HRFORMS by entering it in the command field. Select the copy template and copy it as a local object.
1-1-1 Open the PAY_RESULT MetaStar in the MetaNet and move it to the InfoNet by drag and drop.
Copy the MetaDimensions specified by clicking on them in the MetaNet and moving them to the PAY_RESULT InfoStar by drag and drop.
1-1-2 Click on the PAY_RESULT MetaStar in the MetaNet and move it to the InfoNet again by drag and drop.
Click on the PAY_RESULT1 InfoStar, go to the InfoStar tab page, and enter PAY_RETRO as the new name in the InfoStar field. Enter Retroactive
Accounting Wage Types as the description.
Copy the MetaDimensions and MetaFigures specified by clicking on them in the MetaNet and moving them to the PAY_RETRO InfoStar by drag and drop. 1-2 Create selections for wage types.
1-2-1 In the InfoNet, open the PAY_NET InfoStar and click on the WAGETYPE
InfoDimension. Choose Insert Selection in the context menu and enter the specified wage types on the Selections tab page.
1-3 Create the global definitions required for form processing.
1-3-1 Choose layout processing for the form (Layout pushbutton). Double-click on
Global Definitions in the Global Settings folder. Make the entries listed in the table
below.
Check the form in the SAP Form Builder and activate it if there are no errors. Exit the Form Builder and activate your form in the Change HR Forms view.
Field Name or File Type Entries WA_RESULT WA_RETRO TYPE LINE OF /1PYXXFO/ZHR280_G##_EXE1-STAR_PAY_RESULT TYPE LINE OF /1PYXXFO/ZHR280_G##_EXE1-STAR_PAY_RETRO
1-4 Test the form and check the data selected.
Choose menu path Form → Print Program (Test) in the Change HR Forms view. 1-4-1 On the selection screen, enter the payroll period, payroll area, and personnel
number provided by your instructor. Choose Execute. Take a look at the data for one of the entries in the ALV list, for example the DIM_WAGETYPE component.
©SAP AG 2008
Lesson 3: Data on the Form Lesson 4: Texts on the Form Lesson 5: Tables and Templates
Lesson 6: Flow Control
Pages and Windows: Unit Overview Diagram
Lesson 1: Create Form
Lesson 2: Pages and Windows
©SAP AG 2008
Pages and Windows: Unit Objectives
At the conclusion of this lesson, you will be able to
Create secondary windows with the Form Painter
Insert a graphic with the company logo
©SAP AG 2008
Pages and Windows: Business Scenario
The personal data of the employee is to appear in a
window with a box on the remuneration statement
form.
The company logo is to be included in top right
corner of every page.
©SAP AG 2008
SAP Smart Forms: Areas of the Form Builder
Form ZPYXXFO_PAYSLIP Global Settings
Pages and Windows FIRST First Page
LOGO Company Logo MAIN Main Window TITLE Title HEADER Header
NEXT Next Page
Navigation Tree
SAP Form Builder: Change Form ZPYXXFO_Z99_PAYSLIP Form Painter Attributes MAIN Main window Window Meaning Maintenance Screen
Main window MAIN TITLE
ADDRESS EE_DATA
Form Painter ADDRESS Address
EE_DATA Data
The following pages about SAP Smart Forms provide details of the parts of the flow logic that are particular to HCM. The entire range of functions is covered in the BC470 training course.
You use the graphical SAP Form Builder to edit forms using SAP Smart Forms. The SAP Form Builder consists of three areas:
• The left area of the Form Builder is a navigation tree showing the hierarchy of all elements in the form, including the windows that can be seen on the right side of the Form Painter. Each form element is represented by a node in the navigation tree. These nodes guide how the form is processed; they are used to control all of the functions in the form. Below the navigation tree, you can also show the field list of variables.
• The central area contains the maintenance screen, which shows the attributes of the node that is currently selected. This is also where the user normally enters data, for example text in the text editor
©SAP AG 2008
The Navigation Tree
Form ZPYXXFO_Z99_PAYSLIP
Pages and Windows Global Settings
Form Attributes Form Interface Global Definitions
FIRST First Page
LOGO Company Logo MAIN Main Window TITLE Title
Three types of direct subnodes of a page
Subsequent node to LOGO
All of the elements on a form are represented by a node in the navigation tree.
Subnodes "inherit" attributes from higher-level nodes, for example their style. If a node is not processed, none of its subnodes are either. A subsequent node of a node, on the other hand, is dependent on the node that precedes it. It is processed sequentially after the preceding node.
If a node has other subnodes, you can expand its structure by clicking on the triangle symbol beside the node icon. You can select a node for editing by double-clicking it. The system then displays the node in the maintenance screen and in the Form Painter (provided the Form Painter is activated).
Below the top node, you always find the following two nodes: Global settings. These include:
• Form attributes: For example, administration information and basic settings for formatting. • Form interface: The fields to be filled by the application program or returned to the application
program must be defined here.
• Global definitions: Here you can define additional fields to be used in the form. • Pages and Windows
©SAP AG 2008
Form Attributes: General Attributes
active Name
Meaning
General Attributes Output Options
Creation/ change info
Package
Language
Translate
Into All Languages Into Selected Languages Do Not Translate ZPYXXFO_Z99_PAYSLIP Remuneration statement Status Connection to Transport Organizer
The form attributes include not only the name and description of the form but also its current status:
active or inactive. A form can exist in either of these two versions. Application programs always use the
active version. This means that you can provisionally save your changes without directly affecting application processing. To activate a form, choose Form → Activate. Note that when you copy a form, the status of the copy is always set to inactive.
Since SAP Smart Forms are connected to the transport system of the SAP system, they must be assigned to a package. You do this when you first save your form.
Every form has an original language. The General Attributes tab page allows you to define whether you want to translate the form into other languages, and if so, which ones.
As of SAP Web Application Server 6.20, you can indicate in the Restricted Language Control field that the logon language is not to be used for missing texts.
©SAP AG 2008
Form Attributes: Output Options
Page format
Chars. per inch
Lines per inch
Style
XML output Name
Meaning
General Attributes Output Options ZPYXXFO_Z99_PAYSLIP Remuneration statement
CH LN
The page formats available include the page formats provided in spool administration. The orientation (portrait or landscape) is set individually for each page.
You can determine which page format is proposed for a new form as follows: Go to the initial screen of transaction SMARTFORMS and choose Utilities → Settings → tab page General.
You must assign a style to each form. A style is a collection of different character and paragraph formats, which are then used in the form. However, you can specify a separate style for most subnodes, which then overrides the default setting of the form. Various styles exist in the system with root name HR*.
Characters per inch (CPI). This field allows you to determine the CH unit of measure that you can use for horizontal length specifications (such as window widths) in the form. If you enter the default value 10, 1 CH is equivalent to one tenth of an inch, that is, approximately 2.5 mm.
Similarly, the Lines per inch field allows you to determine the LN unit of measure that you can use for vertical length specifications (such as window lengths) in the form.
The standard output format for printing is OTF (Output Text Format). A certified XML interface is provided, called the SAP Smart Forms XML Interface (XSF).
©SAP AG 2008
Pages
Pages and Windows FIRST First Page
MAIN Main Window INFO Administrator NEXT Next Page
LOGO Company Logo
Create Cut Copy Paste Delete –––––––––––––– Expand Collapse Technical name: A-Z, 0-9, _, % Description
Top page in the tree →first page in the
document
Each form consists of at least one page.
A page is represented by a node in the navigation tree. As with any other node types (such as texts or tables), right-clicking the mouse on an existing page opens a context menu with the available options: • Create or delete (in change mode only). When you create a new page, the system proposes a unique
technical name, which you can change if you wish. Note that when you delete a node, all subnodes on the respective page are also deleted.
• Copy to clipboard; cut and insert into clipboard; paste from clipboard. All subnodes are also affected. • Expand or collapse the page in the tree.
The same functions can be accessed under menu path Edit→ Node and Edit→ Subtree.
©SAP AG 2008
Page Attributes
Page FIRST
Meaning First Page
Output Options
Output Options Background PictureBackground Picture General Attributes General Attributes Next page Numbering Format Mode Page orientation Resource name
Print mode TRY01TRY02
TRY03 Default S Simplex D Duplex T Tumble Initialize counter Increase counter
Leave counter unchanged
Page and overall page unchanged 1, 2, 3
I, II, III i, ii, iii A, B, C a, b, c
You can make settings on the following tab pages:
General Attributes
• Next page. The default value is the page itself.
• The type of automatic page numbering. You can choose between Roman and Arabic numerals, upper case and lower case, and determine the behavior of the page counter. Note that if you make page number settings, this does not mean that the pages are automatically numbered. You have to output the SFSY-PAGE variable in a text window to have your pages numbered.
Output Options
• While the page format you specify applies to the entire form, you set the orientation (portrait or landscape) for each page.
• You can assign different paper trays to pages, provided you printer supports this feature. This is useful, for instance, if you want to use your company letter head for the first page of a form and normal printer paper for all other pages.
• You can set double-sided print mode, provided your printer supports this feature.
Background Picture.
©SAP AG 2008
Page Structure with Output Areas (1)
Document
Pages and Windows FIRST First Page
LOGO Company Logo MAIN Main Window TITLE Title
Navigation Tree
Processing from top to bottom
To be able to output information in a form, you must create suitable output areas (windows) on the relevant page. The following output areas are available:
• Windows: Subnodes of windows are used to output text and data. • Graphic windows
The output areas of a form are represented as nodes in the navigation tree. The icon helps you to identify the three different node types (address, graphic, or window).
The order of the page subnodes in the navigation tree does not affect their position in the form, but it does affect their processing: In each page, they are processed from the top down. It is helpful to imagine that all nodes are expanded. You may need to move subnodes using drag and drop (left mouse button). The processing sequence is particularly important if you use fields (variables) that are filled only at runtime.
©SAP AG 2008
Page Structure with Output Areas (2)
Pages and Windows FIRST First Page
MAIN Main Window ADDRESS Address NEXT Next Page
MAIN Main Window Create
Cut Copy Paste Delete –––––––––––– Expand Collapse Drag and drop
Same name → same content Subnodes of MAIN TITLE Title ADDRESS Address TITLE Title
You create output areas as you do other nodes, namely using the context menu (right-click on a page). A unique technical name is proposed which you can change if you wish.
You can move (with the left mouse button) or copy (CTRL and left mouse button) subtrees - that is nodes with subnodes - using drag and drop. Alternatively, you can use the clipboard (right mouse button: cut – copy – paste). For example, you can move or copy windows or text nodes from one page to another.
If you drag one node (A) onto another node (B), A is inserted after B. However, it is also possible to create A as a subnode of B. A popup appears on which you can choose Under the node... or After the
node.... If you choose the second option, A will be inserted at the same level as B but after it.
If you place output areas on several pages of a form, any changes to node content (including deleting subnodes) take effect on all pages since the technical names of the nodes are identical. Output areas that share the same content can, however, occupy different positions on each page.
If you place output areas in several positions within a page, copies containing the same content are created, but these copies have different technical names to the original. As a result, changes to node content only take effect in the area concerned.
©SAP AG 2008
The Form Painter
Form Painter TITLE ADDRESS EE_DATA MAIN Create Cut Copy Paste Delete –––––––––––––– Into background –––––––––––––– Help Grid Ruler Toolbar Sizing handles LOGO
You use the Form Painter to check/change the layout of a form. You can show or hide the Form Painter in the Form Builder by clicking the corresponding pushbutton or by choosing menu Utilities →Form
Painter on/off. The Form Painter always displays the page selected in the navigation tree, including all
output areas (windows, graphic windows, and address windows) and the background picture, provided there is one.
To edit an output area, select it with a mouse click. The corresponding node is then also displayed on the maintenance screen. You can change the size of a window by clicking one of the sizing handles situated at the corners and the sides of the selection rectangle and dragging the handle to its new position while keeping the left mouse button pressed. If you want to reposition an output area, click the area and move it while keeping the left mouse button pressed (drag and drop). All size and position-related changes that you make are automatically copied to the maintenance screen.
©SAP AG 2008
Form Painter: Settings
Form Painter with 3D Box Align Window with Grid Draw Window Transparent Window Crosshair Automatic zoom Zoom Zoom in Zoom out Draw window Detach toolbar Align with grid Grid Main grid Ruler
General Grid Main Grid Ruler Tracker Zoom
50%
The most important settings options are provided in a detachable toolbar in the Form Painter. For more options, choose Utilities→Settings or right-click on the toolbar.
The Draw Window option enables you to draw an output area directly by clicking on an empty spot on the Form Painter, holding down the left mouse button, and moving the mouse until the output area reaches the required size.
There are different zoom options to control the view. The Automatic Zoom option is the most convenient of these.
You can display a detail grid or a detail grid with main grid to enable you to align your output areas correctly. In addition, you can configure the Form Painter to automatically align output areas to the detail grid when they are moved with the mouse. The intervals in both grids can be configured. Using the crosshair instead of the normal mouse pointer also makes it easier to achieve an exact alignment of the nodes. You can choose this on the General settings tab page.
On the Tracker settings tab page, you can define how you want the currently selected window to be highlighted.
©SAP AG 2008
Page 2
Main Window and Secondary Window
Page 1
Main window (body text) Secondary window
The two types of window that are distinguished between are main and secondary windows:
In the subnode of the main window, you output content that can run over several pages (body text). In the example above, it is an employee's wage types. Once the main window has been completely filled with content, all of the page's as yet unprocessed secondary windows are processed. A page break to the next page occurs automatically, where the nodes are again processed in the order in which they are arranged in the navigation tree, and the body text is continued in the main window.
• In a form, you can only designate one window as the main window.
• The main window must be the same width on every page. However, you can choose its height and position freely.
• A page that does not contain a main window cannot refer to itself as the next page since this would trigger an endless loop.
©SAP AG 2008
Window MAIN
Meaning Main Window
Output Options
Output Options ConditionsConditions General Attributes
General Attributes
Position and size
Boxes and shading
Type Node Error
MAIN MAIN window does not fit on the page (width)
Field comparisons Events Main window Check
Window Attributes
You can execute checks at different levels, from the bottom node to the entire form. To ensure that all windows are free of errors, they must fit onto the respective page, and the main window must have the same width on all pages. All error messages are displayed in the bottom part of the maintenance screen. You can go directly to a node by clicking its name.
You set the position and the appearance of a window using the output options.
As with most node types, you can use conditions for windows to determine the time they are processed. You can choose from a number of processing events (such as not on first page or only on page...) and also control processing by means of specific values. For example, you might want to print text A for certain customers only and text B for all other customers. If the conditions set for a window are not fulfilled, neither the window nor its subnodes are processed. (The same applies for all other nodes and subnodes for which conditions have been specified.)
If you use identical window nodes on different pages, each node has its own Output Options and
©SAP AG 2009
Window: Output Options
Page 1 Current information on the Intranet Left margin Upper margin Height Width Red shading, 20% Line with 2pt width 2 mm spacing 10% shading, always draw
You determine the position of a window by specifying the left, upper margin and you define its size by specifying the height and width. If you draw the window in the Form Painter, these details are
automatically transferred to the maintenance screen, and vice versa.
As is the case for all nodes that enable text to be output, you can configure frames and shading for windows.
As of SAP Web Application Server 6.10, you can make detailed settings for the four margins of the window (upper, lower, right, and left). You can define lines in different widths and colors. You can also configure the width of the margin (distance from window edge to text) separately for all four margins. Furthermore, you can choose different shading colors and levels of saturation for each window. If you activate Always Draw Box and Shading, the window is always output with your chosen
©SAP AG 2008
Graphics on the Form
FIRST First Page
LOGO Company Logo
Black and White Bitmap Image (BMON)
Black and White Bitmap Image (BMON)
Color Bitmap Image (BCOL)
Color Bitmap Image (BCOL)
Determine Dynamically (BCOL,
Determine Dynamically (BCOL,
BMON) BMON) Output Attributes Output Attributes Object GRAPHICS ID BMAP Resolution DPI Name HR280_LOGO
General Attributes Output Options
Form Painter
Static
Dynamic
(without preview) LOGO
You can embed graphics not only as background pictures, but also as separate graphic windows (direct subnodes of a page), or as subnodes of a window. A prerequisite for this is that the graphic already exists in the system.
You create graphic nodes like you create any other node by using the context menu (right mouse button) or via menu path Edit→ Node → Create.
If you create a separate graphic window for the graphic, the graphic is visible in the Form Painter (provided you have not selected the Placeholder for graphics checkbox in the Form Painter settings). You can then easily position the graphic on the page using drag and drop.
If you create the graphic as a subnode of an existing node, for example of a window or a template, it is not displayed on the Form Painter and you cannot choose its position with drag and drop; the graphic is output depending on higher-level nodes.
You make the settings for the name of the graphic, the object and ID, the type of the graphic (black and white or color) and the resolution in the same way as for a background picture. In particular, you can determine the name of the graphic dynamically at the application program runtime by entering a field. If you do not create the graphic in a separate graphic window of the form but as a subnode, you must
also determine its horizontal position on the Output Options tab page.
©SAP AG 2008
Activate and Test Forms
Check Activate
SAP Form Builder: Change Form ZPYXXFO_Z99_PAYSLIP
Test print without data selection
F8
F8 F8
F8
Print Preview Page 0001 of 0003 Remuneration statement
Remuneration statement for / (--) Page 1
Personal data
Personnel number Date of birth Entry
Wage Type Number Unit Amount Total
If you make changes to a form, you should check them. You can perform individual checks for most nodes or simply check the entire form.
Before you can use a form in programs, you must first activate it. To do so, choose Form → Activate or choose the second pushbutton on the application toolbar in the Form Builder. Activating a form means that the entire form is checked and saved and the function module is generated.
To test your form from the Form Builder (using Print Preview or Print), choose Form → Test or choose the third pushbutton in the SAP Form Builder. This takes you to the Function Builder; the development environment for function modules. The name of the generated function module is already entered here. You can add values to the interface of the function module for test purposes. Then choose Test/Execute again (Menu path Function Module → Test → Single Test), then Execute. Enter your printer in the
Output Device field in the print attributes and choose Print Preview or Print.. Tip: The quickest way to
©SAP AG 2008
Pages and Windows: Summary
You are now able to:
Create secondary windows with the Form Painter
Insert a graphic with the company logo
Exercises
Unit: HR Forms Workplace
Lesson: Pages and Windows
At the conclusion of this exercise, you will be able to:
• Create a secondary window for the personal data of the employee • Add a graphic to the form with the company logo
• Test the form
The personal data of the employee is to appear in a window on the
remuneration statement form. The company logo is to appear in the upper right corner.
1-1 Create a new form by copying the template called ZHR280_G00_EXE2. Call your form ZHR280_G##_EXE2 (## = group number).
1-1-1 Change the name of the existing page called %PAGE1 to MAIN. Enter Main
Page as the meaning.
1-1-2 Create a new secondary window in the main page. Position the window in the navigation tree below the MAIN main window. Call it EE_DATA Employee
Data and activate the Always Draw Box and Shading option.
1-2 Add the company logo to the form.
1-2-1 Create a node called LOGO for company logo HR280_LOGO on the MAIN page. 1-2-2 Position the logo in the upper right corner of the form.
1-3 Create another page.
1-3-1 Copy the MAIN page and call it FOLLOW_PAGE Next Page. It should follow the MAIN page.
Solutions
Unit: HR Forms Workplace
Lesson: Pages and Windows
1-1 Create a new form by copying the template called ZHR280_G00_EXE2. Call your form ZHR280_G##_EXE2 (## = group number).
Call up your form for editing and choose the Layout pushbutton.
1-1-1 Select %PAGE1 in the navigation tree by double-clicking on it and enter MAIN in the Page field and Main Page in the Meaning field.
1-1-2 First, activate the Form Painter. Choose Create → Window from the context menu (right mouse button) on the MAIN page. A window appears in the upper left corner of the Form Painter in a default size and with a default name. Use the mouse to move it to a position to the right of the ADDRESS window. Drag the window in the navigation tree to a position below the MAIN window.
Enter the following on the Output Options tab page:
Field Name Value
Left Margin 11.00 cm
Upper Margin 4.40 cm
Width 8.5 cm
1-2 Add the company logo to the form.
1-2-1 Choose Create → Graphic from the context menu (right mouse button) on the
MAIN page. Call the new node LOGO, enter the details provided below on the
General Attributes tab page, and choose Color Bitmap Image (BCOL):
Field Name Entries
Name HR280_LOGO
Object GRAPHICS
ID BMAP
1-2-2 Position the logo in the upper right corner of the form on the graphical Form Painter.
1-3 Create another page.
1-3-1 Select the MAIN page in the navigation tree and choose Copy from the context menu (right mouse button), Then choose Paste from the context menu.
Call the new page FOLLOW_PAGE and enter Next Page as the meaning. Select the MAIN window again by double-clicking on it, go to the General
Attributes tab page and choose the new page in the Next Page field.
Save the new form. 1-4 Activate your form and test it.
The quickest way to access the print preview is to choose F8 four times. Use LOCL as the output device.
©SAP AG 2008
Lesson 2: Pages and Windows
Lesson 4: Texts on the Form Lesson 5: Tables and Templates Lesson 6: Flow Control
Data on the Form: Unit Overview Diagram
Unit Overview
Lesson 1: Create Form
©SAP AG 2008
Data on the Form: Lesson Objectives
At the conclusion of this lesson, you will be able to
Output employee data in a loop on the form
Process the payroll results in a loop
©SAP AG 2008
Data on the Form: Business Scenario
The employee's address is to be printed on the
remuneration statements in a window created for this
purpose. Wage types are to be output in the main
window.
©SAP AG 2008
Data and Tables: Technical Background
Data retrieval
Loop in the form
Database table(s) Internal table Work area
MetaStar
InfoStar
WA_INFOSTAR
From a technical point of view, a table in an SAP Smart Form is filled by processing an internal table on a line-by-line basis. This is referred to as a "loop." The respective lines are copied into a work area that has the same structure as the table. The internal table must be filled beforehand in the application program (which is the usual case) or in the form. The data is normally taken from database tables. If the data is read in the application program, the internal table must be defined on the SAP Smart Form interface.
If the internal table is very large, we recommend that you process the table using field symbols instead of a work area since field symbols can directly access the individual lines and therefore the lines do not need to be copied.
©SAP AG 2008
Loop over Payroll Results
Data
Internal Table HRDATA-STAR INTO WA_RESULT WHERE Condition
LOOP Loop
Already Sorted Sort Criteria
Fld Name Event on Sort B... Event on Sort E... EMPLOYEE_KEY-PERSON..
INPERIOD_KEY
Control level RESULTS Loop over Results
Data tab page: Enter the name of the internal table over which the loop is to be executed and the associated work area (assignment type into) or the field symbol (assignment type assigning). You can specify a line range, determine one or more WHERE conditions, and sort the internal table before it is processed. Sorting the internal table is a prerequisite for sort levels (control levels).
The node shown is the loop over the HRDATA-STAR_PAY_RESULT InfoStar of the employees. In the loop, all entries are made available one after the other in the WA_RESULT work area.
You can also sort the internal table within the form. To do this, enter the names of the fields to be used as the sort criteria. The order of the fields in this list determines the sort sequence. You can
subsequently change the sort sequence by placing your cursor on a field and moving it up or down a line by clicking one of the two black triangles displayed above the sort criteria. To the right of the field, you can choose whether the table is to be sorted in ascending or descending order.
For technical reasons, the system cannot recognize whether the internal table has already been sorted (for example, in the data retrieval program). If this is the case, you still have to enter the sort criteria but then select the Already Sorted checkbox. (Otherwise, the table will be sorted again.)