You are on page 1of 18

Creating and designing HR Forms:

This tutorial explains about creating HRFORMS in HR module of SAP using t code HRFORMS. A complete HR form is an executable report with its own selection screen in the SAP System. HRFORMS use the data available from Metanets.
Concept of Metanet, Metastar, Metadimension, Infonet, Infostar and Infodimension.

The MetaNet is a view SAP HR data which can be printed in a form adobe interactive or smartform. It covers all the data in SAP HR module which can be printed. A MetaNet contains MetaStars, which are the individual data sources e.g. employee metastar would contain details about the employee, his address, name etc. The MetaStar is a view of data that can be read from a specific source of data e.g. from a particular infotype or from a particular HR table for payroll or time. The metastar, in turn contain metadimensions and metafigures. The MetaDimension is a complete description of a business object and it contains the relevant business object data metafields which are either key fields or attributes. A MetaDimension can be used in several MetaStars. MetaFields are the fields values or information that exist in a MetaDimension. Each MetaField is part of the key that specifies the MetaDimension in full, or an attribute, a further characteristic of the MetaDimension. Similarly, Infonets, Infostars, Infodimensions and Infofields are the objects which are available in the HRFORM for displaying HR data and are similar to Metanets, metastars, metadimensions and metafields. We can find more details about Metanets using the T code HRFORMS_METADATA.

The first screen of HRFORMS contains all the forms available. In order to create a new form, let us click on the create button.

It asks for form name, country grouping and form class. Give the details as shown and for form class, choose PAYSLIP. We can also go for other types of forms. The difference lies in the various types of metastars that would be available to us while creating the forms. For instance, NONE type forms would show all metastars from which we can fetch data except time metastars. TIME type forms would contain only time metastars and none or limited data about other types. So as we chose PAYSLIP type, we see the following screen:

Click on the green tick mark and it takes us to the following screen:

Let us take a look at the HR Form tab:

It shows the form class which is PAYSLIP Remuneration in our case, and it shows METANET as SAP Standard Metanet. SAP provides a default metanet which contains HR data in various metastars and metadimensions. In Layout, we can choose SAP Smartform or Form Builder. In our case we would choose form builder and make the forms with Adobe interactive forms. The Form builder is the Adobe Interactive form interface and here we would not do much of coding but design the form and values would be automatically populated by the self generated driver program. Had we chosen the smartform option, there is little coding required to be done in smartforms global definition initialization part, apart from the self generated driver program. The Adobe based forms have a prerequisite is that we must have Adobe Live Server installed on our machine and we have required authorizations for the same.

Currently, the ABAP dictionary structure, SAP form and print program are all inactive.
Creating Adobe based HR form:

On the main screen of HR Forms creation, in the HR forms tab, choose Form Builder in the layout structure and from Metanet dropdown, choose SAP default metanet which is the default metanet available for us. We can create our own metanets and even inherit them from standard SAP default metanet by using the t code HRFORMS_METADATA.

From form class, it is Remuneration Statement already chosen. It is for PAYROLL type HR FORM which we chose while we began the HR form creation.

Data flow from metanet to the form:

When SAP creates the HR form, it makes an Infonet with our forms name (zform_ribz2 in this case). The metanet contain metastars which in turn contain metadimensions and metafigures. The metadimensions contain metafields which could be a key field or attribute. We can include (drag and drop) metastars under our forms infonet to create infostars similar to the corresponding metastar. Then we can drag the metadimensions of the metastar below the corresponding infostar and it would create the infodimensions. The fields keys and attribute would come in the structure of our form interface once we are on the form design page. Now suppose we want to show ABSENCE data in our HRFORM

Click on the ABSENCE metastar in the SAP default Metanet and drag it into the infonet window and touch it to the infonet (zform_ribz2). Remember the thumb rule Metastar can go under infonet and metadimension can go under infostar which is made up of the respective metastar. Hence we see that our forms infonet now contains absence infostar. Similarly drag all the metastars into our infonet.

After creating the required infostars by dragging the metastars, we must include various metadimensions into the corresponding infostars by opening the corresponding metastars and dragging the metadimension into the infostar. Each infostar should contain at least one infodimension or infofigure.

So, we drag the corresponding metadimensions and metafigures into out infostars to make infodimensions and infofigures

We can rename or delete any infostar or infodimension.

We can even do the selection on our infodimensions. Infodimensions, like metadimensions contain key fields and attributes and we can give selection criteria in order to fetch the required set of data. E.g. suppose, in our wagetype infodimension,

under pay_result infonet, we want to show only wagetype 1001, we can do this by choosing the selection criteria of the infodimension:

For this, we click on the infodimension and then click on the insert selection button, and we give the wage type as 1001 in the selection box.

Form Design and Layout:

Now, after selecting the metastars and metadimensions which we require in our form and dragging them into our infonet, we click on the layout button on the top.

As we press the layout button, it starts generating the form structure in the data dictionary according to the object we dragged in the infonet and takes us to the Adobe interactive form screen, which is the same screen as t code SFP. It takes us to the context tab of adobe form initially.

It creates the adobe form interface with the data we chose in the infonet before and includes all the infodimensions available there within structures starting with DIM and STAR. Basically this is all the data available to us for the form. On the left hand side is

the Import interface which contains the import structures in the type hrdata and on the right hand side is the form context which have all the structures having all structures under type hrforms. Note that all the structures along with type hrdata from the import interface have been dragged to the context area and they are all locked. We can see the fields available to us by expanding the tree under the context node. If we do not want some of the data in our form, we can still deactivate that particular locked structure in the context area by right clicking and deactivating it. We cant delete the structures in the context as they are all locked. Now, click on the properties tab and we see the following screen:

Initially, in the layout type, it is <unknown type> chosen over there. Click on the dropdown and choose the Standard Layout. Now click on the layout tab, which would take us to the design part of the interactive form.

Here, we can drag and drop the fields available in the data view and work with their formatting and create tabular outputs with positioned or followed types:

It is better if we put a followed table in a new subform as it would contain random number of rows at runtime and it might even overflow if it is not included in a subform. We design our form as per our requirements and then activate the same.

After that, click on back button and it would take us to the Change HRForm screen. Click on the button over there to completely activate the form.

Now, we see that the driver program, the ABAP structure and the SAP Smart form name, all three are active and status of the form is also active.

Now, in order to test our form, click on the back button and it takes us to the first screen of the HRFORMS t code HR Forms Workplace where we see all the HRFORMS available. Choose our form and click on the execute button.

We see the following screen. Make the necessary inputs and click on the execute button.

Click on the print preview button and there we see the output of our HRFORM:

Hence we are done with creating and designing the HR Forms!!