zaidi understanding the sap hrformsarchitecture 0606 a 110

9
SAPtips Page 1 SAPtips Journal June/July 2006 Volume IV Issue 3 SAPtips.com SAPtips © 2006 Klee Associates, Inc. What are the steps required in cre- ating “HR Forms”? What are the advantages that the “HR Forms” provides to users and consultants? I will begin with an overview of the “HR Forms” and the benefits it provides to users and consultants. I’ll discuss, in detail, the steps required in creating these Forms. Finally, I will use an example drawn from an easy- for-all company scenario to illustrate my views. I am going to include tips learned from my personal experience and observation. This article is intended primarily for SAP HR users and consultants. I will assume that the reader is famil- iar with basic HR concepts. For more information, refer to the SAP docu- mentation on http://help.sap.com/. Though the screenshots have been taken from Release 4.7, the tips men- tioned are relevant for later releases as well. “HR Forms”: An Overview The “HR Forms” functionality allows you to generate sophisticated reports for the Time Management and Payroll submodules. Examples of such reports are Salary Slip and Time Statements. A typical HR form output is shown in Figure 1. Editor’s Note: Would you like more control of the format and informa- tion in your HR reports? HR and ABAP expert Rehan Zaidi shows you how to use the HR Forms function- ality released with SAP version 4.7. He begins with an overview of the functionality, presents a step-by- step guide for using it, then offers an example that even the “report- ing impaired” user can easily follow. How does he do it? Simple, Meta- Data, MetaTypes, and MetaFigures not withstanding, you’ll shine like a MetaStar with your slick-looking, info-packed HR reports. Introduction A major problem with traditional HR reporting tools is that there is lit- tle control over the output look and design. This may be undesirable in certain situations, particularly when the users’ requirements are very rigid. Since Release 4.7, SAP empowered its clients by pro- viding “HR Forms”, a pow- erful option for generating attractive form-like reports. Due to the ease and control with which you can use “HR Forms”, learning the basics of this tool is essential for SAP HR users. The goal of this paper is to provide an explanation of “HR Forms” and the way it may be used to generate report outputs. These are some of the questions that this article will address: How does “HR Forms” fit into the SAP HR land- scape? Understanding the SAP ® “HR Forms” Architecture– A Guide for SAP HR Users and Consultants By Rehan Zaidi, Siemens Pakistan 4On HR Figure 1: Example of HR Forms Report Output A major problem with traditional HR reporting tools is that there is little control over the output.

Upload: lisathesourgirl

Post on 28-Nov-2014

155 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Zaidi Understanding the Sap HRFormsArchitecture 0606 a 110

SAPtips

Page

1

SA

Pti

ps J

ourn

alJu

ne/Ju

ly 20

06 V

olum

e IV

Issue

3

SAPtips.com SAPtips © 2006 Klee Associates, Inc.

• What are the steps required in cre-ating “HR Forms”?

• What are the advantages that the “HR Forms” provides to users and consultants?

I will begin with an overview of the “HR Forms” and the benefits it provides to users and consultants. I’ll discuss, in detail, the steps required in creating these Forms. Finally, I will

use an example drawn from an easy-for-all company scenario to illustrate my views. I am going to include tips learned from my personal experience and observation.

This article is intended primarily for SAP HR users and consultants. I will assume that the reader is famil-iar with basic HR concepts. For more information, refer to the SAP docu-mentation on http://help.sap.com/. Though the screenshots have been taken from Release 4.7, the tips men-tioned are relevant for later releases as well.

“HR Forms”: An OverviewThe “HR Forms” functionality

allows you to generate sophisticated reports for the Time Management and Payroll submodules. Examples of such reports are Salary Slip and Time Statements. A typical HR form output is shown in Figure 1.

Editor’s Note: Would you like more control of the format and informa-tion in your HR reports? HR and ABAP expert Rehan Zaidi shows you how to use the HR Forms function-ality released with SAP version 4.7. He begins with an overview of the functionality, presents a step-by-step guide for using it, then offers an example that even the “report-ing impaired” user can easily follow. How does he do it? Simple, Meta-Data, MetaTypes, and MetaFigures not withstanding, you’ll shine like a MetaStar with your slick-looking, info-packed HR reports.

IntroductionA major problem with traditional

HR reporting tools is that there is lit-tle control over the output look and design. This may be undesirable in certain situations, particularly when the users’ requirements are very rigid. Since Release 4.7, SAP empowered its clients by pro-viding “HR Forms”, a pow-erful option for generating attractive form-like reports. Due to the ease and control with which you can use “HR Forms”, learning the basics of this tool is essential for SAP HR users.

