Smartforms Adobe
January 28, 2017 | Author: Roys Palnati 's | Category: N/A
Short Description
Download Smartforms Adobe...
Description
HR280 Smart & Adobe Forms in HCM SAP ERP - Human Capital Management
Date Training Center Instructors
Education Website
Participant Handbook Course Version: 95 Course Duration: 4 Days Material Number: 50099489
An SAP course - use it to learn, reference it for work
Copyright Copyright © 2011 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 permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.
Trademarks •
Microsoft®, WINDOWS®, NT®, EXCEL®, Word®, PowerPoint® and SQL Server® are registered trademarks of Microsoft Corporation.
•
IBM®, DB2®, OS/2®, DB2/6000®, Parallel Sysplex®, MVS/ESA®, RS/6000®, AIX®, S/390®, AS/400®, OS/390®, and OS/400® are registered trademarks of IBM Corporation.
•
ORACLE® is a registered trademark of ORACLE Corporation.
•
INFORMIX®-OnLine for SAP and INFORMIX® Dynamic ServerTM are registered trademarks of Informix Software Incorporated.
•
UNIX®, X/Open®, OSF/1®, and Motif® are registered trademarks of the Open Group.
•
Citrix®, the Citrix logo, ICA®, Program Neighborhood®, MetaFrame®, WinFrame®, VideoFrame®, MultiWin® and other Citrix product names referenced herein are trademarks of Citrix Systems, Inc.
•
HTML, DHTML, XML, XHTML are trademarks or registered trademarks of W3C®, World Wide Web Consortium, Massachusetts Institute of Technology.
•
JAVA® is a registered trademark of Sun Microsystems, Inc.
•
JAVASCRIPT® is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape.
•
SAP, SAP Logo, R/2, RIVA, R/3, SAP ArchiveLink, SAP Business Workflow, WebFlow, SAP EarlyWatch, BAPI, SAPPHIRE, Management Cockpit, mySAP.com Logo and mySAP.com are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other products mentioned are trademarks or registered trademarks of their respective companies.
Disclaimer THESE MATERIALS ARE PROVIDED BY SAP ON AN "AS IS" BASIS, AND SAP EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR APPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THESE MATERIALS AND THE SERVICE, INFORMATION, TEXT, GRAPHICS, LINKS, OR ANY OTHER MATERIALS AND PRODUCTS CONTAINED HEREIN. IN NO EVENT SHALL SAP BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES OF ANY KIND WHATSOEVER, INCLUDING WITHOUT LIMITATION LOST REVENUES OR LOST PROFITS, WHICH MAY RESULT FROM THE USE OF THESE MATERIALS OR INCLUDED SOFTWARE COMPONENTS.
g20112281825
About This Handbook This handbook is intended to complement the instructor-led presentation of this course, and serve as a source of reference. It is not suitable for self-study.
Typographic Conventions American English is the standard used in this handbook. The following typographic conventions are also used. Type Style
Description
Example text
Words or characters that appear on the screen. These include field names, screen titles, pushbuttons as well as menu names, paths, and options. Also used for cross-references to other documentation both internal and external.
2011
Example text
Emphasized words or phrases in body text, titles of graphics, and tables
EXAMPLE TEXT
Names of elements in the system. These include report names, program names, transaction codes, table names, and individual key words of a programming language, when surrounded by body text, for example SELECT and INCLUDE.
Example text
Screen output. This includes file and directory names and their paths, messages, names of variables and parameters, and passages of the source text of a program.
Example text
Exact user entry. These are words and characters that you enter in the system exactly as they appear in the documentation.
Variable user entry. Pointed brackets indicate that you replace these words and characters with appropriate entries.
© 2011 SAP AG. All rights reserved.
iii
About This Handbook
HR280
Icons in Body Text The following icons are used in this handbook. Icon
Meaning For more information, tips, or background
Note or further explanation of previous point Exception or caution Procedures
Indicates that the item is displayed in the instructor's presentation.
iv
© 2011 SAP AG. All rights reserved.
2011
Contents Course Overview ......................................................... vii Course Goals ...........................................................vii Course Objectives .....................................................vii
Unit 1: HR Metadata Workplace ........................................ 1 Overview of HR Forms Workplace ...................................2 HR Metadata Workplace ...............................................9
Unit 2: HR Forms Workplace – Smart Forms...................... 23 Creating a Form ....................................................... 25 Pages and Windows.................................................. 41 Data on the Form ..................................................... 61 Texts on the Form..................................................... 70 Tables and Templates ................................................ 85 Flow Control .......................................................... 116
Unit 3: HR Forms Workplace – Form Builder..................... 129 Form Interface and Context ........................................131 Adobe LiveCycle Designer Overview .............................144 Structuring a Form ...................................................165 Static and Dynamic Form Elements ...............................179 Tables as Form Elements ...........................................199
Unit 4: SAP Interactive Forms – Overview ........................ 217 What Are SAP Interactive Forms by Adobe?.....................218 Overview: HCM Processes and Forms – Process and Functions (Overview).........................................................224
Unit 5: SAP Interactive Forms – Technical Part.................. 261 Technical and System Requirements .............................262 Architecture HCM Processes and Forms .........................266
Unit 6: SAP Interactive Forms - Practical Part ................... 281 Step-by-Step: Create/Edit Processes and Forms ...............283 The New Design Time...............................................287 The Form Builder ....................................................303 Workflow and Process ..............................................317 Further Customizing .................................................351
2011
© 2011 SAP AG. All rights reserved.
v
Contents
HR280
Appendix 1:
vi
........................................................... 385
© 2011 SAP AG. All rights reserved.
2011
Course Overview Target Audience This course is intended for the following audiences: •
Project team members, developers and consultants who are responsible for HCM form printing and HCM Processes and Forms
Course Prerequisites Required Knowledge •
Knowledge in the application were you like to create or edit forms
Course Goals This course will prepare you to: •
Gain a basic understanding of creating a remuneration statement for payroll with SAP Smart Forms and HR Forms Get an insight into working with the SAP Interactive Forms software by Adobe
•
Course Objectives After completing this course, you will be able to: • • • • •
Use transaction HRFORMS Create and model an InfoNet Use Smart Forms to create a remuneration statement Use Adobe LiveCycle Designer to create a remuneration statement Adjust HCM Processes and Forms
SAP Software Component Information The information in this course pertains to the following SAP Software Components and releases: •
2011
ERP 6.0 EHP 5 + Portal
© 2011 SAP AG. All rights reserved.
vii
Course Overview
viii
HR280
© 2011 SAP AG. All rights reserved.
2011
Unit 1 HR Metadata Workplace Unit Overview 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.
Unit Objectives After completing this unit, you will be able to: • • •
Describe the process of creating HR forms Explain the MetaNet as a view of the printable data Enhance the HR metadata model to provide additional HR data for the purpose of creating forms.
Unit Contents Lesson: Overview of HR Forms Workplace ....................................2 Lesson: HR Metadata Workplace................................................9
2011
© 2011 SAP AG. All rights reserved.
1
Unit 1: HR Metadata Workplace
HR280
Lesson: Overview of HR Forms Workplace Lesson Overview In this lesson you will get an overview of HR Forms Workplace. You will use this tool whenever you want to create or change a HR form.
Lesson Objectives After completing this lesson, you will be able to: • •
Describe the process of creating HR forms Explain the MetaNet as a view of the printable data
Business Example 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.
Data Sources
Figure 1: HCM Data Sources
The payroll form is created on the basis of the payroll results. This means that it is possible to reprint remuneration statements that have already been created as often as required for previous payroll periods. The standard form is called SAP_PAYSLIP.
2
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: Overview of HR Forms Workplace
Customer forms must always begin with the letter Z.
Figure 2: The Process of Creating HR Forms
There are three basic steps in the process of creating a form: 1. 2. 3.
Compile a catalog containing the required data from the master data and the payroll and time evaluation results Select data from the catalog to be used in the forms 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.
2011
© 2011 SAP AG. All rights reserved.
3
Unit 1: HR Metadata Workplace
HR280
Figure 3: MetaNet
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. The SAP_DEFAULT MetaNet is provided in the standard delivery.
4
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: Overview of HR Forms Workplace
Figure 4: MetaStar
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.
2011
© 2011 SAP AG. All rights reserved.
5
Unit 1: HR Metadata Workplace
HR280
Figure 5: MetaDimension
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.
Figure 6: MetaFigure
6
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: Overview of HR Forms Workplace
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.
2011
© 2011 SAP AG. All rights reserved.
7
Unit 1: HR Metadata Workplace
HR280
Lesson Summary You should now be able to: • Describe the process of creating HR forms • Explain the MetaNet as a view of the printable data
8
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: HR Metadata Workplace
Lesson: HR Metadata Workplace Lesson Overview In this lesson you will get to know the HR Metadata Workplace. You can use this tool to enhance the metadata provided by SAP.
Lesson Objectives After completing this lesson, you will be able to: •
Enhance the HR metadata model to provide additional HR data for the purpose of creating forms.
Business Example The weekly and monthly working times from the planned working time infotype are to be included in the remuneration statement.
Elements of a MetaNet
Figure 7: HR Metadata Workplace
If you create your own MetaNet, specify 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.
2011
© 2011 SAP AG. All rights reserved.
9
Unit 1: HR Metadata Workplace
HR280
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. You can use the SAP standard MetaNet SAP_DEFAULT as a template for your own MetaNet. If you use the MetaNet for country grouping 99 as a template to automatically create a customer's own MetaNet, the result is a customer MetaNet for all countries. You can then make country-specific Customizing settings for this. If you have created a customer-specifically MetaNet with country grouping 99, you can extend this MetaNet under a different country grouping. This is possible since the objects are not dependent on a MetaNet, but only on the country grouping. If you want to extend an existing and inherited object, copy it and adapt it subsequently. Inheritance has the advantage that changes on the standard MetaNet SAP_DEFAULT are applied automatically in your MetaNet. Note: When you are maintaining metadata, the transaction is locked for all other users since the objects are dependent on each other.
10
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: HR Metadata Workplace
Figure 8: CUMULATED_PAY MetaStar
Here, you can see the CUMULATED_PAY MetaStar (cumulated payroll results) in the fourth 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.
Figure 9: MetaStar Types (1)
2011
© 2011 SAP AG. All rights reserved.
11
Unit 1: HR Metadata Workplace
HR280
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 specified line structure determines the structure of the internal table for 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. The MetaStar CUMULATED_PAY shown above is not filled directly from the payroll table CRT. Instead, it is filled with a function module using a line structure that is different from table CRT. If the flag is set for all payroll results, then the differences between the A results and P results will be calculated. An example is the MetaStar PAY_RESULT containing the payroll results for the selected period. Do not modify standard MetaStars. Use these as a template and customize your copy accordingly.
Figure 10: MetaStar Types (2)
Depending on the MetaStar type, further information may be required to read the data.
12
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: HR Metadata Workplace
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. Payroll type MetaStars 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.
Figure 11: 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. The attributes of a MetaDimension can be uniquely identified by the key fields.
2011
© 2011 SAP AG. All rights reserved.
13
Unit 1: HR Metadata Workplace
HR280
Figure 12: 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. In the standard MetaNet a large number of MetaFigures are included. However, you can add your own MetaFigure. An example is the MetaStar PAY_DEDUCTIONS. The MetaFigure PAY_AMOUNT that is included ensures that the appropriate table rows are summed. The key fields are filled during the processing of the MetaStar to which they are allocated. If the data of the attribute fields does not come from an infotype, you may need a function module to read it. If a database table or view in the Data Dictionary exists whose lines can be clearly read by the key fields of the MetaDimension, you can use this to fill the attribute fields. An example can be found in the MetaDimension WAGETYPE.
14
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: HR Metadata Workplace
Create Customer-Specific MetaStar
Figure 13: 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.
2011
© 2011 SAP AG. All rights reserved.
15
Unit 1: HR Metadata Workplace
HR280
Figure 14: 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. 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. b) Restrictions for selection options: This allows you to permit multiple or individual selections or prevent all selections. These definitions have an impact when you maintain the InfoNet and the InfoStars in your form. If the selection is identified as globally valid, the selection you make in the form will be automatically adjusted in all InfoStars that contain the InfoDimension. With local validity, you can maintain the selection for any InfoStar differently. You can change the information in these columns even after you have created the InfoDimension.
16
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: HR Metadata Workplace
Figure 15: Create Customer-Specific MetaStar (1)
Master data routines are used to read data from the customer-specific MetaStar for the specified infotype 0007.
Figure 16: 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 drag and drop.
2011
© 2011 SAP AG. All rights reserved.
17
Unit 1: HR Metadata Workplace
HR280
In addition, you have to assign the MetaFields with the read infotype's table fields that can be selected from the input help shown.
Figure 17: Enhancing MetaNet with Your Own MetaStar
Copy your MetaStar to the MetaNet by drag and drop to enhance it with the required data from infotype 0007.
18
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: HR Metadata Workplace
Lesson Summary You should now be able to: • Enhance the HR metadata model to provide additional HR data for the purpose of creating forms.
2011
© 2011 SAP AG. All rights reserved.
19
Unit Summary
HR280
Unit Summary You should now be able to: • Describe the process of creating HR forms • Explain the MetaNet as a view of the printable data • Enhance the HR metadata model to provide additional HR data for the purpose of creating forms.
20
© 2011 SAP AG. All rights reserved.
2011
HR280
Test Your Knowledge
Test Your Knowledge 1.
MetaDimensions cannot be used in various MetaStars. Determine whether this statement is true or false.
□ □ 2.
True False
MetaNet and InfoNet are always identical. Determine whether this statement is true or false.
□ □ 3.
True False
Customers must always use MetaNet SAP_DEFAULT. Determine whether this statement is true or false.
□ □ 4.
True False
A MetaDimension consists of key and data fields. Determine whether this statement is true or false.
□ □
2011
True False
© 2011 SAP AG. All rights reserved.
21
Test Your Knowledge
HR280
Answers 1.
MetaDimensions cannot be used in various MetaStars. Answer: False MetaDimensions can be part of various MetaStars.
2.
MetaNet and InfoNet are always identical. Answer: False A MetaNet is a catalogue of data sources, whereas the InfoNet contains the data that was selected from the catalog.
3.
Customers must always use MetaNet SAP_DEFAULT. Answer: False Customers can create an individual MetaNet.
4.
A MetaDimension consists of key and data fields. Answer: True A MetaDimension consists of MetaFields. A MetaField is either a key field of a MetaDimension or an attribute that constitutes a further property of the MetaDimension.
22
© 2011 SAP AG. All rights reserved.
2011
Unit 2 HR Forms Workplace – Smart Forms Unit Overview 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.
Unit Objectives After completing this unit, you will be able to: • • • • • • • • • • • • • • • • • •
2011
Create a form for the remuneration statement Set up the InfoNet with selections Control the selection of data Create global data definitions Create secondary windows with the Form Painter Insert a graphic with the company logo Test the form Adjust the selection screen of the print program Use cumulation wage types in a form Process the payroll results in a loop Create text nodes in windows Output texts and field content Create tables and templates Output wage types in a table Perform calculations in table processing Print data in a template Create an alternative to separate the processing of retroactive accounting wage types and wage types from the current period Control page breaks using program lines
© 2011 SAP AG. All rights reserved.
23
Unit 2: HR Forms Workplace – Smart Forms
HR280
Unit Contents Lesson: Creating a Form ....................................................... 25 Exercise 1: Creating a Form ............................................... 37 Lesson: Pages and Windows .................................................. 41 Exercise 2: Pages and Windows .......................................... 57 Lesson: Data on the Form ...................................................... 61 Exercise 3: Data on the Form.............................................. 67 Lesson: Texts on the Form ..................................................... 70 Exercise 4: Texts on the Form ............................................. 79 Lesson: Tables and Templates ................................................. 85 Exercise 5: Tables and Templates .......................................105 Lesson: Flow Control ........................................................... 116 Exercise 6: Flow Control ..................................................121
24
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: Creating a Form
Lesson: Creating a Form Lesson Overview In this lesson you will become acquainted with the first steps in the process of creating a remuneration statement form.
Lesson Objectives After completing 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
Business Example Your company wants to redesign the form for the remuneration statement using the HR Forms Workplace.
Getting Started
Figure 18: Process Steps for Creating HR Forms
Select data First, you select and logically group (business-related grouping) the part of the MetaNet that is later to be printed on the form.
2011
© 2011 SAP AG. All rights reserved.
25
Unit 2: HR Forms Workplace – Smart Forms
HR280
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 an 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.
Figure 19: Objects of an HR Form
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. If you use the HR Forms Workplace to create a form, the individual names are altered automatically.
26
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: Creating a Form
Figure 20: Tools for Configuring the Form
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, such as additional data retrieval within the form. In addition, you can insert normal ABAP coding.
Figure 21: HR Forms Workplace (2)
You can call the HR Forms Workplace with transaction HRFORMS.
2011
© 2011 SAP AG. All rights reserved.
27
Unit 2: HR Forms Workplace – Smart Forms
HR280
In the HR Forms Workplace, you select the data to be printed from HR. You design the layout in SAP Smart Forms that you can call directly from HR Forms by choosing the Layout button.
Figure 22: 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
You can save such changes in a layout for reuse at a later stage.
28
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: Creating a Form
Setting up the InfoNet
Figure 23: HR Forms Workplace: Data Structure
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 InfoNet overview tree on the right of the screen by drag and drop. In this way, the objects that correspond 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 and the MetaStars used to create them.
2011
© 2011 SAP AG. All rights reserved.
29
Unit 2: HR Forms Workplace – Smart Forms
HR280
Figure 24: Creating 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.
30
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: Creating a Form
Figure 25: Inserting 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. Here, you save the new (empty) Smart Form and activate it. Exit the Smart Form editor by choosing Back and return to the HR form editor. Choose Activate. When you activate the Smart Form, the following three parts become active: • • •
2011
ABAP Dictionary structure Smart Form Print program
© 2011 SAP AG. All rights reserved.
31
Unit 2: HR Forms Workplace – Smart Forms
HR280
Figure 26: 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 previously 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 time statement, you can select a report class here.
32
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: Creating a Form
Figure 27: Verifying the Data Selection
Once you have created the InfoNet and activated everything, choose Form → Print Program (Test) to start the program and 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 of the screen and the table content is displayed on the right. The example in the graphic 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.
2011
© 2011 SAP AG. All rights reserved.
33
Unit 2: HR Forms Workplace – Smart Forms
HR280
Figure 28: SAP Smart Forms: Form Interface
When an application program calls 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 returned by the 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.
34
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: Creating a Form
Figure 29: 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 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. You can check your entries with the Check pushbutton.
2011
© 2011 SAP AG. All rights reserved.
35
Unit 2: HR Forms Workplace – Smart Forms
36
© 2011 SAP AG. All rights reserved.
HR280
2011
HR280
Lesson: Creating a Form
Exercise 1: Creating a Form Exercise Objectives After completing 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
Business Example Your company wants to redesign the form for the remuneration statement using HR Forms.
Task 1: Create a new form by copying the template called ZHR280_G00_EXE1. 1.
Call your form ZHR280_G##_EXE1 (## = group number).
2.
Create an InfoStar called PAY_RESULT with InfoDimensions EMPLOYEE, FORPERIOD, and INPERIOD.
3.
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.
Task 2: Create selections for wage types. 1.
In the PAY_NET InfoStar, add the following selections for the WAGETYPE InfoDimension: /110, /550, /551, /552, and /560.
Task 3: Create the global definitions required for form processing. 1.
Add the WA_RESULT and WA_RETRO work areas and generate the form.
Task 4: Test the form and check the data selected. 1.
2011
Test the form with the payroll period, payroll area, and personnel number provided by your instructor.
© 2011 SAP AG. All rights reserved.
37
Unit 2: HR Forms Workplace – Smart Forms
HR280
Solution 1: Creating a Form Task 1: Create a new form by copying the template called ZHR280_G00_EXE1. 1.
Call your form ZHR280_G##_EXE1 (## = group number). a)
Call transaction HRFORMS by entering it in the command field. Select the copy template and copy it as a local object.
2.
Create an InfoStar called PAY_RESULT with InfoDimensions EMPLOYEE, FORPERIOD, and INPERIOD. a)
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.
3.
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. a)
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.
Task 2: Create selections for wage types. 1.
In the PAY_NET InfoStar, add the following selections for the WAGETYPE InfoDimension: /110, /550, /551, /552, and /560. a)
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.
Continued on next page
38
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: Creating a Form
Task 3: Create the global definitions required for form processing. 1.
Add the WA_RESULT and WA_RETRO work areas and generate the form. a)
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
TYPE LINE OF /1PYXXFO/ZHR280_G##_EXE1STAR_PAY_RESULT
WA_RETRO
TYPE LINE OF /1PYXXFO/ZHR280_G##_EXE1STAR_PAY_RETRO
Task 4: Test the form and check the data selected. 1.
Test the form with the payroll period, payroll area, and personnel number provided by your instructor. a)
Choose menu path Form → Print Program (Test) in the Change HR Forms view. 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.
2011
© 2011 SAP AG. All rights reserved.
39
Unit 2: HR Forms Workplace – Smart Forms
HR280
Lesson Summary You should now 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
40
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: Pages and Windows
Lesson: Pages and Windows Lesson Overview In this lesson we will deal with the composition of a form using pages and windows.
Lesson Objectives After completing this lesson, you will be able to: • • •
Create secondary windows with the Form Painter Insert a graphic with the company logo Test the form
Business Example 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.
Form Builder
Figure 30: SAP Smart Forms: Areas of the Form Builder
2011
© 2011 SAP AG. All rights reserved.
41
Unit 2: HR Forms Workplace – Smart Forms
HR280
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. The SAP Form Builder consists of three areas: •
•
•
On the left 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 in 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. Here you can see the fields of the Import Interface, the Global Data fields and the System Fields. 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, or details of the layout of a table. The Table Painter is used for the latter. It cannot be seen in the example shown above. On the right is the Form Painter with a graphical overview of the layout of the current page. The separate areas in the Form Painter are the windows on the form. You use this area to design the layout of a page, for example, the position and size of text windows or graphics. You can also hide the Form Painter by choosing Utilities → Form Painter on/off.
You can select a node for editing by double-clicking it in the navigation tree or in the Form Painter.
Figure 31: The Navigation Tree
All of the elements on a form are represented by a node in the navigation tree.
42
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: Pages and Windows
Subnodes “inherit” attributes from higher-level nodes, such as 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 has been activated). Below the top node, you always find the following two nodes: •
Global settings. These include: –
•
Form attributes, such as 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
Figure 32: Form Attributes: General Attributes
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.
2011
© 2011 SAP AG. All rights reserved.
43
Unit 2: HR Forms Workplace – Smart Forms
HR280
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.
Figure 33: Form Attributes: Output Options
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 that 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.
44
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: Pages and Windows
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).
Pages
Figure 34: Pages
Each form consists of at least one page. A page is represented by a node in the navigation tree. As with all other node types (such as texts or tables), right-clicking 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. Each page - like all subnodes - has a technical name and a meaning. Only letters, numbers, and underscores are permitted for the names. The first character must be a letter. As a special case, the percentage sign is allowed as the first character. The percentage sign is used by the SAP Form Builder to generate names automatically.
2011
© 2011 SAP AG. All rights reserved.
45
Unit 2: HR Forms Workplace – Smart Forms
HR280
Figure 35: Page Attributes
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 –
•
46
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 the print mode to double-sided, provided your printer supports this feature. Background Picture. Prerequisite: The required picture already exists in the system (after you have used transaction SE78 to import it). Text is printed over the picture.
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: Pages and Windows
Figure 36: Page Structure with Output Areas (1)
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 3 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.
2011
© 2011 SAP AG. All rights reserved.
47
Unit 2: HR Forms Workplace – Smart Forms
HR280
Figure 37: Page Structure with Output Areas (2)
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 that 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) on to another node (B), A is inserted after B. However, it is also possible to create A as a subnode of B. A popup appears in 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.
48
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: Pages and Windows
Form Painter
Figure 38: The Form Painter
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, providing there is one. To edit an output area, click it to select it. 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. The context menu (right mouse button) is also available in the Form Painter. You can use this menu to create or delete output areas and perform normal clipboard functions (cut, copy, paste). Choose the Into background option if a small window is completely hidden by a larger one and you want to edit the small one. Using this option has no effect on the actual print output. (If windows, graphics, or texts overlap, they are printed one by one over another.)
2011
© 2011 SAP AG. All rights reserved.
49
Unit 2: HR Forms Workplace – Smart Forms
HR280
Figure 39: Form Painter: Settings
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.
50
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: Pages and Windows
Windows
Figure 40: Main Window and 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 as yet unprocessed secondary windows of the page 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.
In the subnode of a secondary window, you output the text and data in a predefined output area, that is to say, text output as body text with page breaks is not possible. • •
2011
Text that does not fit in the secondary window is cut short and not output. A secondary window's height, width, and position can vary from page to page.
© 2011 SAP AG. All rights reserved.
51
Unit 2: HR Forms Workplace – Smart Forms
HR280
Graphics always automatically have the right dimensions. In SAP Web Application Server 6.10, there are another two types of window, namely Copies Windows and Final Windows. They function exactly as secondary windows when it comes to body text, dimensions, and position.
Figure 41: 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 on to 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 when 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 Conditions tab pages.
52
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: Pages and Windows
Figure 42: Window: Output Options
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 formatting even if it does not have any content. You can use the following units of measure to specify dimensions: CM, MM, IN (1 inch = approx. 2.54 cm), PT (point = 1/72 of an inch), TW (twip = 1/20 of a point). For vertical lengths you can also use LN, and for horizontal lengths CH. You specify how these dimensions should be defined in the form attributes.
2011
© 2011 SAP AG. All rights reserved.
53
Unit 2: HR Forms Workplace – Smart Forms
HR280
Figure 43: Graphics on the Form
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 in the same way as 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 of a window or a template, for example, it is not displayed in the Form Painter and you cannot choose its position with drag and drop. The graphic is output dependent 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 using a variable. 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. To insert a graphic, it must first be imported into the system from your front-end computer in TIFF or bitmap format using graphics administration (transaction SE78).
54
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: Pages and Windows
Figure 44: Activate and Test Forms
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 go to the print preview is to press the F8 function key four times in the SAP Form Builder. As of SAP Web Application Server 6.10, you can test inactive forms too. With SAP R/3 4.6C, you need to activate a form to test it.
2011
© 2011 SAP AG. All rights reserved.
55
Unit 2: HR Forms Workplace – Smart Forms
56
© 2011 SAP AG. All rights reserved.
HR280
2011
HR280
Lesson: Pages and Windows
Exercise 2: Pages and Windows Exercise Objectives After completing 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
Business Example 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.
Task 1: Create a new form by copying the template ZHR280_G00_EXE2. 1.
Call your form ZHR280_G##_EXE2 (## = group number).
2.
Change the name of the existing page %PAGE1 to MAIN. Enter Main Page as the meaning.
3.
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.
Task 2: Add the company logo to the form. 1.
Create a node called LOGO for company logo HR280_LOGO on the MAIN page.
2.
Position the logo in the upper right corner of the form.
Task 3: Create another page. 1.
Copy the MAIN page and call it FOLLOW_PAGE Next Page. It should follow the MAIN page.
Task 4: 1.
2011
Activate your form and test it.
© 2011 SAP AG. All rights reserved.
57
Unit 2: HR Forms Workplace – Smart Forms
HR280
Solution 2: Pages and Windows Task 1: Create a new form by copying the template ZHR280_G00_EXE2. 1.
Call your form ZHR280_G##_EXE2 (## = group number). a)
2.
Change the name of the existing page %PAGE1 to MAIN. Enter Main Page as the meaning. a)
3.
Call your form for editing and choose the Layout pushbutton.
Select %PAGE1 in the navigation tree by double–click and enter MAIN in the Page field and Main Page in the Meaning field.
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. a)
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
Height
3.6 cm
Continued on next page
58
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: Pages and Windows
Task 2: Add the company logo to the form. 1.
Create a node called LOGO for company logo HR280_LOGO on the MAIN page. a)
2.
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
Value
Name
HR280_LOGO
Object
GRAPHICS
ID
BMAP
Position the logo in the upper right corner of the form. a)
Position the logo in the upper right corner of the form on the graphical Form Painter.
Task 3: Create another page. 1.
Copy the MAIN page and call it FOLLOW_PAGE Next Page. It should follow the MAIN page. a)
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 it, go to the General Attributes tab page and choose the new page in the Next Page field. Save the new form.
Task 4: 1.
Activate your form and test it. a)
2011
The quickest way to access the print preview is to choose F8 four times. Use LOCL as the output device.
© 2011 SAP AG. All rights reserved.
59
Unit 2: HR Forms Workplace – Smart Forms
HR280
Lesson Summary You should now be able to: • Create secondary windows with the Form Painter • Insert a graphic with the company logo • Test the form
60
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: Data on the Form
Lesson: Data on the Form Lesson Overview Print programs have a special selection screen that can be adjusted. If you want to reduce the number of wage types to be printed in your form you can use cumulation wage types. The interface provides wage types in internal tables that have to be processed in a loop.
Lesson Objectives After completing this lesson, you will be able to: • • •
Adjust the selection screen of the print program Use cumulation wage types in a form Process the payroll results in a loop
Business Example 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.
Data Processing
Figure 45: Data and Tables: Technical Background
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
2011
© 2011 SAP AG. All rights reserved.
61
Unit 2: HR Forms Workplace – Smart Forms
HR280
(which is usually the 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.
Figure 46: Loop over Payroll 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 for 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.) Sorting is required for subtotals, page breaks, and so on.
62
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: Data on the Form
Selection Screen
Figure 47: Selection Screen 1
There are 3 report categories (= selection screens) available that allow you to specify the number of selection fields. Use the report classes as a template for your own. Double-click the report class to maintain it. Choose the change view and copy the report class to adapt it afterwards. In addition to the report class there are optional fields that you can preset with default values. If you set the checkmark in the Show column, you specify that the field is visible in the selection screen of the print program. If you determine a default value for an invisible field, you can no longer change this value from the print program. If you determine a default value for a visible field, you can change this value from the print program.
Figure 48: Selection Screen 2
Some selection parameters that are specified on the selection screen for the payroll results reports can be related to in-periods or for-periods. If retroactive accounting has taken place, the in-period data and for-period data differs. It is therefore important to determine whether the program should work with the for-period
2011
© 2011 SAP AG. All rights reserved.
63
Unit 2: HR Forms Workplace – Smart Forms
HR280
view or the in-period view if a report is executed on the payroll results. If you set the switch, the applicable selection parameters are included as in-period data in the program. Select how retroactive accounting is taken into account when the payroll results are being read: O Only the original periods are taken into account, that means, retroactive accounting is ignored. EMPTY Retroactive accounting is taken into account. X Retroactive accounting and the relevant periods are taken into account. Example: You have a payroll result for January for which retroactive accounting was executed in February. Consequently, you have three payroll results: January in January, January in February, and February in February. You want to read the payroll results from February with the in-period view: If you choose the valueO, February in February is read. If you choose the value EMPTY, February in February and January in February are read. If you choose the valueX, all three payroll results are read. Furthermore, the January in January results are subtracted from the January in February results. This difference is made available with February in February. If you select Consider and display archived payroll results, the archived payroll results are taken into account and displayed for the specified personnel numbers in the selected interval. The parameter Number of EE determines how many personnel numbers can be processed in the same form. A value of 0 means that the form is called only once, and all selected personnel numbers are processed in the same form. If you process multiple personnel numbers in a form, you must ensure that personnel-related InfoStars contain at least one of the InfoDimensions EMPLOYEE and ASSIGNMENT. If you set the value 1, the form will be called for each selected personnel number. If your form goes back to the past (for example, a salary statement with retroactive accounting), you should assign the value EMPTY to the switch Only IT Recs in Time Interval.
64
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: Data on the Form
Cumulation Wage Types
Figure 49: Using Sum Wage Types 1
If you want to combine multiple wage types, you can use cumulation wage types. Cumulation wage types are always assigned to a subapplication. Follow these steps: 1. In your form, select the CumulationWTs tab page and double-click the Customer field. Create a customer-specific subapplication (namespace 0…9).
Figure 50: Using Sum Wage Types 2
2. Select your new subapplication and define your own cumulation wage types.
2011
© 2011 SAP AG. All rights reserved.
65
Unit 2: HR Forms Workplace – Smart Forms
HR280
3. After you have created the cumulation wage type, you can assign the required wage types.
Figure 51: Using Sum Wage Types 3
Enter your customer-specific subapplication on the Cumulation WTs tab page. Now you can use your cumulation wage type as a selection value for InfoDimension WAGETYPE.
66
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: Data on the Form
Exercise 3: Data on the Form Exercise Objectives After completing this exercise, you will be able to: • Output employee data in a loop on the form • Process the payroll results in a loop.
Business Example 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.
Task 1: Create a loop over the payroll results Create a new form by copying the template ZHR280_G00_EXE3. Call your form ZHR280_G##_EXE3 (## = group number). 1.
Create a loop over the HRDATA–STAR_PAY_RESULT InfoStar below the MAIN window. Use the WA_RESULT structure that is defined in the global definitions as the work area.
2.
Use the EMPLOYEE_KEY–PERSONNEL_NUMBER and INPERIOD_KEY fields as sort criteria. Select the second field as the control level end.
Task 2: Use the cumulation wage type in the form 1.
Replace wage type /180 in your form with cumulation wage type SINS (subapplication 9SUM).
Task 3: Test the form and check the data selected. 1.
2011
Test the form with the payroll period, payroll area, and personnel number provided by your instructor.
© 2011 SAP AG. All rights reserved.
67
Unit 2: HR Forms Workplace – Smart Forms
HR280
Solution 3: Data on the Form Task 1: Create a loop over the payroll results Create a new form by copying the template ZHR280_G00_EXE3. Call your form ZHR280_G##_EXE3 (## = group number). 1.
Create a loop over the HRDATA–STAR_PAY_RESULT InfoStar below the MAIN window. Use the WA_RESULT structure that is defined in the global definitions as the work area. a)
Choose Create → Flow Logic → Loop in the context menu (right mouse button) on the MAIN window. Call the new node RESULTS. In field Meaning enter “Loop over results”. In the fields for the LOOP loop, enter the HRDATA–STAR_PAY_RESULT InfoStar as the table and WA_RESULT as the structure.
2.
Use the EMPLOYEE_KEY–PERSONNEL_NUMBER and INPERIOD_KEY fields as sort criteria. Select the second field as the control level end. a)
Enter the specified fields EMPLOYEE_KEY–PERSONNEL_NUMBER and INPERIOD_KEY as ascending sort criteria. Select the Event on Sort End field for the period.
Task 2: Use the cumulation wage type in the form 1.
Replace wage type /180 in your form with cumulation wage type SINS (subapplication 9SUM). a)
In the InfoNet screen, double-click the name of your form to get the tab page underneath. Select the Cumulation WTs tab page and enter subapplication 9SUM in the Customer field. Open the PAY_DEDUC InfoStar and double-click the dimension WAGETYPE. Select the Selections tab page and replace wage type /180 with cumulation wage type SINS.
Task 3: Test the form and check the data selected. 1.
Test the form with the payroll period, payroll area, and personnel number provided by your instructor. a)
68
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 HRDATA–STAR_PAY_RESULT InfoStar.
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: Data on the Form
Lesson Summary You should now be able to: • Adjust the selection screen of the print program • Use cumulation wage types in a form • Process the payroll results in a loop
2011
© 2011 SAP AG. All rights reserved.
69
Unit 2: HR Forms Workplace – Smart Forms
HR280
Lesson: Texts on the Form Lesson Overview This lesson tells you how to edit and output texts and field contents.
Lesson Objectives After completing this lesson, you will be able to: • •
Create text nodes in windows Output texts and field content
Business Example The payroll period and page number are to be printed in the title of the remuneration form. The employee's address is to be output in the address window on the form.
Text Nodes
Figure 52: Text Nodes
You enter all of the text on the form using text nodes. Text nodes are subnodes of windows and their subnodes, for example, folders or templates.
70
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: Texts on the Form
A context menu is available for existing text nodes (right mouse button) that you can use to create another text node directly after the one you have clicked on (at the same level). Alternatively, you can use the higher-level node's context menu to create text nodes, in which case the new node is inserted as the highest-level subnode of this node. The same functions can be accessed under menu path Edit → Node. Text nodes themselves cannot have any further subnodes. Bear in mind that text in secondary windows that does not fit in the space is cut short. Text only continues to the next page if it is in the main window.
Figure 53: Text Nodes: Attributes
If you select a text node in the navigation tree or in the Form Painter, its attributes are displayed on the maintenance screen.
2011
© 2011 SAP AG. All rights reserved.
71
Unit 2: HR Forms Workplace – Smart Forms
HR280
The three tab pages are similar to those for windows. •
General attributes: –
•
The text type you choose allows you to determine whether the text is saved and edited within the form (as a text element) or outside the form. In the latter case, you can choose between an SAP Smart Forms text module and a SAPscript include text. – You also determine how two directly successive text elements should be combined. – The remaining fields you see on the tab page vary depending on the text type. Output options:
•
The previous information about boxes and shading for windows also applies to text nodes. – In addition, you can assign a style to the text node. A style is a collection of different character and paragraph formats. – If the text node is in the main window, you can choose Page Protection. This option prevents text from being separated by page breaks. If the protected text does not fit onto the current page, it is output on the next page. Conditions: See the conditions for windows. –
Figure 54: Linking Text Nodes
72
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: Texts on the Form
On the General Attributes tab page, you define how two text nodes that follow directly one after the other in the same window are to be linked to each other: •
•
•
Choose New Paragraph to prompt the text of the second node to begin on a new line in the paragraph format that you have defined for this paragraph. This means that both text nodes are completely separate from one another. (Within a text node, return corresponds to a new paragraph.) Choosing New Line also results in the text of the second node beginning on a new line. In this case, however, the format of the last paragraph of the first text node is used for the first paragraph of the second text. (Within a text node, shift return corresponds to a new paragraph.) Finally, you can also choose Append Directly. This results in two text nodes that follow directly one after the other being joined together without blank characters or blank lines. In the resulting paragraph, the format of the first text element is used.
If the first node is framed or framed and shaded, the second node is always attached with the New Paragraph option, irrespective of your chosen setting.
Editing Texts
Figure 55: Text Elements in the Editor
If you choose Text Element as the text type, the online editor is displayed on the General Attributes tab page. You can enter text as you would do in any common word processing program. Alternatively, you can switch to fullscreen mode by choosing the Text Editor pushbutton. You can use the clipboard by selecting text blocks with the mouse and choosing the Cut, Copy, or Paste pushbuttons. This way you can copy sections of text between different windows or forms.
2011
© 2011 SAP AG. All rights reserved.
73
Unit 2: HR Forms Workplace – Smart Forms
HR280
Line breaks are inserted into text nodes automatically depending on the window width. You can also use the Enter key in the editor to create a new paragraph that might have a different format to the preceding one. The Shift-Enter key combination allows you to add a line break within a paragraph. The Paragraph Mark On/Off pushbutton enables you to determine whether you want to display non-printing characters such as blank characters, tabulators, paragraph marks, and line breaks.
Figure 56: Format Texts: Paragraph and Character Formats
You can format sections of text that you have selected. They are then displayed roughly as they will appear when they are printed (WYSIWYG = What You See Is What You Get). You can choose a paragraph format from the selection list directly in the editor for each paragraph. A paragraph format denotes a collection of format settings, such as tabs and alignment. The paragraph formats offered in the list depend on the style you have chosen (for example, HRFORMS). If you have entered a style on several nodes (for example, for the form attributes and for a text), the following applies: The style of a node overrides the style of the form attributes, and the style of a lower-level node overrides the style of a higher-level node. If you do not choose a paragraph format, the standard paragraph format for the style is used. Furthermore, you can assign one or more character formats to text that you have selected. Character formats refer to a combination of format settings, such as font or superscript. The same applies to the character formats available for selection as the paragraph formats. The Reset Character Formats pushbutton resets all of the character formats for the area selected back to the paragraph format.
74
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: Texts on the Form
The current format setting is automatically shown in the list of paragraph and character formats when you place the cursor in the text. Therefore, it is only necessary to use the Display Formats function if you require detailed information about the format, or if the text contains several character formats.
Figure 57: Field List
Normally, your form contains not only static text but also variable data referred to as fields. These are read from the database at application runtime or are entered by the user. The simplest way to insert fields is to use the field list. You can show or hide the field list by choosing the corresponding pushbutton, or in the menu by choosing Utilities→ Field list on/off. The following types of fields are available for selection: •
• •
All fields that are recognized by the form as import, export, or table parameters, through the form interface (which means they come from the application program) All global data and field symbols that you have created in the form in the global definitions System fields that are filled automatically during program execution
You insert the fields using drag and drop. Drag the name of a field from the field list to the desired position in your text element. If a field is structured, click the triangle icon to the left of the corresponding folder to access the individual subfields.
2011
© 2011 SAP AG. All rights reserved.
75
Unit 2: HR Forms Workplace – Smart Forms
HR280
Figure 58: System Fields
DATE: Displays the date. You define the display format in the user master record. TIME: Time in HH:MM:SS (HH: hours, MM: minutes, SS: seconds). Page numbers: •
• •
PAGE: Number of current print page. You define the page number format (for example, Arabic, numeric) and mode (increase, initialize, keep unchanged) on the General Attributes tab page of the page node FORMPAGES: Total number of pages of the document currently being edited. This enables you to include details such as “Page x of y” JOBPAGES: Total number of pages of all documents in the current print request.
WINDOWNAME: Name of the current window PAGENAME: Number of the current page New as of SAP Web Application Server 6.10: • • • •
76
XSF: Is set if the form is output in XSF or HTML formats COPYCOUNT and COPYCOUNT0: Query whether an original or copy is output SUBRC: 0 if a text module or include text exists, otherwise 4 USERNAME: Logon name of user that is printing the form.
© 2011 SAP AG. All rights reserved.
2011
HR280
Lesson: Texts on the Form
Figure 59: Editing Fields in Texts
You can also use the Insert Field pushbutton to integrate fields into your text element. Enter the field name with ampersands preceding and following it. In this way, you can also access the ABAP system fields of the SYST structure, for example &sy-uname& (user name). Capitalization is irrelevant. The fields are shown in gray to distinguish them from normal text. They cannot be directly changed or deleted. To delete a field, select it and choose the Delete Field pushbutton. To change a field, place your cursor on the field and choose the Change Field pushbutton. You need this function, for example, to determine formatting options such as the output length for a field. To ensure that your field entries are correct, perform a check by clicking the corresponding pushbutton in the editor. The system notifies you of any errors that may exist (by means of an exclamation mark in a red triangle). If errors exist, you cannot activate the form. Only if you use the check function in the Form Builder (first pushbutton in the toolbar) does the system check whether all fields used have been assigned a value when they were processed, or whether they are still initial. If the fields are initial, the system issues a warning (exclamation mark in a yellow circle) but you can still activate the form. Fields that are initial at application program runtime are ignored. For more information, see the online documentation.
2011
© 2011 SAP AG. All rights reserved.
77
Unit 2: HR Forms Workplace – Smart Forms
HR280
Figure 60: Formatting Options
You use the formatting options to adjust the value of a field before it is output. You enter the respective abbreviations directly after the field name, always in upper case. In some cases, the options should be combined, for example +6(9) or (8.2). The formatting options are not suitable for all field data types. (For instance, numbers cannot be output with an offset.) A distinction must be made between character and numeric fields: Character fields: • •
In the default setting, the value of a field name is output in its full length but blank characters at the end of the value are truncated. Processing sequence: Suppress blank character (C), and (), right alignment (R), insert filler (F).
Numeric fields: • •
The concluding blank character counts as a plus sign. To suppress it, use the S formatting option. Processing sequence: (), sign to the left (
View more...
Comments