The goal of this paper is to provide an explanation of “HR Forms” and the way it may be used to generate report outputs. These are some of the questions that this article will address:

• How does “HR Forms” fit into the SAP HR land-scape?

Understanding the SAP® “HR Forms” Architecture– A Guide for SAP HR Users and Consultants

By Rehan Zaidi, Siemens Pakistan

4On HR

Figure 1: Example of HR Forms Report Output

A major problem

with traditional

HR reporting tools

is that there is

little control over

the output.

Page 2: Zaidi Understanding the Sap HRFormsArchitecture 0606 a 110

SAPtips

Page

2

SA

Pti

ps J

ourn

alJu

ne/Ju

ly 20

06 V

olum

e IV

Issue

3

SAPtips.com SAPtips © 2006 Klee Associates, Inc.

“HR Forms” may be cre-ated or changed via the “HR Forms” Workplace (trans-action HRFORMS). You can use two integrated tools to design the layout of the Form from the Workplace, namely Form Builder and Smart Forms. The HR Form Workplace generates a Print Program that is executed by the user for generating report outputs. Upon execution, this program runs the logic for fetching the data that is to be displayed. The respective Smart Form is then called with the necessary param-eters in order to generate the Form output.

Before creating an HR Form, you need to define the MetaData pertinent to your given scenario. MetaData is a catalog that designates the data to be displayed. This data may reside in the master data or may be the compu-tation results of time man-agement or payroll. The HR Metadata Workplace (trans-action HRFORMS_META-DATA) is used for this pur-pose.

The use of “HR Forms” provides numerous advan-tages to SAP users and con-sultants:

• They allow the display of graphics (such as employee photos and company logos) in the form output.

• “HR Forms” provides total control over font type and size of the dis-played text.

• No programming is required, as the approach is based on simple screen-end activities.

viewed or maintained via transac-tion “HRFORMS_METADATA”. The main screen for this transaction is shown in Figure 2.

Enter a suitable name in the Meta-

Net field and click the Display icon. This displays the MetaData options for four areas; namely MetaFigures, MetaDimensions, MetaStars and MetaNets, as shown in Figure 3.

• Using the Form Builder options, PDF-based output may also be generated.

The Anatomy of the MetaData

The data that you need to display in graphical form must be available in the MetaData. It is a good idea to familiarize yourself with the structure of MetaData. The MetaData may be

4On HR

Figure 2: HR MetaData Workplace

Figure 3: MetaData Details Screen

Page 3: Zaidi Understanding the Sap HRFormsArchitecture 0606 a 110

SAPtips

Page

3

SA

Pti

ps J

ourn

alJu

ne/Ju

ly 20

06 V

olum

e IV

Issue

3

SAPtips.com SAPtips © 2006 Klee Associates, Inc.

The information used in a Meta-Net is described using MetaStars, which are based on MetaFigures (key figures) and MetaDimensions (object descriptions or concepts). A MetaDi-mension or MetaFigure may be used in one or more MetaStars.

Each MetaStar has an associated Type. You may view the type of a particular MetaStar by double-click-ing it, which displays the details in the right pane (as shown in Figure 4).

The applicable MetaStar types are Master Data, Time Data, and Payroll. Based on the structure of the each MetaStar used, a correspond-ing internal table is created in the print program. The type determines the struc-ture of this internal table and also the coding necessary for populating such data in the print program. The data access method used by the system for the various types are shown in Figure 5.

A MetaDimension is com-prised of a number of data fields known as MetaFields.

(see Figure 6), which comprises MetaFields “ABSENCE_TYPE”, “PERS_AREA”, “PERS_SUBAR-EA”, and “TEXT”. The first three together comprise the key that uniquely identifies the “Absence

These MetaFields may either be a key that uniquely identifies a MetaDimen-sion, or may simply be an attribute, providing information about a Meta-Dimension. An example of a Meta-Dimension is “ABSENCE_TYPE”

4On HR

Figure 4: Applicable MetaStar TypesType Data Access Method Used

Time Data Data populated at the GET PERNR

Payroll Payroll results are accessed via GET PAYROLL event

Master Data Data accessed from Infotypes using the “HR_READ_INFOTYPE” function module

Figure 5: MetaStar Type and Associated Data Access Method

Figure 6: Displaying the MetaDimension “ABSENCE_TYPE”

Page 4: Zaidi Understanding the Sap HRFormsArchitecture 0606 a 110

SAPtips

Page

4

SA

Pti

ps J

ourn

alJu

ne/Ju

ly 20

06 V

olum

e IV

Issue

3

SAPtips.com SAPtips © 2006 Klee Associates, Inc.

Type”, whereas the “Text” provides a description of the “Absence Type” in question.Tip: SAP provides special icons for denoting the com-ponent of a MetaNet such as MetaStar, MetaDimension, etc. In order to view the vari-ous icons, follow the menu path “Extras ‡ Legend”. The pop-up screen appears, as shown in Figure 7.

In addition to MetaDimen-sions, the MetaFigures are also important. Examples of MetaFigures are Absence Days and Absence Hours. You may double-click on a par-ticular MetaFigure in order to display its detail in the right pane of the transaction. An example of MetaFigure is Absence Hours (as shown in Figure 8).

The MetaFigure “ABSENCE_HOURS” is based on the data type ABSTD. A checkbox, Cumu-late Values, is provided in order to specify whether the values of this field are to be totaled before output. If this indicator is checked, the internal tables based on the MetaStar are filled with data in the print program (using the COLLECT statement), and the respective field is treated as a numeric key field. In case the MetaFigure is associated with a unit, the unit also becomes part of the MetaFigure in question.

Minimal Steps Required in Creating an HR Form

There are three steps required in creating an HR form. Let us go through them one by one.

Step 1 – Creating (or Making Changes in) a MetaNet

The first step involves making suit-able changes in an existing MetaNet in order to suit your business needs. You may copy an existing MetaNet and make necessary changes in it, or create one from scratch. For example, you may add a new MetaStar into a MetaNet in order to incorporate the fields needed in your business scenario.

Step 2 – Creating an HR FormThe next step involves creating

the HR form that generates the print program and other necessary com-ponents. The form may be created via the transaction HRFORMS. The main screen of this transaction is shown in Figure 9.

The green icon denotes that the respective form has an activated sta-tus, whereas the red one indicates that it is in an inactive state.

4On HR

Figure 7: Legend Displaying the Icons of the MetaNet Components

Figure 8: MetaFigure ABSENCE_HOURS

Page 5: Zaidi Understanding the Sap HRFormsArchitecture 0606 a 110

SAPtips

Page

5

SA

Pti

ps J

ourn

alJu

ne/Ju

ly 20

06 V

olum

e IV

Issue

3

SAPtips.com SAPtips © 2006 Klee Associates, Inc.

Select a suitable option. You may choose to create a new HR Form or copy (and make changes to) an exist-ing Form. A copy of the standard HR Form “SAP_PAYSLIP” is shown in Figure 10.

The left pane displays the MetaNet used for the HR Form. You may choose from the com-ponents of the MetaNet the data that you like to display (in your HR Form). Simply drag the data component from the MetaNet into the InfoNet (right pane). Figure 11 shows the corresponding HR Form object name for each MetaData object used.

A dictionary structure based on the InfoNet data is generated automati-cally by the “HR Forms” transaction. The name of the structure is of the form /1PYXXF0/nnnnnnnnn, where nnnnnnnnn is the name of the HR Form. This structure serves as the interface between the print program and the Smart Form in which the layout is specified.

Step 3 – Making Necessary Chang-es in the Smart Form

The third step is to specify the layout of the data that is to be out-putted. As already mentioned, the

4On HR

HR Form automatically generates a Smart Form. The HR Form also cre-ates the necessary “Global Settings” entries as well as the basic layout of the Smart Form. The generated form name has the format ZPYXXFO_nnnnnnnnn, where nnnnnnnnn is the name of the HR form. You may

call the Smart Form by choosing the “Layout” button from the HR Form Workplace.

The Form Interface is similar to the one shown in Figure 12.

Figure 10: Maintaining the HR Form

Corresponding Object in HR Form

MetaNet InfoNet

MetaStar InfoStar

MetaDimension InfoDimension

MetaField InfoField

MetaFigure InfoFigure

Figure 11: MetaData Objects with Corresponding HR Objects

Figure 9: “HR Forms” Workplace

Page 6: Zaidi Understanding the Sap HRFormsArchitecture 0606 a 110

SAPtips

Page

6

SA

Pti

ps J

ourn

alJu

ne/Ju

ly 20

06 V

olum

e IV

Issue

3

SAPtips.com SAPtips © 2006 Klee Associates, Inc.

Of primary importance is the importing parameter HRDATA. The data that is to be displayed is popu-lated (at runtime) into the parameter HRDATA. The type used for defining this data is the dictionary struc-ture generated (from the InfoNet) in the previous step. The “Global Definitions” section is similar to the one shown in Figure 13.

Tip: Make sure that the Smart Form is in an active

state. Otherwise, the HR Form will not be activated.

Note: An entire discussion of Smart Forms is beyond the scope of this article. For more on designing the lay-out of Smart Forms, refer to my article “Displaying Data Quickly and Easily via Smart Forms” available in the ABAP, Java, and J2EE Development category of the SAPTips Document Library.

After carrying out the necessary steps, activate the HR Form using in the menu option Form ‡ Activate. You may then test the print pro-gram by choosing the menu options “Form ‡ Print Pro-gram” and “Form ‡ Print Program (Test)”, as shown in Figure 14.

Putting It All TogetherIn this section, I will use

the concepts mentioned in this article to show how the “HR Forms” option may be used to fulfill a simple user requirement. Suppose you are given the task of generat-ing the salary slips for your company’s employees. Each slip should display the com-pany logo, the allowances

paid to the employee, and the total gross pay to the employee.

4On HR

Figure 13: Form Interface of the Generated Smart Form (Global Definitions Example)

Figure 14: The Print Program Test Functions

Figure 12: Form Interface of the Generated Smart Form (Form Interface Example)

Page 7: Zaidi Understanding the Sap HRFormsArchitecture 0606 a 110

SAPtips

Page

7

SA

Pti

ps J

ourn

alJu

ne/Ju

ly 20

06 V

olum

e IV

Issue

3

SAPtips.com SAPtips © 2006 Klee Associates, Inc.

This requirement may eas-ily be fulfilled using “HR Forms”. The original Meta-Net SAP_PAYSLIP may be used without any changes. An HR Form “ZSAP_PAY-SLIP” is created by copy-ing the standard HR Form “SAP_PAYSLIP”, as shown in Figure 15.

The necessary changes are then made in the generated Smart Form, in order to suit the business requirement. The generated dictionary structure of our HR Form is shown in Figure 16.

The print program may be executed to output the required salary slip in the specified format (refer back to Figure 1).

4On HR

Figure 15: HR Form “ZSAP_PAYSLIP”

Figure 16: Generated HR Form Dictionary Structure

Page 8: Zaidi Understanding the Sap HRFormsArchitecture 0606 a 110

SAPtips

Page

8

SA

Pti

ps J

ourn

alJu

ne/Ju

ly 20

06 V

olum

e IV

Issue

3

SAPtips.com SAPtips © 2006 Klee Associates, Inc.

ConclusionIn this article, I discussed the rudi-

ments of “HR Forms” and their architecture. Then, I listed the steps required in order to create a form of your own. Finally, I discussed a requirement that may be fulfilled via use of this tool. I hope that this article will be a precious resource for you, and will help you in creating form outputs quickly and easily.

Rehan Zaidi, Senior SAP Consultant, Siemens Pakistan. Rehan has been involved in both ABAP development and functional configuration for SAP HR implementations at multination-al and local companies, and also has experience with SAP Workflow. He has contributed articles to the SAP Professional Journal, the HR Expert newsletter, and to the TechRepublic Website. He is currently working on his first book, specifically designed for SAP HR Users and Managers, as well as a guide for ABAP/Workflow Consultants titled “201 Interview Questions on Workflow”. Rehan is the founder of the Web site www.siteofSAP.com. Rehan’s email address is [email protected]. ≈

4On HR

Page 9: Zaidi Understanding the Sap HRFormsArchitecture 0606 a 110

SAPtips

Page

9

SA

Pti

ps J

ourn

alJu

ne/Ju

ly 20

06 V

olum

e IV

Issue

3

SAPtips.com SAPtips © 2006 Klee Associates, Inc.

The information in our publications and on our Website is the copyrighted work of Klee Associates, Inc. and is owned by Klee Associates, Inc. NO WARRANTY: This documentation is delivered as is, and Klee Associates, Inc. makes no warranty as to its accuracy or use. Any use of this documentation is at the risk of the user. Although we make every good faith effort to ensure accuracy, this document may include technical or other inaccuracies or typographical errors. Klee Associates, Inc. reserves the right to make changes without prior notice. NO AFFILIATION: Klee Associates, Inc. and this publication are not affiliated with or endorsed by SAP AG, SAP AG software referenced on this site is furnished under license agreements between SAP AG and its customers and can be used only within the terms of such agreements. SAP AG and mySAP are registered trademarks of SAP AG. All other product names used herein are trademarks or registered trademarks of their respective owners.

SAPtipsJournal