0% found this document useful (0 votes)
924 views351 pages

Selection View

Steps are provided to upload employee photos into a custom infotype in SAP HR. This involves configuring document types, content repositories, and number ranges for archiving. Photos stored on the presentation server must first be transferred to the application server. The photo file name should represent the personnel number and infotype. Using transaction code OAAD, the photo can be linked to the specific personnel master record and custom infotype. Administrators can view and delete archived photos using transaction codes for optical archiving and stored documents.

Uploaded by

jitendrayadavcs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
924 views351 pages

Selection View

Steps are provided to upload employee photos into a custom infotype in SAP HR. This involves configuring document types, content repositories, and number ranges for archiving. Photos stored on the presentation server must first be transferred to the application server. The photo file name should represent the personnel number and infotype. Using transaction code OAAD, the photo can be linked to the specific personnel master record and custom infotype. Administrators can view and delete archived photos using transaction codes for optical archiving and stored documents.

Uploaded by

jitendrayadavcs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 351

Steps for creating Selection View have been explained in detail in this document.

Introduction
In the reports which uses logical database (ex. PNP/PNPCE in case of HR Reports) a dynamic selection screen
button gets added on the selection screen.

On clicking this button it opens up a separate selection screen that can be dynamically adjusted based on the fields
you choose from the left hand side folders (Function groups).

These dynamic selections are defined by creating SELECTION VIEWS as per the requirement. The selection
views are assigned to Reports / Queries (SAP) via Report Category which the report uses.

Purpose of Dynamic Selections:

Enhances report by including selection options not included in the standard selection screen of Logical Databases

To improve performance of reports and queries which use logical databases


This document provides step by step procedure to create Selection View and using the created selection view in the
HR Report for Dynamic Selection Screen.
Step 1:
Execute transaction SE80.

On pressing "Edit Object" button, a pop up appears as:

Select Selection View radio button and Press

"Create" button.

Step 2:
The below Pop Up appears:

Field "Origin of View" defines whether the selection view is Standard or Custom one. On pressing F4 on this
Parameter you will get two values as shown below:

Origin of View is "CUS" as default in this case.


Select Radio button "For any tables".
Enter Name of View (It can be any name).
Press Enter.

Step 3:
Enter the table names whose fields need to be used in the selection view to be created.

In this case we have entered two tables:


1. PA0002 (HR Master Record: Info type 0002 (Personal Data))
2. PA0021 (HR Master Record: Info type 0021 (Family))

Press Enter.
Step 4: The below screen is displayed.

The above screen has 3 sections:


1. Functional Groups: Here you can enter Functional Groups. These are needed to group the selection fields. You
can assign all fields of one table to one function group or fields from one table to many functional groups as per
your requirement.

For this Example let us define two function groups as:


01: Personal Data
02: Family Data

2. Tables/Nodes: Here you can view the tables (you have selected) whose fields you want to add in your selection
view. In this example we have added two tables PA0002 and PA0021.

On Double Clicking a table, all its fields are available in the third section i.e. Table Fields/Node Fields tab where
you can select your fields for selection view.

3. Table Fields/Node Fields: It displays all the fields of the selected table which you want to add in your selection
view for dynamic selection.

For Example,
Let us group fields of table PA0002 in function group 01 and fields of table PA0021 in function group 02.

1) Table - PA0002

2) Table - PA0021

Note: In the right hand side you see check box's for those fields for which grouping is done i.e. for those fields
which are selected. This checkbox determines if you want field to be preselected in the selection screen.

Once the grouping is done as shown above. Press Save.


The selection view "PNP_VIEWTEST" is created.
Using the Selection View in the Program via Report Category
Step 5: Go to Attributes of the Report in Edit Mode.

Select "HR Report Category" Button


Step 6:

Choose the report category which you are using for your report. By Default it is blank.

On Selecting "Report Category",

Under tab "Select View for Dynamic Selections" enter Type as "CUS" and Name "PNP_VIEWTEST" (selection
view created above)
Press Save and Go Back.
Execute Report.

When you select the Dynamic Selection Screen Button, dynamic selection screen appears as:

The dynamic Selection screen is displayed with the selection view "PNP_VIEWTEST" which we created above.
In the left side you can see two folders: Personal Data and Family Data. These are nothing but the function groups
we had created. Also the fields highlighted in green are those fields for which preselect check box were selected.
These fields can be seen as default parameters in dynamic selection screen. You can add delete the fields as per your
requirement.

Procedure to configure change documents for Personnel Administration (PA)


and Organization Management (OM) Infotypes
Note: Below screen shots are taken from SAP ERP ECC6.0 Version

The infotype log creation function allows you to document all changes in HR master data records and create a record
history. Following article explains the configuration to capture PA and OM infotypes audit log.

Part1 - Configuring PA Infotype audit log


Below activities are involved to setup change documents for PA infotype.
1. Determine the infotypes to be logged.
2. Define the field groups.
3. Determine the characteristics of the field groups and, if necessary, define the supplementary field groups.
Additional notes:
You can display any changes made to PA infotype records with report Logged Changes in Infotype Data
(RPUAUD00).
Step1. Determine the infotypes to be logged.
Consider carefully which infotypes and, if necessary, which infotype fields you want to create an infotype log for, as
each document causes an entry to be made to the database.
Example: Further article explains how to configure audit log for Infotype 0008 (Basic Pay).
Go to IMG->Personnel

Management->Personnel Administration->Tools->Revision->Set up

change document

Below popup window will be displayed, double click on HR documents: Infotypes to be logged

Maintain the Infotype 0008 entry as shown below

Now Save the table entries and go back to HR documents: Field group definition as mentioned in below screen
shot

Now maintain the new entry as highlighted in below screenshot.

Procedure for uploading employee photos into SAP-HR IT002


By Venkata Raju Duggirala, Yash Technologies

1. Create a number range for SAP Archive Link:


IMG>Basis Components>Basis Services>SAP Archive Link>Basic Settings>Maintain number ranges.
Tcode: OANR
Create range 01 from 0000000001 to 9999999999 without the external number flag.

2. Document type HRICOLFOTO must exist with document class JPG.


IMG>Basis Components>Basis Services>SAP Archive Link>System Settings>Maintain document types.
Table: TOAVE
Tcode: OAC2

3. Document type HRICOLFOTO must be linked to object type PREL and IT0002.
IMG>Personnel Management>Personnel Administration>Tools>Optical Archiving>Set up Optical Archiving in HR.
View: V_T585O,
In all three columns there are minuses, don't put a flag in the check box.

4. Check which content repository (Archive) is linked to document type HRICOLFOTO and object type
PREL.
IMG>Basis Components>Basis Services>SAP Archive Link>Basic Settings>Maintain Links.
Table: TOAOM_C,
Tcode: OAC3

5. Create this content repository with storage type FILE archive.


IMG>Basis Components>Basis Services>SAP Archive Link>Basic Settings>Maintain content repositories.
Tcode: OAC0
Storage type FILE archive can be attained by clicking on the field Storage type and clicking somewhere else in the
screen with the right mouse button. Choose Possible entries and only then you get a list of all values. FILE Archive
is entry number 08. Choose Version no. 0031 and Archive path something (e.g. C .

6. Link photo to personnel number.


Menu>Tools>Business Documents>Miscellaneous>Stored Documents.
Tcode: OAAD
Click on the Create button. Business objects PREL and Document type HRICOLFOTO. Click on create (fill in the
right personnel number in the pop up and click Continue). Choose the photo (as a JPG file) from the place where it
is saved (e.g. hard disk). SAP will notify that the Stored Document was created successfully. Photo is visible via
PA10, PA20, PA30, and PA40. Double-click to magnify photo.

Step1.

Step2 Click on Store and Assign the below screen will appear. Then click create.

To delete archived document:


Tcode: OAAD
click Find. In document type field select HRICOLFOTO and after execute you get a list of all documents. Select
appropriate document and click on delete icon.
4.7 Version
1).Use SICF Tcode: that displays lot of services. Under sap --> bc there is a service called content server interface.
Activate this service.
2).Now Create the A2 repository with Tcode: OAC0.
3).While creating the repository, keep the Document Area blank, Storage type as R/3 database, Rep. Sub-type will
appear as Normal by default, Version No. as 0046 and in Contents table put 'SDOKCONT1' as the table name.
4).Now upload the picture using Tcode: OAAD
Additional Information for ESS/MSS
And we can call and show the existing photo in MSS/ESS using standard RFC

For more details


http://help.sap.com/Business_Packages/EN/85/24d43b2520b77be10000000a114084/content.htm

Upload photo/ image against particular personnel number in HR master data


in custom info type
By Gurmukh singh Ailsinghani, Capgemini India

Task: To upload photo/ image against particular personnel number in HR master data in custom info type.
Solution:
Things to know: Table (TOAOM) SAP Archive Link - Meta table for links indicates the content repository that
will be utilized for particular object and document type.
Table CREP List of content repositories
Prerequisites:
1. PERNR and infotype must have valid entries. Say custom info type is IT9007
2. Image file name should be represented as concatenation of PERNR and infotype number.jpg [example
900000019007.jpg where 90000001 pernr 9007 infotype]
STEP 1
Firstly go to transaction code CG3Z.
Transferring images from presentation server to Application server. The same can be done by asking the
BASIS team to transfer all the required image file names to application server.

STEP 2
Browse the location for the source file which is to be uploaded.
Browse the location (directory) for the target File where the image has to be stored in sap.
Click on Upload button to upload the image. As seen in the below screen shot.

STEP 3:
To check whether the file has been uploaded or not uploaded, navigate to transaction code Al11 (tcode).
Select your directory and check whether the file is successfully uploaded in required directory.

STEP 4:
Now navigate to transaction code SE38 (tcode) and execute the standard program OA_UPLOAD_AND_LINK.
Values are entered in the screen as shown below : with PREL as business object and HRICOLFOTO as document
type for color documents.

Mention the file path where you are storing all the images to be uploaded for mass migration.

OUTPUT:
The output will provide the list of files accepted for uploading as shown below:-

STEP 5:
Now navigate to transaction OAAD (tcode) to link/assign the documents to PERNR as shown below:-

Click Technical search and then click execute button.

STEP 7:
Enter Personnel number and info type. Click on Enter button.

Select your record and click on display button.

Below screen is displayed.

STEP 8:
Click on Reassign document button.
Click on Enter.

OUTPUT: As shown storage parameters are updated after reassigning the document

Use recording for Steps 6 to 8 for mass upload of images providing the input PERNR and Info type number
to input parameter SAPOBJECTID on selection screen.
Verification:
Navigate to transaction code PA30 (tcode). To check the image id uploaded or not for particular personnel number.
Click on Display button.

OUTPUT: Image on right top has been uploaded.

Calculate and Default wage type amount in infotype 0008 (Basic Salary)
By Rajesh Badita, Arshiya International Ltd

1.

Introduction

To calculate amount for wage type 1010 called special allowance based on some parameters
and to default the same amount in infotype 0008 in Process After Input (PAI) Event on screen .
This can be implemented through USER-EXIT PBAS0001. This user-exit is used for
defaulting values or keying validations checks to transaction PA40 or PA30 for any PA or
Recruitment infotypes
2.

Steps

Go to CMOD transaction and create project say ZHR_PA.

Assign enhancement PBAS0001

Click on components push button and double click on function exit EXIT_SAPFP50M_002

Now double click on ZXPADU02 which is include program.

Implement ABAP logic:

Create a structure ZTBLGART as shown in below screenshot

TYPE-POOLS: abap.
DATA: lw_p0000 TYPE p0000,
lw_p0002 TYPE p0002,
lw_p0008 TYPE p0008,
lw_p0023 TYPE p0023,
lv_spa TYPE pc207-betrg,
gt_p0000 TYPE TABLE OF p0000,
gw_p0000 TYPE p0000.
DATA: lv_retirement_date LIKE p0002-gbdat.
DATA: wa_0008 TYPE p0008,
lv_wgetype TYPE pa0008-lga01,
lv_payment TYPE t510-betrg,
lv_syindex TYPE n LENGTH 2.
DATA: lv_cal_begda TYPE begda,
lv_cal_endda TYPE endda,
lv_cnt TYPE i,
gt_pa2001 TYPE TABLE OF pa2001.
DATA : return TYPE bapireturn1.
DATA: dy_table TYPE REF TO data,
dy_line TYPE REF TO data,
xfc TYPE lvc_s_fcat,
ifc TYPE lvc_t_fcat.
DATA : idetails TYPE abap_compdescr_tab,
xdetails TYPE abap_compdescr.
DATA : ref_table_des TYPE REF TO cl_abap_structdescr.
DATA: lv_basic TYPE ansal_15.
FIELD-SYMBOLS <fs_betrg> TYPE ztblgart.
FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,
<dyn_wa>,
<dyn_field>.
FIELD-SYMBOLS <fs_amount> TYPE ANY.
FIELD-SYMBOLS: <l_betrg> TYPE pad_amt7s,
<l_lgart> TYPE lgart.
IF sy-tcode = 'PA40' OR sy-tcode = 'PA30'.
CASE innnn-infty.
WHEN '0008'.
IF ( ( ipsyst-ioper EQ insert OR ipsyst-ioper EQ copy OR ipsyst-ioper EQ 'MOD' ) OR sy-ucomm EQ 'UPD' ).
DATA lv_field TYPE char40.
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
EXPORTING
prelp = innnn
IMPORTING
pnnnn = lw_p0008.
CLEAR lv_spa.
PERFORM default_spl_allow USING lw_p0008
CHANGING lv_spa.
*** Finding Wage Type field number for the Wage Type 1010
DO 40 TIMES VARYING lv_wgetype FROM lw_p0008-lga01 NEXT lw_p0008-lga02.
IF lv_wgetype = '1010'.
lv_syindex = sy-index.

CONCATENATE 'lw_p0008-bet' lv_syindex INTO lv_field.


ASSIGN (lv_field) TO <fs_amount>.
<fs_amount> = lv_spa.
EXIT.
ENDIF.
ENDDO.
IF lv_spa IS NOT INITIAL.
* Get the structure of the table.
ref_table_des ?=
cl_abap_typedescr=>describe_by_name( 'ZTBLGART' ).
idetails[] = ref_table_des->components[].
LOOP AT idetails INTO xdetails.
CLEAR xfc.
xfc-fieldname = xdetails-name .
* xfc-datatype = xdetails-type_kind.
CASE xdetails-type_kind.
WHEN 'C'.
xfc-datatype = 'CHAR'.
WHEN 'N'.
xfc-datatype = 'NUMC'.
WHEN 'D'.
xfc-datatype = 'DATE'.
WHEN 'P'.
xfc-datatype = 'PACK'.
WHEN OTHERS.
xfc-datatype = xdetails-type_kind.
ENDCASE.
xfc-inttype = xdetails-type_kind.
xfc-intlen = xdetails-length.
xfc-decimals = xdetails-decimals.
APPEND xfc TO ifc.
ENDLOOP.
* Create dynamic internal table and assign to FS
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = ifc
i_length_in_byte = 'X'
IMPORTING
ep_table
= dy_table.
ASSIGN dy_table->* TO <dyn_table>.
ASSIGN ('(MP000800)TBLGART[]') TO <dyn_table>.
* Create dynamic work area and assign to FS
CREATE DATA dy_line LIKE LINE OF <dyn_table>.
ASSIGN dy_line->* TO <dyn_wa>.
LOOP AT <dyn_table> ASSIGNING <dyn_wa>.
ASSIGN COMPONENT 'LGART' OF STRUCTURE <dyn_wa> TO <l_lgart>.
IF <l_lgart> = '1010'.
ASSIGN COMPONENT 'BETRG' OF STRUCTURE <dyn_wa> TO <l_betrg>.
<l_betrg> = lv_spa.
EXIT.
ENDIF.
ENDLOOP.
CALL METHOD cl_hr_pnnnn_type_cast=>pnnnn_to_prelp

EXPORTING
pnnnn = lw_p0008
IMPORTING
prelp = innnn.
ENDIF.
ENDIF.
ENDCASE.
ENDIF.

Subroutine logic:

*----------------------------------------------------------------------*
***INCLUDE ZXPADF02 .
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Form DEFAULT_SPL_ALLOW
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
*
-->P_LW_P0008 text
*
<--P_LV_SPA text
*----------------------------------------------------------------------*
FORM default_spl_allow USING p_p0008 TYPE p0008
CHANGING p_betrg type pc207-betrg.
TABLES t511.
DATA: BEGIN OF lwa_wage,
lgart TYPE p0008-lga01,
betrg TYPE p0008-bet01,
END OF lwa_wage,
BEGIN OF lwa_indbw,
indbw TYPE p0008-ind01,
END OF lwa_indbw,
BEGIN OF lwa_betrg,
bet TYPE p0008-bet01,

END OF lwa_betrg.
DATA: lit_ptbindbw TYPE TABLE OF ptbindbw,
lwa_ptbindbw TYPE ptbindbw.
DATA: l_date TYPE d.
DATA: BEGIN OF lt_ptbindbw OCCURS 20,
seqnr(3).
" sequence number
INCLUDE STRUCTURE ptbindbw.
DATA: END OF lt_ptbindbw.
DATA lw_lgart TYPE lgart.
DATA: lv_basic TYPE betrg,
lv_hra TYPE betrg,
lv_conv TYPE betrg,
lv_educ TYPE betrg,
lv_gross TYPE betrg,
lv_car TYPE betrg,
lv_med TYPE betrg,
lv_food TYPE betrg,
lv_attire TYPE betrg,
lv_cca TYPE betrg,
lv_fuel TYPE betrg,
lv_lta TYPE betrg,
lv_bonus TYPE betrg,
lv_gratuity TYPE betrg,
lv_pf TYPE betrg.
DATA: gw_p0001 TYPE p0001,
gw_p0007 TYPE p0007,
gw_p0014 TYPE p0014,
gw_p0015 TYPE p0015.
DATA: gt_p0001 TYPE TABLE OF p0001,
gt_p0007 TYPE TABLE OF p0007,
gt_p0014 TYPE TABLE OF p0014,
gt_p0015 TYPE TABLE OF p0015.
CLEAR: lv_basic, lv_hra, lv_conv, lv_educ, lv_gross, lv_car, lv_med, lv_food, lv_attire, lv_cca, lv_fuel,
lv_lta, lv_gratuity, lv_pf, lv_bonus.
REFRESH gt_p0001.
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
* TCLAS
= 'A'
pernr
= p_p0008-pernr
infty
= '0001'
* BEGDA
= '18000101'
* ENDDA
= '99991231'
* BYPASS_BUFFER
=''
* LEGACY_MODE
=''
* IMPORTING
* SUBRC
=

TABLES
infty_tab
= gt_p0001
EXCEPTIONS
infty_not_found
=1
OTHERS
=2
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
SORT gt_p0001 DESCENDING BY endda.
READ TABLE gt_p0001 INTO gw_p0001 INDEX 1.
REFRESH gt_p0007.
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
* TCLAS
= 'A'
pernr
= p_p0008-pernr
infty
= '0007'
* BEGDA
= '18000101'
* ENDDA
= '99991231'
* BYPASS_BUFFER
=''
* LEGACY_MODE
=''
* IMPORTING
* SUBRC
=
TABLES
infty_tab
= gt_p0007
EXCEPTIONS
infty_not_found
=1
OTHERS
=2
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
SORT gt_p0007 DESCENDING BY endda.
READ TABLE gt_p0007 INTO gw_p0007 INDEX 1.
REFRESH lit_ptbindbw.
DO 40 TIMES VARYING lwa_wage-lgart FROM p_p0008-lga01
NEXT p_p0008-lga02
VARYING lwa_indbw-indbw FROM p_p0008-ind01
NEXT p_p0008-ind02
VARYING lwa_betrg-bet FROM p_p0008-bet01
NEXT p_p0008-bet02.
IF lwa_wage-lgart IS NOT INITIAL.
MOVE-CORRESPONDING lwa_wage TO lwa_ptbindbw.
MOVE-CORRESPONDING lwa_indbw TO lwa_ptbindbw.
MOVE lwa_betrg-bet TO lwa_ptbindbw-betrg.
APPEND lwa_ptbindbw TO lit_ptbindbw.
ELSE.
EXIT.

ENDIF.
ENDDO.
CALL FUNCTION 'RP_EVALUATE_INDIRECTLY_P0008'
EXPORTING
ppernr
= gw_p0001-pernr
pmolga
= '40'
" gw_molga
pbegda
= p_p0008-begda
pp0001
= gw_p0001
pp0007
= gw_p0007
pp0008
= p_p0008
* IMPORTING
*
pendda
= v_endda
TABLES
ptbindbw
= lit_ptbindbw
EXCEPTIONS
error_at_indirect_evaluation = 1.
CLEAR lwa_ptbindbw.
READ TABLE lit_ptbindbw INTO lwa_ptbindbw WITH KEY lgart = '1002'.
IF sy-subrc EQ 0.
MOVE lwa_ptbindbw-betrg TO lv_basic.
ENDIF.
CLEAR lwa_ptbindbw.
READ TABLE lit_ptbindbw INTO lwa_ptbindbw WITH KEY lgart = '1006'.
IF sy-subrc EQ 0.
MOVE lwa_ptbindbw-betrg TO lv_hra.
ENDIF.
CLEAR lwa_ptbindbw.
READ TABLE lit_ptbindbw INTO lwa_ptbindbw WITH KEY lgart = '1008'.
IF sy-subrc EQ 0.
MOVE lwa_ptbindbw-betrg TO lv_conv.
ENDIF.
CLEAR lwa_ptbindbw.
READ TABLE lit_ptbindbw INTO lwa_ptbindbw WITH KEY lgart = '1007'.
IF sy-subrc EQ 0.
MOVE lwa_ptbindbw-betrg TO lv_educ.
ENDIF.
CLEAR lwa_ptbindbw.
READ TABLE lit_ptbindbw INTO lwa_ptbindbw WITH KEY lgart = '1005'.
IF sy-subrc EQ 0.
MOVE lwa_ptbindbw-betrg TO lv_med.
ENDIF.
CLEAR lwa_ptbindbw.
READ TABLE lit_ptbindbw INTO lwa_ptbindbw WITH KEY lgart = '1012'.
IF sy-subrc EQ 0.
MOVE lwa_ptbindbw-betrg TO lv_food.
ENDIF.

CLEAR lwa_ptbindbw.
READ TABLE lit_ptbindbw INTO lwa_ptbindbw WITH KEY lgart = '1015'.
IF sy-subrc EQ 0.
MOVE lwa_ptbindbw-betrg TO lv_fuel.
ENDIF.
lv_gross = p_p0008-ansal / 12.
REFRESH gt_p0015.
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
* TCLAS
= 'A'
pernr
= p_p0008-pernr
infty
= '0015'
* BEGDA
= '18000101'
* ENDDA
= '99991231'
* BYPASS_BUFFER
=''
* LEGACY_MODE
=''
* IMPORTING
* SUBRC
=
TABLES
infty_tab
= gt_p0015
EXCEPTIONS
infty_not_found
=1
OTHERS
=2
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT gt_p0015 INTO gw_p0015 WHERE begda LE p_p0008-endda
AND endda GE p_p0008-begda.
IF gw_p0015-lgart EQ '1004' OR gw_p0015-lgart EQ '1028'.
lv_lta = gw_p0015-betrg / 12.
ELSEIF gw_p0015-lgart EQ '1001'.
lv_bonus = gw_p0015-betrg / 12.
ENDIF.
ENDLOOP.
lv_pf = ( lv_basic * 12 ) / 100.
lv_gratuity = ( ( 15 * lv_basic ) / 26 ) / 12.
p_betrg = lv_gross - ( lv_basic + lv_hra + lv_conv + lv_educ + lv_med + lv_food +
lv_fuel + lv_lta + lv_pf + lv_gratuity ).
CALL FUNCTION 'HR_IN_ROUND_AMT'
EXPORTING
amount
= p_betrg
rndoff
= '100'
rndlmt
= 'N'
IMPORTING
retamt
= p_betrg
* DLTAMT
=

.
ENDFORM.
" DEFAULT_SPL_ALLOW
*&---------------------------------------------------------------------*
*& Form re511
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
*
-->P_MOLGA text
*
-->P_LGART text
*
-->P_ENDDA text
*----------------------------------------------------------------------*
FORM re511 USING p_molga TYPE molga
p_lgart TYPE lgart
p_endda TYPE endda.
IF ( t511-molga NE p_molga ) OR
( t511-lgart NE p_lgart ) OR
( t511-endda LE p_endda ) OR
( t511-begda GE p_endda ).
SELECT * FROM t511
WHERE molga = p_molga
AND lgart = p_lgart
AND endda GE p_endda
AND begda LE p_endda.
ENDSELECT.
IF sy-subrc NE 0.
CLEAR t511.
ENDIF.
ENDIF.
.
ENDFORM.

3.

Desired Result:

Go to PA30 and create infotype 0008 record for an employee

Now press enter or click on save button after entering other components like basic, hra, conveyance etc,
user exit will be called and calculates special allowance component automatically based on other wage
types amounts. Hence it defaults calculated amount for wage type 1010 in infotype 0008 as shown in
below screenshot.

Step by Step instructions to create Report Category for LDB for ABAP HR
By Piyush Mathur, Tata Consultancy Services

Logical data is important part in ABAP HR programming. SAP Provides many LDB to use the data in perfect way
without much coding. We normally use PNP, PNPCE LDB in HR ABAP reports and use Standard LDB screens
report. LDB screen are based on report category. SAP Provides many Report Category for each LDB, so it can be
use for multiple purposes. Sometimes during for custom report development, we dont find the Report Category as
per our requirement and we need to add the unwanted fields on selection screen. SAP provides options to create
custom report category which user can design based on the requirements. This document contains step by step
instruction to create HR Report Category for PNP logical database.
Select Attributes from SE38 screen. Pass Logical database as PNP and click on Report Category

Next screen, you will see an option for to pass Report Category. Press F4 and its will display the avaliable Report
Category for PNP Logical database.

Here are some of the examples of standard report Category.

To create new Report Category, click on Report Category

Now click on New Entries on Next screen:

Now give a name for report category and description. In this example, we are creating LDB Screen for PNP LDB, so
uncheck the highlighted check box.

Now make the selection for Selection period as per your requirements.

And now click on Allowable selection criteria and New Entries.

IN this screen, you can add the fields which you want to have on your LDB Screen. For example:

Save the changes and store in the transport request.

Now use the new Report category.


Add the required code in your report for LDB and your new screen is ready.

How to create File layout using Transaction PU12


By Kamesh G, Infosys Technologies

Introduction
This document explains How to create File layout using TCODE:PU12, How to run PU12 Interface and How to
delete PU12 interface results if required. (This document is continuation of my previous document on PU12).
File Layout:
The default output for PU12 is text files .And we need to define a file layout of our exported data.

Give Custom name for the file layout and Press Create (F5) .Give assigned Interface format and Description as
below.

Continue and generate the programs clicking the


file layout.

icon and then suggest values, and then save and generate the

Layout would be like below when we create a new file layout.

Here File layout and Logic for fields would be dependent on requirement .I would try to explain how to create
block, Structure and Structure fields and how to assign field value and how to assign a user exit to the field and how
to define a constant value to a field.
Steps to create a file layout:
File Layout hierarchy is explained below.
Blocks are at the top level of the hierarchy and they do not contain any data by themselves, they contain further
structures which also do not contain any data, each structure can contain fields which actually contain data in them.
It is important to use these as per our logic for the requirement.
1. Creating a Block :
Place the cursor on Blocks and Hit

Create (F5). Following Block is Begin of

File which contains File indicator.

Give the Block name and processing time as shown above .Default value of Processing time would be During
processing of employee data .If the block is for file Header change value to Begin Of file as shown above.
It will be repeated once, and the output will be exported into the main export file, we can choose additional 4 files to
send the output in.
Using the same procedure, I have created 3 Blocks as shown below.

2. Creating a Structure :

To Create Structure place the cursor on particular block and Hit


Here I am creating a structure for Begin of File block.

Create (F5).

3. Creating a Structure field:


Field contents can be set using following methods:

A constant value, as it says will replace the contents with a constant value, irrespective of the contents of the
infotype.
Dynamic value will get the data from the infotype or the global variables, there are many global variables available,
that is available by hitting F4).
A user exit will execute a custom routine and the returned value will be placed in the contents.

a. Assigning Constant value to the field.


To Create Structure field, Place the cursor on Structure Hit

create (F5).

Below Example explains defining field content using Constant Value


Give Field name (Given as HOF Header of file) and field length and Content is constant.

Filed value would be like below.

b. Assigning dynamic value to the filed.


For Block FILL_STRUCTURE, create Structure IT0001 and Create Structure field IT0001_PERNR.
Below Example Explains defining Dynamic value for field.

Give Reference field like below for PERNR.

Current entry makes sure that the record is active and value would be look like below.

C. Assigning User-Exit to the filed.


Before assigning User Exit to a field, Ensure that the program and Routine should exist .We can create a program
through the TCODE: SE38 and maintain a routine in the same program and use the program and routine as shown
inthe example.
Ex: Create a field IT0001_ENDDAin the FILL_STRUCTURE .

Here transferred values are to be used as Formal parameters in the routine GET _DATUM.
In the transferred values we can use Info type structure fields also from info types used in the Interface format (ex:
P0000, P0001 etc.).
We can give maximum 15 import parameters in the above screen .Form should be like shown in example code
below.

Now in the above screen for field IT0001-ENDDA user exit is defined .example code is attached below.
*----------------------------------------------------------------------*
* --> p1
text
* <-- p2
text
*----------------------------------------------------------------------*
FORM GET_DATUM using l_value
l_value1
$var03
$var04
$var05
$var06
$var07
$var08
$var09
$var10
$var11
$var12
$var13
$var14
$var15
changing returning.
select * from t549q where permo = '01'.
MOVE-CORRESPONDING t549q to gt_t549q.
append gt_t549q.

endselect.
Loop at gt_t549q where pabrj = l_value1 and pabrp = l_value.
returning = gt_t549q-endda.
endloop.
ENDFORM.
Above form shows 15 formal import parameters, and one changing parameter.
Here returning value would be file output value .based on requirement we can import values and can change the
changing parameter value.
Now the file layout would be like below.

How to execute/Run PU12 Interface.

TCODE: PU12

SAP Documentation will be available for Export options (Check with f1.)
5 Export files are available and while defining a node we can give the Export file name.
In below screen out put file is main export file.

Append to export files will you option to add the output of the multiple runs to same file .Display log will display
the History like below.

How to download Results into text file:

Target system can be Application server also.


In TemSe Object, hit F4.and select Option shown below.

Select the latest TemSe file like below.

And execute it .This will create a text file on your system, which will contain all the results.
How to delete previous runs results:

We can select multiple rows and Click on Delete.

PU12 - Interface Tool Box in SAP HR


By Kamesh G, Infosys Technologies

This document Explains How to Create Interface Format using Interface Tool Box.
Introduction:
HR Interface Toolbox is used for transferring HR Master Data, Payroll data and time data from SAP R/3 system
to a third party system or the data can be used internally. The interface can be used for the evaluation of HR data
(Payroll/time) and running payroll partially or completely in a third party system
TCODE : PU12
Before Creating New Interface format following screens will explain the purpose of Different
Tabs Available in PU12.
1. Purpose of Export tab is to execute the interface and read the results.

2. Purpose of Export History tab is to see the log over view and the results of executed Runs in the past.

Give the Interface format name and personnel number to view the results of previous executions using Display.
And the previous results can be deleted using Delete Option.
3. Configuration tab contains all of our development/configurations.

Interface Format: Here we specify the input layout of interface; we will specify the tables, info types and fields,
plus we will do the conversions, restrictions, change validations and other configurations to pick the right data for
our interface.
File Layout: In File Layout, we will specify the output of the interface,
We need to generate the Interface Format and File Layout every time we do a change in any of them, so that it
generates fresh ABAP code for the configuration and we do not get any error.
Creating new Interface format.
Steps for creating a New Interface format.

I. For creating a new interface format, go to Transaction PU12. Enter the New Interface name and click on Create
PU12-> Configuration Tab -> Give interface format name (To be created) -> Create.

2. Give Country group. One PU12 interface format is only for one country, if you are dealing with many countries,
then need to create as many interface formats. This step cannot be changed later, if you chose a wrong country then
you will have to delete the interface and create it again from scratch. File format can be reused for other countries as
it does not require country grouping.

3. Continue, Select Master data or Payroll results .Here taking Master Data

4. Include the info types which are required by the interface.

5. It Prompts for Main program and Includes .Click on Suggest Values it will propose Main program and Includes.

Interface format would be look like below:

Choose all the required fields and remove all other fields, this will be useful in the overall runtime of the interface
and reducing the fields will be good in troubleshooting and debugging, as the code generated will fetch data for all
the fields that are included here .

Double click on the field and click the delete button to remove them:

Below is the reduced info type structure after deleting BEGDA and ENDDA.

Click the Icon

to specify which entries to be picked.

All Radio buttons are self -Explanatory.


Click on

All Attributes are explained in SAP Documentation (give F1 in any checkbox for Documentation).

Click on icon

to see the Export program.

We can filter filed values. Place the cursor on filed and click on Filter.

After filtering, find filter symbol for the field like below.

On field level Click on Icon


(Conversions). Conversions are Useful to define a constant value or table Value or
User exit (will be a routine to implement logic).
a. Constant Conversion :
This Option is used to convert the value of a particular field to constant value and will be provided in a table Format.
Here Example is constant conversion Files STAT2 in info type 0000.

Continue, Below Example is only for the sake of learning .

Find the icon for the field after Constante value conversion is defined.

2. Table value conversion

To perform this operation, Place the cursor on the field Click - Conversionschoose Table value and continue.
Enter the table name and field name as given below and continue.

User exit Coversion:

from application toolbar,

Program name and form routine should defined before itself. Logic in the form is dependent on requirement.

Overview on Feature (HCM)


By Suneetha Mattaparthi, Accenture

Purpose of Features:

Features serve to determine certain values based on HR structures. These return values or results can be individual
values, structures, or tables. Using features enables you to do the mapping of decision trees without requiring any
programming.
The SAP standard supports you with its numerous features that determine suggested values and control system
flows.
Two special function modules are used frequently in HR:
HR_FEATURE_BACKFIELD (Reading a feature with field return).
HR_FEATURE_BACKTABLE (Reading a feature with table return).
Maintaining features: You maintain features with transaction PE03. The three most important elements of feature
are:
1)

Attribute

2)

Structure

3)

Decision tree.

ATTRIBUTE: The attribute (see figure 1) shows the person responsible for the entire feature and for maintenance
of the structure.
Using this feature element, you can regulate whether this person may be the only person responsible for
maintenance of the feature and the structure.
A program of type S (subroutine pool) is created from the specification in the decision tree when the feature is
activated. The feature is also assigned to countries and components.

Figure 1: The attribute of the feature.


STRUCTURE: A structure for setting up a decision tree must be assigned to every feature.
The specification of the fields of the structure can be queried in the decision nodes. Structures are defined in the
ABAP dictionary. The marked fields can then be used in the decision tree.
The Company Code, Personnel Area, Personnel Sub Area, Employee Group is selected in Figure 2.
You can also enter a field name in BACK VALUE FIELD NAME to enable more user friendly maintenance in the
decision tree.
FIGURE2: Structure of Feature.

When the field specified here has a check table or refers to a domain with fixed value, these values are present in
tree maintenance as entry helps and text display. The passing type determines if the return occurs as field (1) or a
table (2).
Accordingly, when a program calls the feature, ensure that the transfer type is compatible and that the fields required
for the decision are populated.

Maintaining the decision tree:


You can maintain the decision tree in tree maintenance and in table maintenance.
Figure 3 illustrates the tree maintenance with various processing
Functions, including create, change, or delete. Maintenance of tables occurs directly.

Figure 3: The Decision Tree


The following operations are available for tree and table maintenance.

Figure 4: Various operations


1)

Return operations: This operation defines the return values of the feature.

2)

Decision operation: you can use decision operations to query the contents of a field or a decision structure.
You can also query in sections with offset and length and use smaller than (<), greater than (>) and equals to
(=).

3)

Next operation: You can only use next operations in table maintenance.

4)

Sub feature operation: The sub feature operation calls an additional feature. Processing continues with this
feature.

5)

Debugging operations.

You use the BREAK operation to access the user-dependent debugging mode
purposes. This operation is structured as follows:
BREAK=<username>.
6)

Error operations.

Operation ERROR does not transmit any back value. Instead, error status 2 is set.
constellation that is not permitted in the decision tree.
7)

for troubleshooting

Error status 2 displays a

Program operations: if evaluations become too complex or if more data is needed, you can also call an
ABAP routine in a customer specific subroutine pool. The pool must contain a subprogram called

EXT_CALL_F (for field return) or EXT_CALL_T (for table return). The subprograms must be populating the
return value BACK or BACK_TAB. In addition, you can set STATUS to 2 if an error occurs.
The following code is generated at activation and saved under the name
Example /1PAPA/FEAT800Z0006

Z0006_FEAT_BACK is called when PERSG does not have the specifications 1. The return value is determined
in routine EXT_CALL_F.

Function module HR_FEATURE_BACKFIELD calls feature Z0006.

Structure PME01 is populated with the last valid values of Infotype 0001. In the calling program, the PERSG
field is populated from the return value of the feature.

Demo on Feature creation (HCM)


By Suneetha Mattaparthi, Accenture

Purpose of Features:
Features serve to determine certain values based on HR structures. These return values or results can be individual
values, structures, or tables. Using features enables you to do the mapping of decision trees without requiring any
programming.
The below feature is created to default values of Employee Group field.
Enter PE03 Transaction. Enter Feature Name and click on Create button.

Enter the description in the Title. This feature is for defaulting values for Employee Group.
The Attribute shows the person responsible for the entire feature and maintenance of the structure.

Select the option for which countries the feature should work and save it.

Click on Enter. The fields available in Structure PME01 appear as shown in below screen.

Select fields for decision operation and save the entries.

From the initial screen, Select Decision Tree option and click on change

Place the cursor at feature name and click on create

Select the option Field for decision operation

The selected fields during structure assignment will be available for selection.
Select BUKRS (company code) and click on Transfer. The various values for company code will be available for
selection.

Select the Company code value based on the requirement. Here Company code value 1000 is being selected.

Similarly select Werks (personnel area), BTRTL (personnel Sub Area).

Select the Personnel Sub Area value, Select Return Value Radio button, Select value from Employee Group.

If required Otherwise Node can be used or it can be deleted as per requirement.

IF Company Code value (BUKRS) is not equal to 1000 then the return value for the feature can be obtained using
OTHERWISE node operation. Here you can create a program which handles the condition.
Select Otherwise and click on create.

This program is called when company code doest not have the specification 1000.

The return value is determined in routine EXT_CALL_F.

A program of Type S (subroutine pool) is created from the specifications in the decision tree when the feature is
activated. The feature is also assigned to countries and components.

The code looks as below.

Create a program Z_FEAT_CALL.

Call the function module HR_FEATURE_BACKFIELD which calls feature Z0008.

Enter the Personnel Number in the selection screen whose Company code, Personnel area and Personnel sub area
satisfies the requirements mentioned in the FEATURE.

Output of the program is the return value mentioned in FEATURE.

For Pernr 1508

The company code (BUKRS), personnel area (WERKS), personnel subarea (BTRTL)
Values match the requirement mentioned in the Decision Tree.

Step by Step instruction for IBAN implementation in SAP HR Infotypes


By Piyush Mathur, Tata Consultancy Services

Definition of IBAN (International Bank Account Number)


The International Bank Account Number (IBAN) is an international standard for identifying bank accounts across
national borders with a minimal of risk of propagating transcription errors. It was originally adopted by the
European Committee for Banking Standards (ECBS), and was later adopted as an international standard under
ISO 13616:1997 and now as ISO 13616-1:2007
Bank identifiers vary from country to country. Many European countries have no system of bank number or sort
codes. The recipient bank is often encrypted in the recipient account number. The IBAN enables the account, bank,
and country of a payee to be determined in the same way in each country, thereby eliminating problems in crossborder payment transactions.
Structure of IBAN
The IBAN is a combination of country key, check digit, and the country-specific account number. It can be used
instead of the bank details to give unique identification of an account.
The IBAN is an alphanumeric string of a maximum of 34 characters. Its length can be determined by individual
countries.
Only numerical characters (0 9) and capital letters (A Z) are permitted.
Example of IBAN:
The following table shows an example of an IBAN in Germany : DE77123456781234567890

DE

77

12345678

1234567890

Country Code

Check Digit

Bank Number

Customer Account Number

IBAN in SAP HR Infotypes:


Below infotypes can be maintained for IBAN :

Bank Details (infotype 0009)

External Bank Transfers (infotype 0011)

Membership Fees (infotype 0057)

Steps to add IBAN field in Infotypes:


IBAN filed can be added in Infotypes by activating the switch in table T77S0.
Currently there is no IBAN field avaliable in IT0009.

Now activate the switch. Go to T code SM31 and open V_T77S0 for maintenance.
Now maintain values S for ADMIN and IBAN to activate the switch.

Now you can see the IBAN filed in IT0009.

Click on Propose IBAN button and system will generate the IBAN no based on the Bank Country, Bank Key and
Bank account.

To maintained IBAN no for all previous record, an upload programs needs to be developed to upload the IBAN or a
program can be developed to generate the IBAN for the records.
Below piece if code can be used to generate the IBAN no.

Creating a custom Metanet


By Mohammed Zuber, IBM India

This tutorial explains about creating a custom Metanet in HR Module of SAP using T.Code
HRFORMS_METADATA.
MetaNet: The MetaNet is a view of printable data in the
SAP System. It covers all data sources in Human Resources
that are available for the form creation process. The
MetaNet is provided by SAP or can be created and represents a directory from which you can select data to be
printed in forms. The MetaNet contains the following objects represented in a hierarchy:

1. MetaStar
2. MetaDimension
3. MetaField
4. MetaFigure
MetaStar: A view of data that can be read from a specific data source in the SAP R/3 System.
MetaDimension: Complete description of a business object or concept.
MetaField: Items of information in a MetaDimension. Each MetaField is part of the key that completely specifies the
MetaDimension, or it is an attribute, an additional characteristic of a MetaDimension.
MetaFigure: A key figure. If the key figure is linked to a unit, this unit is also part of the MetaFigure.
When we require custom MetaNet: SAP provides SAP_DEFAULT (SAP standard MetaNet) which contains all possible
data of SAP standard HR master data, personnel time data, and payroll results. If there is any new infotype created or any
data required in the output from any new custom infotype then a new node must be created into the MetaNet. We create a
new custom MetaNet and calls SAP provided MetaNet into that and then add new node based on requirement.
E.g.;
Here, in our case all payroll results are stored into a custom infotype. Data form the custom infotype can not be
populated using standard SAP MetaNet. Therefore, I have created a custom MetaNet and added a new node for
custom infotype. The complete steps are written below in details.Transaction for creation of custom MetaNet:
HRFORMS_METADATA

Step 01: Give the Custom MetaNet name and Choose Country then click on Create button. For example:
MetaNet: ZCUSTOSMMETANET
Country: Great Britain
Step 02: In the maintenance screen of the MetaNet, we see there are three columns in left side
MetaFigures, MetaDimensions, MetaStars and in the right side work place for MetaNet.

Step 03: If there is any field that has reference table for the currency/ Quantity field then a custom MetaFigure must be
created under MetaFigure column for that field. Click on the create button of the MetaFigure column and give a custom
MetaFigure name starting with Z* and description. For all such type of fields corresponding MetaFigures must be created.

For example: Name: ZTEXT_AMOUNT


Description: Tax Amount
Step 04: Details of the Metafigure crated under step 03 must be mapped with the unit that can be done on the right
hand side bottom of the screen. Reference table name and field must be maintained here. Remember Field name
must be unique for each MetaFigure, i.e. if there are five quantities fields in the MetaFigures then all fields name
for the Unit must be different where as Field Type may be same. Field Type for the MetaFigure must be same as
data element of the corresponding field.
If field has cumulate values then check the check box of cumulate Values.

Step 05: If any table need to add into the MetaNet then a custom MetaDimension must be created. Click on the
create button of the MetaDimension column, give MetaDimension name starting with Z and description.

For Example: Name: ZINFOTYPE9308


Description: Infotype 9308 data
Step 06: Each field must be created under the MetaDimension, including key fields that will be used for fetching
data and the fields that need to populate into the output. Those fields are called MetaFields. Right click on the
custom MetaDimension choose create field.

Give the field name and description: for example: Name: BEGDA
Description: Begin date
Similarly create all MetaFields.
Step 07: Mapping of the MetaDimension must be done after creation of all Metafields. After just clicking on the
MetaDimension on the right hand side bottom of the screen mapping can be done.
In the first tab MetaDimension give the table name form which data need to populate.

On the MetaFields tab map the table fields with the Metafields. For identifying key fields and attributes just double
click on the first column.

Here Is the example first three fields BEGDA, ENDDA & PERNR are key fields that will be used for fetching data,
where as rest all fields are attribute.
Step 08: Create a new MetaStar, click on the create button of the MetaStar column. Give the custom MetaStar name
starting with Z and description.

For example: Name: ZINFOTYPE9308


Description: Infotype 9308
Just drag and drop all MetaFigures & MetaDimensions form the MetaFigures and MetaDimensions column to the
custom MetaStar.

Step 09: When all required MetaFigures & MetaDimensions are inserted under then custom MetaStar then map the
fields, on the right hand side of the screen. In the first MetaStar give type as Master Data & Infotype name.

Go to tab MetaFields, then map Metafields (here only Key MetaFields will be displayed) with the infotype fields.

Go to tab MetaFigures and Map Metafigure with the fields of Infotype and also the unit field of the infotype.

Step 10: Finally click on the work place of the MetaNet , Information about the MetaNet will display at the bottom
of the window. Give the details as shown in the screen shot.

Step 11: Just drag and drop custom metaStar form the metaStar column to metaNet workplace.

Step 12: Save and exit form the MetaNet. This custom MetaNet ( ZCUSTOMMETANET) can be used in HR
Forms.

How to Store Simulation Payroll Result for any Reconciliation


By Sai Kumar Bonakurthi, HCL Technologies

This document tells us how to capture runtime pay results and store in custom table during the simulation
payroll for any reconciliation.
Note: Here I am using Australia Payroll, for any country payroll logic is same.
For this first of all we have to create the Payroll Function and insert the function into payroll schema after
final processing step of the schema.
Create a payroll function using T.code PE04.
The Naming convention should be Z_ if we use only Z it allows only to store in standard package

Now pass the function description. There is option available to create function to corresponding to any countries.
Select the Country.

Add Input parameter to the Function..

Select the Program

There are two ways to write our code for the newly created Function.

By using Enhancements spots

By using access key

Here we would be using enhancements spots.


Choose the Enhancement spot from the Program.

Select Show implements enhancement options


Place the cursor on the spot and select Create implementation (Edit->Enhancement operation->Create
Implementation).
Create Enhancement implementation.

A spot will be created to write our custom code.

Create a table to store the data.

The below code is to take the data form RT table from final result of the simulation payroll and store the data in the
table at runtime for the wage types that maintained in the Set or wage type maintenance table.
We have the condition here this will run for the T.Code PC00_M13_CALC_SIMU' and the data in the table will be
store and modify for next time run.
Note : Data will store for one month only ie. Let say we run the simulation payroll for the month of Aug 09 all the
related amount will be store in the ztable that are maintained in SET. If we run for AUG the data will be over write
the existing one. Then if we run the simulation payroll for the Sep 09 the all the data store for the Aug be cleared and
only sep 09 will be available.
*----------------------------------------------------------------------*
DATA : it_final TYPE TABLE OF zhrtr_aus_wt_du ,
wa_final TYPE zhrtr_aus_wt_du.
DATA : r_wages TYPE hrpayjp_range_lgart,
w_wages TYPE pjpsk_range_lgart.
DATA :it_ab_wage TYPE TABLE OF rgsb4,
wa_ab_wage TYPE rgsb4.
DATA : lv_check TYPE i.
DATA : wa_rt TYPE pc207 .
IF tst_on = 'X' and sy-tcode = 'PC00_M13_CALC_SIMU' .
SELECT SINGLE * FROM zhrtr_aus_wt_du INTO wa_final WHERE begda = PNPDISBD .
if sy-subrc ne 0.
DELETE FROM zhrtr_aus_wt_du.
endif.
CALL FUNCTION 'G_SET_GET_ALL_VALUES'
EXPORTING
client
= sy-mandt
setnr
= 'ZAUS_WAGE'
class
= '0000'
no_descriptions = ' '
no_rw_info
=''
TABLES
set_values
= it_ab_wage
EXCEPTIONS

set_not_found = 1
OTHERS
= 2.
IF it_ab_wage IS NOT INITIAL.
LOOP AT it_ab_wage INTO wa_ab_wage.
w_wages-sign = 'I'.
w_wages-option = 'EQ'.
w_wages-low = wa_ab_wage-from.
append w_wages to r_wages.
ENDLOOP.
CLEAR it_final.
LOOP AT rt INTO wa_rt WHERE lgart IN r_wages.
wa_final-pernr = p0000-pernr.
wa_final-begda = PNPDISBD.
wa_final-lgart = wa_rt-lgart.
wa_final-betrg = wa_rt-betrg.
APPEND wa_final TO it_final.
ENDLOOP.
IF it_final IS NOT INITIAL.
MODIFY zhrtr_aus_wt_du FROM TABLE it_final.
IF sy-subrc = 0.
COMMIT WORK.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
endform.
ENDENHANCEMENT.
*$*$-End: (1 )------------------------------------------------------$*$*

Now insert the Function into the Schema.

To Create a Set to maintain the wage use the T.code GS01

Now maintain the wage types in Set values.

TYPE-POOLS: slis.
TABLES p0002.
DATA : it_final TYPE TABLE OF zhrtr_aus_wt_du ,
wa_final TYPE zhrtr_aus_wt_du.
DATA :it_ab_wage TYPE TABLE OF rgsb4,
wa_ab_wage TYPE rgsb4.
DATA : wa_fieldcat TYPE lvc_s_fcat,
it_fieldcat TYPE lvc_t_fcat.
DATA: it_fcat TYPE slis_t_fieldcat_alv,
wa_fcat TYPE slis_fieldcat_alv,
g_save TYPE c VALUE 'A'.
DATA : dyn_table TYPE REF TO data,
dyn_line TYPE REF TO data.
DATA : g_repid TYPE sy-repid.
FIELD-SYMBOLS: <fs_final> TYPE STANDARD TABLE,
<wa_final> TYPE any,
<data> TYPE any.
CONSTANTS : c_30 TYPE char2 VALUE '30',
c_13 TYPE char2 VALUE '13',
c_2 TYPE char1 VALUE '2',
c_7 TYPE char1 VALUE '7',
c_p TYPE char1 VALUE 'P'.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS s_pernr FOR p0002-pernr MATCHCODE OBJECT perm.
SELECTION-SCREEN END OF BLOCK b1.

INCLUDE ZHRREP_AUS_DUMMY_WT_FORMS.
INITIALIZATION.
g_repid = sy-repid.
START-OF-SELECTION.
PERFORM f_build_filedcat.
PERFORM f_create_itab_dynamically.
PERFORM f_get_data.
PERFORM display.
*&---------------------------------------------------------------------*
*& Include
ZFORMS_SK
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Form F_BUILD_FILEDCAT
*&---------------------------------------------------------------------*
FORM f_build_filedcat .
CALL FUNCTION 'G_SET_GET_ALL_VALUES'
EXPORTING
client
= sy-mandt
setnr
= 'ZAUS_WAGE'
class
= '0000'
no_descriptions = ' '
no_rw_info
=''
TABLES
set_values
= it_ab_wage
EXCEPTIONS
set_not_found = 1
OTHERS
= 2.
SELECT * FROM zhrtr_aus_wt_du INTO TABLE it_final WHERE pernr IN s_pernr.
*PERNR
wa_fieldcat-col_pos = 1.
wa_fieldcat-fieldname = 'PERNR'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
*BEGDA
wa_fieldcat-fieldname = 'BEGDA'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
*PERNR
* wa_fcat-col_pos = 1.
wa_fcat-fieldname = 'PERNR'.
wa_fcat-seltext_l = 'Personnel No'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
*BEGDA
* wa_fcat-col_pos = 2.
wa_fcat-fieldname = 'BEGDA'.
wa_fcat-seltext_l = 'Date'.
wa_fcat-datatype = 'DD.MM.YYYY'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.

LOOP AT it_ab_wage INTO wa_ab_wage.


CLEAR wa_fieldcat.
wa_fieldcat-col_pos = sy-tabix.
wa_fieldcat-fieldname = wa_ab_wage-from .
wa_fcat-col_pos = sy-tabix.
wa_fcat-fieldname = wa_ab_wage-from .
IF wa_fieldcat-fieldname CA '/'.
TRANSLATE wa_fieldcat-fieldname USING '/ '.
CONDENSE wa_fieldcat-fieldname NO-GAPS.
ENDIF.
wa_fcat-fieldname = wa_ab_wage-from.
IF wa_fcat-fieldname CA '/'.
TRANSLATE wa_fcat-fieldname USING '/ '.
CONDENSE wa_fcat-fieldname NO-GAPS.
ENDIF.
wa_fieldcat-intlen = c_30 .
wa_fcat-seltext_l = wa_ab_wage-from.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ENDLOOP.
ENDFORM.
" F_BUILD_FILEDCAT
*&---------------------------------------------------------------------*
*& Form F_CREATE_ITAB_DYNAMICALLY
*&---------------------------------------------------------------------*
FORM f_create_itab_dynamically .
* Create dynamic internal table and assign to Field-Symbol
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = it_fieldcat
IMPORTING
ep_table
= dyn_table.
ASSIGN dyn_table->* TO <fs_final>.
* Create dynamic work area and assign to Field Symbol
CREATE DATA dyn_line LIKE LINE OF <fs_final> .
ASSIGN dyn_line->* TO <wa_final> .
ENDFORM.
" F_CREATE_ITAB_DYNAMICALLY
*&---------------------------------------------------------------------*
*& Form F_GET_DATA
*&---------------------------------------------------------------------*
FORM f_get_data .
FIELD-SYMBOLS : <fs_pernr> TYPE ANY,
<fs_begda> TYPE ANY,
<fs_lgart> TYPE ANY.
DATA : l_lgart TYPE char4.
SORT it_final BY pernr.

LOOP AT it_final INTO wa_final.


*PERNR
ASSIGN COMPONENT 'PERNR' OF STRUCTURE <wa_final> TO <fs_pernr> .
<fs_pernr> = wa_final-pernr.
IF wa_final-lgart+0(1) EQ '/'.
l_lgart = wa_final-lgart+1(3).
ENDIF.
*begda
ASSIGN COMPONENT 'BEGDA' OF STRUCTURE <wa_final> TO <fs_begda> .
CONCATENATE wa_final-begda+6(2) wa_final-begda+4(2) wa_final-begda+0(4) INTO <fs_begda> SEPARAT
ED BY '.'.
* <fs_begda> = wa_final-begda.
* READ TABLE it_ab_wage INTO wa_ab_wage with key pernr = <fs-pernr> LGART = l_lgart.
* if sy-subrc eq 0.
ASSIGN COMPONENT l_lgart OF STRUCTURE <wa_final> TO <fs_lgart>.
<fs_lgart> = wa_final-betrg.
CLEAR l_lgart.
AT END OF pernr.
INSERT <wa_final> INTO TABLE <fs_final>.
FREE : <wa_final>.
ENDAT.
ENDLOOP.
ENDFORM.
" F_GET_DATA
*&---------------------------------------------------------------------*
*& Form DISPLAY
*&---------------------------------------------------------------------*
FORM display .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
*
*
*
*
*
*

i_callback_program
= g_repid
is_layout
= wa_layout
i_callback_user_command = g_user_command
it_fieldcat
= it_fcat
is_variant
= wa_variant
i_save
= g_save
it_events
= it_events[]

TABLES
t_outtab
= <fs_final>
EXCEPTIONS
program_error
=1 .
IF sy-subrc <> 0.
EXIT.
ELSE.
LEAVE LIST-PROCESSING.
ENDIF.
CLEAR g_repid.
ENDFORM.
" DISPLAY

"#EC *
"#EC *

How to refine a HCM Process and display the HCM Form in the browser
from MSS
By Sanket sethi, HCL Technologies

This document describes how to enhance a Standard WD component and how to refine a HCM Process and display
the HCM Form in the browser from MSS.
To do this, we need to enhance the Standard WD component as describe in detail below.
Enhancement of the WD Component:
The enhancement will be implemented on the following standard SAP Web-dynpro component:

HAP_MAIN_DOCUMENT

The sub components that will be affected are:

STATUS_CHANGE method of Component controller

The Web-dynpro component Z_TRY_COMPLETE should also be created by copying the standard WD4A
component HRASR00_PROCESS_EXECUTE, it will discuss in later steps.

An enhancement to STATUS_CHANGE method of the component controller is to be done as follows:

Create an enhancement on method STATUS_CHANGE. Name the enhancement will be as follows:

Enhancement Implementation: Z_TRY_COMPLETE

Short Text: Try Complete from enhancement implementation.

TO DO Example to Enhance the View:


Double Click on Componentcontroller in display mode and click on Enhance button. Refer to the screenshot for
example:

It will open a popup window; fill Enhancement Implementation as Z_TRY_COMPLETE and Short Text as Trial
Complete From enhancement implementation. Refer to the screenshot below:

Create an Overwrite Exit implementation which will contain the logic to display the HCM PROCESS form.
To Do Example to create an Overwrite Exit:
Open your Componentcontroller in display mode and click on Enhancement button. Refer to the screen shot to
enhance. Now, it will open a popup window, select your Enhancement Z_TRY_COMPLETE and click on OK
button. Refer to the screenshot below:

Now click on the method tab of the controller and scroll right. It will display you the Overwrite-exit method for
creation. Select the standard method and write here your code which will trigger after the standard method.

The logic in the Overwrite Exit implementation (after getting the button ID
(L_BUTTON_ID) of Status change button
From FPM) above is as follows:

Copy the code of Status change method and paste it in Overwrite method and then edit the code. The edited code
will then overwrite the standard code and will open an external window as per the requirement.
* Try a trick to open an external window for HCM FORM PROCESS,
if l_button_id eq 'COMPLETE'.
data lo_window_manager1 type ref to if_wd_window_manager.
data lo_api_component1 type ref to if_wd_component.
data lo_window
type ref to if_wd_window.
data url type string.
lo_api_component1 = wd_this->wd_get_api( ).
lo_window_manager1 = lo_api_component1->get_window_manager( ).
URL = 'http://HOST:PORT/sap/bc/webdynpro/sap/Z_TRYCOMPLETE'.
CALL METHOD lo_window_manager1->CREATE_EXTERNAL_WINDOW
EXPORTING
URL
= URL
MODAL
= ABAP_FALSE
HAS_MENUBAR = ABAP_TRUE
IS_RESIZABLE = ABAP_TRUE
HAS_SCROLLBARS = ABAP_TRUE
HAS_STATUSBAR = ABAP_TRUE
HAS_TOOLBAR = ABAP_TRUE
HAS_LOCATION = ABAP_TRUE
RECEIVING
WINDOW
= lo_window.
lo_window->open( ).
ENDIF.
Activate your work.

Note:
This enhancement code will open an external window for WD4A application Z_TRYCOMPLETE.

Now Create a Web dynpro program Z_TRY_COMPLETE by copying the standard web dynpro
Component HRASR00_PROCESS_EXECUTE.

Activate your work.

Now edit the method SELECT_PROCESSES of the component controller as shown below:

Write down the code here to refine the form processes as shown below:
* Refine the Form Process
DELETE process_starts where process NE 'ZTEST'.

Activate your work.


Now create a WD4A application for WD4A Component Z_TRY_COMPLETE as
Z_TRYCOMPLETE and pass the Window name as ASR_PROCESS_EXECUTE in the Interface View
& Plug name as DEFAULT.

Also pass the parameters to the WD application as below:

Now the enhancement for Complete button has been created. When User selects the Complete Radio button and
the user click CONTINUE button. Then it will open an external window if the status is unsuccessful.
Test Web dynpro functionality for the Process:
Please refer to the below screenshots to test the WD4A functionality on Complete button, when status is
unsuccessful:
Open the Portal link and go to the Talent Management > Performance Management under MSS as shown below:

It will now open the below screen:

Open one of the documents to complete the In Process status, as below:

Select the Complete radio button and click on Continue button, it will open an external window for HCM process
form as below:

You only need to select the employee for the first time. After selecting the employee there is no need to select the
employee again.
Select employee and then click on Select Process:

Then the Refined Process will come up for HCM process form display, as shown below:

Then click on Edit and Form will appear as below:

Now you can Check and Save the Form data.

Maintaining the log for HCM report executions


By Piyush Mathur, Tata Consultancy Services

You can create a log for the HR report which you run each time. These logs contain the report name, user name, run
date and time and select options.
SAP Standard reports RPUPROTD and RPUPROTU used to display and maintained report logs.
This feature can be only used with reports which use the PNP logical database.
To maintain the report log, an entry needs to be maintained in table T599R through SM31 for view V_T599R. In
table you can also specify whether this record should be created only for online or background reports, or for both.
Below is the step by step procedure to maintain the log.
First run a Z report which is using PNP logical database.

Now run the report RPUPROTD and pass the report name.

No log is displayed.
Now maintain the report entry in table V_T599R. Execute T code SM31 and maintain view V_T599R.

Click on New entries and maintained report YHR8G_STI_PAYOUT_REPORT_001 with Record online and Prot
batch check box. Now save the values.

No again run the Z report

Now run the report RPUPROTD.

Now you will be able to see the report run log.

Above screen display the report log.


You can use report RPUPROTU to delete the reports logs.

Adding a Column Owner to an Appraisal Template in Performance


Management Module (ECM) of SAP ABAP HR
By Srikanth Reddy Konde, IBM
Scenario:

This document gives technical information to add a Column Owner to an Appraisal Template in
Performance Management Module (Compensation Management) of SAP ABAP HR. This scenario has
been configured in SAP ECC6.0

Business Requirement:
In Performance Management module (ECM), SAP HR, based on clients requirement, Appraisal
Templates will be designed by the Functional people and additional requirements fulfillment is done by
the developers using ABAP code.
The transaction code for creating and maintaining the Appraisal Templates is PHAP_CATALOG.
To give additional requirements for the Appraisal Templates, in SAP there are Business Add-Ins(BAdI)
are available for obtaining the solutions.
Information on Appraisal Templates and the requirement:

An Appraisal Template consists of the below parts in it and categorized in a structure as mentioned below.
VA Appraisal template
VB Criteria Group
VC Criterion

At VA Appraisal template level, will contain a tab called Column Access. In this tab, there is a column
named as Column Owner. Below screenshot is an example for it through transaction code
PHAP_CATALOG.

Generally the standard SAP templates are provided with few Column Owner values like Appraiser (Ex:
Manager), Appraisee (Ex: Employee)...Etc. The column owners will be given access
(Change/Display/Hide) to the columns of the Appraisal documents. Whenever the user access the created
Appraisal document of the Appraisal template, based on this, user can have Change/Display operations on
document for the columns where in he will act as a Column Owner.
Below screenshot is to view the some of SAP provided Column owner values.

In most of the times, client requirement is to add an additional column owner value in the list as per their
requirement. To achieve this type of requirement, the technical information and also the configurations
information are provided in the below section.

Technical and Configuration information to add a Column Owner to an Appraisal Template:


For adding a Column Owner into an Appraisal Template, SAP Provides a Business Add-Ins(BAdI) name
HRHAP00_COL_OWNER.
Appraisal Document - Column Owner (HRHAP00_COL_OWNER)

This Business Add-In (BAdI) enables you to create further implementations, in addition to the standard
SAP Implementations, with which you can provide further column owners.
You can select the implementations in the appraisal catalog on the Column Access tab page.
Methods

Customizing: Check Owner Setting (Infotype 5023) (CUST_CHECK_SETTING)


This method checks, according to the settings in infotype 5023, whether the person is allowed as the
column owner. Objective Settings and Appraisals
Parameters

FLT_VAL (Import Parameter)


Parameter FLT_VAL of method
CUST_CHECK_SETTING
T_APPER (Import Parameter) Appraiser Object Types
T_APPEE (Import Parameter) Appraisee Object Types
T_PART_APPER (Import Parameter) Part Appraiser Types
T_OTHER (Import Parameter) Object Types for Further Participants
SUBRC (Export Parameter) 0= Allowed; 4= Not Allowed
Exceptions
None.
Check Column Owner (CHECK_COLUMN_OWNER)
Using the object ID of the user, this method determines whether or not this user is the column owner.
If the system determines that the current user is the column owner, an 'X' is entered for the indicator
COLUMN_OWNER.
In this case, the user has all authorizations for the current column as entered in the Column Owner field in
infotype 5023.
Result
The method returns information as to whether or not the appraiser is the column owner.
Parameters
FLT_VAL (Import Parameter) Parameter FLT_VAL of method GET_COLUMN_OWNER
S_APPRAISAL_ID (Import Parameter) Appraisal ID
COLUMN_ID (Import Parameter) Appraisal Column ID
COLUMN_PART_AP_ID (Import Parameter) Part Appraisal ID
T_HEADER_APPRAISER (Import Parameter) Header - Appraiser
T_HEADER_APPRAISEE (Import Parameter) Header - Appraisee

T_HEADER_PART_APPRAISERS (Import Parameter) Header - Part Appraiser


T_HEADER_OTHERS (Import Parameter) Header - Further Participants
T_MYSELF (Import Parameter) My Objects
COLUMN_OWNER (Export Parameter) 'X'=Column Owner; ' '=Not Column Owner.
Exceptions
None.
Captured screen through the transaction code SE18.

Implementing a custom Business Add-In(BAdI) for adding a Column Owner using


HRHAP00_COL_OWNER

Go to Transaction code SE19, for creating the custom Business Add-In(BAdI), in Create Implementation
tab, give BAdI Name as HRHAP00_COL_OWNER and click on Create Impl. Button.

Give the custom Business Add-In(BAdI) name (ZHRHAP00_COL_OWNER) with the filter value, where
in the filter description is added as an Column Owner in the template.

The Interface tab consists of the methods to implement for getting the Column Owner

As mentioned above the two methods have got their significance to provide the requirement and the
signature (Import and Export Parameters) of the methods are as below.

Please find below the code written for getting the column owner as Manager and High Level Manager.

This development is done in the method CHECK_COLUMN_OWNER to check when any users access the
Appraisal document column; it will check whether the user is the Column Owner i.e. Manager and High Level
Manager.
For the program code, click here.

Once the method implementation is completed then the custom Business Add-In
(ZHRHAP00_COL_OWNER) need to be activated.
Once the above action is completed this particular enhancement will get applied for all the Appraisal
Templates. And there will be an additional Column owner will be available in the list with the value
Manager and High Level Manager.

This is the way the Column Owner will be added to the Appraisal Templates and same will be reflected
when the Appraisal documents gets created and maintained. Now, based on the Column owner for a
particular column the operations (Change/Display/Hide) will be provided on the document when the user
accesses the document as a column owner (Ex. Manager and High Level Manager).

Related Content
The related transaction codes which are used for Appraisal Templates and Appraisal Documents of
Performance Management (ECM) of SAP ABAP HR are as below
PHAP_CATALOG To view and maintain the Appraisal Templates

PHAP_PREPARE To prepare the Appraisal Documents using an Appraisal Template


PHAP_ADMIN
OOHAP_BASIC

To maintain and view the Appraisal Documents


To maintain and configure the Enhancements for different criteria basis

HRA/CLA Exemption Derivations


By Sai Kumar, Enteg

HRA exemption is one which every one known.


The HRA exemption is works on the 3 principles/workings. i.e
1) 40% of the Basic Salary if the employee working in a Non Metro City , 50% of the Basic Salary
2) Actual HRA what the employee getting from his pay pocket
3) Actual Rent Paid - 10% of the Basic Salary.
Compute the 3 principles and take the least value among the 3 workings. The least amount is exemption amount.
Subtract the least amount from the HRA which is lying in the employee Pay Pocket. The value comes out of is
Taxable HRA amount
The Least of the above (HRA exemption) we can get through pay results RT Table (Wage Type:/4E4) we can`t get
how these is derived through wage type but we can get this calculation through below mention logic where we can
get to know how this HRA exemption is getting calculated where it is use full in showing the employee monthly Pay
slip or in Income tax computation sheet generally.
We need here total 6 dummy wage types to store the values in RT table for
*--Metro HRA calculation

(1) 50% of annual basis


(2) HRA Projected / Actual
(3) Rent paid - 10 % basis

*--Non-Metro HRA calculation

(4) 40% of annual basis


(5) HRA Projected / Actual
(6) Rent paid - 10 % basis

The addition of above least Metro HRA Calculation and Non Metro HRA Calculation we will be final HRA
exemption for the year (/4E4).

CLA (Company Leased Accommodation): CLA Exemption will be calculated on the base of Rent paid to landlord
and 15% of annual basic the least of these two will be CLA exemption for the Year.
Two show in Pay slip or Income tax computation sheet we have to store these components in 2 different wage types
as below explain method.
CLA Calculation:

(7) CLA - Rent Paid to Landlord


(8)CLA - 15 % of Annual Basic

Go to T. Code PE04 and INHRA function

We see one Enhancement Spot line no 2534, where we write the code to retrieve the required HRA/CLA exemption
logic.

DATA : l_mhbas_fy TYPE pad_amt7s,

l_mhelg_fy TYPE pad_amt7s,


l_mhren_fy TYPE pad_amt7s,
l_nhelg_fy TYPE pad_amt7s,
l_nhren_fy TYPE pad_amt7s,
l_nhbas_fy TYPE pad_amt7s,
l_m_rent_10 TYPE pad_amt7s,
l_m_elg_ty TYPE pad_amt7s,
l_m_basic_50 TYPE pad_amt7s,
l_mthra
TYPE abrwt,
l_nmhra
TYPE abrwt,
l_n_rent_10 TYPE pad_amt7s,
l_n_elg_ty TYPE pad_amt7s,
l_n_basic_40 TYPE pad_amt7s,
l_MLREN_5_FY TYPE pad_amt7s,
l_MLBAS_5_FY TYPE pad_amt7s,
l_TMP_BETRG TYPE pad_amt7s,
l_Actual_rent TYPE pad_amt7s,
l_salary_10 TYPE pad_amt7s,
wa_it
TYPE pc207.
*--move the data to the local variables
l_mhbas_fy = mhbas_fy.
l_mhelg_fy = mhelg_fy.
l_mhren_fy = mhren_fy.
l_mthra = mthra.
l_nhelg_fy = nhelg_fy.
l_nhren_fy = nhren_fy.
l_nhbas_fy = nhbas_fy.
l_nmhra = nmhra.
*--metro hra calculation
*--50% of annual basis
l_m_basic_50 = l_mthra * l_mhbas_fy / 100.
*--Hra Projected / Actual
l_m_elg_ty = l_mhelg_fy.
*--rent paid - 10 % basis
l_m_rent_10 = l_mhren_fy - ( v3con * l_mhbas_fy ) / 100.
*--non metro hra calculations
*--40% of annual basis
l_n_basic_40 = l_nmhra * l_nhbas_fy / 100.
*--Hra Projected / Actual
l_n_elg_ty = l_nhelg_fy.
*--rent paid - 10 % basis
l_n_rent_10 = l_nhren_fy - ( v3con * l_nhbas_fy ) / 100.

*-->CLA logic
l_MLREN_5_FY = MLREN_5_FY.
l_MLBAS_5_FY = MLBAS_5_FY.
l_Actual_rent = l_MLREN_5_FY.
" Actual rent
l_salary_10 = l_MLBAS_5_FY * CLAS 1 / 100 . " 10% Salary
l_tmp_betrg = MLBAS_5_FY_DIF + MOBAS_6_FY_DIF + NOBAS_6_FY_DIF +
MOBAS_9_FY_DIF + NOBAS_9_FY_DIF + OTBAS_9_FY_DIF.
if l_TMP_BETRG < 0 .
if l_Actual_rent > l_salary_10.
l_salary_10 = l_salary_10 + l_TMP_BETRG.
else.
l_Actual_rent = l_Actual_rent + l_TMP_BETRG.
endif.
ENDIF.
CLEAR wa_it.
IF l_m_elg_ty IS NOT INITIAL.
wa_it-lgart = '9D94'.
wa_it-betrg = l_m_elg_ty.
APPEND wa_it TO it.
ENDIF.
IF l_m_basic_50 IS NOT INITIAL.
wa_it-lgart = '9D95'.
wa_it-betrg = l_m_basic_50.
A PPE ND wa_it TO it.
ENDIF.
IF l_m_rent_10 IS NOT INITIAL.
wa_it-lgart = '9D96'.
wa_it-betrg = l_m_rent_10.
APPEND wa_it TO it.
ENDIF.
IF l_n_elg_ty IS NOT INITIAL.
wa_it-lgart = '9D97'.
wa_it-betrg = l_n_elg_ty.
APPEND wa_it TO it.
ENDIF.
IF l_n_basic_40 IS NOT INITIAL.
wa_it-lgart = '9D98'.
wa_it-betrg = l_n_basic_40.
APPEND wa_it TO it.
ENDIF.
IF l_n_rent_10 IS NOT INITIAL.
wa_it-lgart = '9D99'.
wa_it-betrg = l_n_rent_10.
APPEND wa_it TO it.
ENDIF.
IF l_Actual_rent IS NOT INITIAL.
wa_it-lgart = '9DC1'.
wa_it-betrg = l_Actual_rent.

APPEND wa_it TO it.


ENDIF.
IF l_salary_10 IS NOT INITIAL.
wa_it-lgart = '9DC2'.
wa_it-betrg = l_salary_10.
APPEND wa_it TO it.
ENDIF.

If we have Metro and non-metro both during the FY sum of the least in both else if we have any one of these least of that will be Exem

Configuring events for HR Workflow


By Sri lakshmi Lavanya Koduganti, CSC

Scenario: Suppose you have created a Custom Infotype (Say 9048) and you want to trigger an event (Say
ZRTW_INS event on the Business Object BUS1065) whenever a new record is inserted into this Infotype.
Step 1: Go to TCode SWEHR1.

Click on New Entries tab


Step 2: Enter the following details

This links the Infotype with the Business Object.


Step 3: Go to TCode SWEHR3. Click on create New entries tab.
Enter the following details.

Here Update op. indicates the operation, which triggers the event
At the bottom, Object type is the Business Object (which is already linked to the infotype 9048 in SWEHR1) and
Event is the event on the Business Object.
Save the entries.
Now we have configured the event ZRTW_INS on the Business Object BUS1065 to trigger whenever a new record
is inserted in IT9048.
We can also mention a Function module here instead of Event. This function module contains the code to trigger

Printing remuneration statement (Pay slips) using HR Forms


By T.N.Swapna, YASH Technologies

Purpose
An HR-Form often functions as an enterprise's business card, which means it requires an attractive graphical design.
The HR Forms will enable you in future to create flexible reports with an attractive layout for HR master data,
personnel time data, and payroll results. Therefore, it will be a central Human Resource tool that enables you to
select data from various sources in a uniform manner, which you can then design and print.
Tasks involved:

Selecting data for HR forms

Designing the layout of HR forms

Activating HR forms

Testing and correcting form printing

Starting form printing

Example:
The requirement of our client is to print a Remuneration Statement (Pay slip) using HR Forms, which looks like the
screen shot below:

Go to the transaction PE51. The initial screen appears as the one below:

In the above screen shot the country grouping is a unique indicator for a country that is used in the Human
Resources components of the R/3 System. The form name is the HR form which we have to develop. In our case the
standard form IN01 is copied to ZN02. For each HR form we have some sub objects as we see in the screen shot
above.

Attributes

Background

Single fields

Window

Line layout

Cumulative IDs

Text Modules

Rules

Documentation

Attributes

The attributes are technical characteristics, like form name, form size, form class, as well as administrative
information on the form, like the person who changed the form last, when the change took place, and so on. The
system automatically sets the administrative information.

Background
The form background contains information that is printed in the same position in the form and does not vary. For
example, the companys address, Logo of the company and others.
The form background is set up using lines. You must define all lines in a form. This means that lines containing only
individual fields or windows need to be defined as blank lines on the form background. In our case, once the form
IN01 is copied to ZN02. Go to the change mode of the form ZN02. The screen would look like the one below.
Remove / Add the extra lines as per the requirement.

Use page up / page down and forward / backward buttons to view the rest of the page. After making changes to the
form as per required, it would look like the one below

Creating and designing HR Forms


By Ribhu Ahuja, TCS

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.
TCode HRFORMS:

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,
wage type as 1001 in the selection box.

and we give the

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!!

Displaying an Employee Photo dynamically on the selection-screen


By Shaveta Prabhakar Joshi , TATA Consultancy Services
Summary

This tutorial helps you to get Employee Photo dynamically in your Selection Screen and this is the photo, which
appears in all the Infotype headers of SAP-HR Module.

You can get Employee Passport Photo in your Selection Screen by using following steps in
SE38.

Define Custom Container in Selection Screen

Load Image in Container

Define Custom Container on Selection Screen

Use the following Function Modules and Methods to define the custom container on Selection
Screen

Object of Class CL_GUI_PICTURE is to create Custom Container

Set Position of Photo by passing values of Height, Width, Top and Left using method SET_POSITION of Class
CL_GUI_PICTURE.

Use Method DISPLAY_MODE_FIT of Class CL_GUI_PICTURE to fit Image to the Container.

Load the Image in Container

Use the following Function Modules and Methods to load the photo in the custom container
defined on Selection Screen.

Check the availability of Photo by using Function Module HR_IMAGE_EXISTS and get the Achieve ID and
Document ID.

Get the URL of image by passing parameters Achieve Id and Document Id to the Function Module
SCMS_DOC_URL_READ.

Load the photo in the defined container by passing parameters URL to the Function Module
LOAD_PICTURE_FROM_URL.

Code to get dynamic employee photo in Selection Screen

Use this code in SE38 to see how the passport photo appears against the Info type header of SAP-HR:
*&---------------------------------------------------------------------*
*& Report ZEMPLOYEE
*& Created By : Shaveta Prabhakar
*& Published at: SAPTechnical.COM
*&---------------------------------------------------------------------*
*& Function Modules: HR_GET_EMPLOYEE_DATA
*&

HR_IMAGE_EXISTS

*&

SCMS_DOC_URL_READ

*&

HR_IMAGE_RESET

*& Class & Methods : CL_GUI_DOCKING_CONTAINER


*&

CL_GUI_PICTURE->SET_POSITION

*&

CL_GUI_PICTURE->SET_DISPLAY_MODE

*&

CL_GUI_PICTURE->DISPLAY_MODE_FIT

*&

CL_GUI_PICTURE->LOAD_PICTURE_FROM_URL_ASYNC

*&---------------------------------------------------------------------*
REPORT ZEMPLOYEE.
TABLES: PA0001, PERSON.
*----------------------Declaration for Image------------------------*
DATA: DOCKING_CONT TYPE REF TO CL_GUI_DOCKING_CONTAINER, " Custom Container
PICTURE TYPE REF TO CL_GUI_PICTURE.
*--------------------Declaration of Internal table------------------*
DATA: ITAB_EMPDATA LIKE TABLE OF PERSON.
DATA: ITAB_DATA LIKE TABLE OF PERSON WITH HEADER LINE.
DATA: P_CONNECT_INFO LIKE TABLE OF TOAV0 WITH HEADER LINE.

DATA: P_DOCUMENT_TYPE LIKE TOAV0-RESERVE.


DATA: URL(255) TYPE C.
DATA: HANDLE TYPE I.
DATA: PPERNR TYPE PA0001-PERNR.
*----------------------Start of Selection Screen----------------------*
SELECTION-SCREEN BEGIN OF BLOCK B1 .
SELECTION-SCREEN SKIP 2.
SELECTION-SCREEN COMMENT 40(25) TEXT-010 .
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 20(15) TEXT-002 FOR FIELD PERNR.
PARAMETERS PERNR TYPE PA0001-PERNR.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 20(15) TEXT-008 FOR FIELD ENAME.
PARAMETERS ENAME TYPE PA0001-ENAME.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 20(15) TEXT-003 FOR FIELD PERSG.
PARAMETERS PERSG TYPE PA0001-PERSG.
SELECTION-SCREEN COMMENT 45(15) TEXT-009 FOR FIELD WERKS.
PARAMETERS WERKS TYPE PA0001-WERKS.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 20(15) TEXT-004 FOR FIELD PERSK.

PARAMETERS PERSK TYPE PA0001-PERSK.


SELECTION-SCREEN COMMENT 45(15) TEXT-005 FOR FIELD KOSTL.
PARAMETERS KOSTL TYPE PA0001-KOSTL.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 20(15) TEXT-006 FOR FIELD ORGEH.
PARAMETERS ORGEH TYPE PA0001-ORGEH.
PARAMETERS ORGEHTXT TYPE PERSON-ORGEH_TXT .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 20(15) TEXT-007 FOR FIELD PLANS.
PARAMETERS PLANS TYPE PA0001-PLANS.
PARAMETERS PLANSTXT TYPE PERSON-PLANS_TXT .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK B1.
***********************************************************************
*AT SELECTION-SCREEN OUTPUT.
************************************************************************
AT SELECTION-SCREEN OUTPUT .
LOOP AT SCREEN.
IF SCREEN-NAME = 'ENAME'
OR SCREEN-NAME = 'PERSG'
OR SCREEN-NAME = 'PERSK'
OR SCREEN-NAME = 'KOSTL'
OR SCREEN-NAME = 'WERKS'

OR SCREEN-NAME = 'ORGEH'
OR SCREEN-NAME = 'PLANS'
OR SCREEN-NAME = 'ORGEHTXT'
OR SCREEN-NAME = 'PLANSTXT'.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
LOOP AT SCREEN.
IF SCREEN-NAME = 'ORGEHTXT'
OR SCREEN-NAME = 'PLANSTXT'.
SCREEN-OUTPUT = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
PERFORM GET_PIC.
***********************************************************************
*AT SELECTION-SCREEN .
************************************************************************
AT SELECTION-SCREEN .
PPERNR = PERNR.
CALL FUNCTION 'HR_GET_EMPLOYEE_DATA'
EXPORTING
PERSON_ID

= PPERNR

SELECTION_BEGIN

= SY-DATUM

SELECTION_END

= SY-DATUM

IMPORTING
PERSONAL_DATA

= ITAB_DATA

EXCEPTIONS
PERSON_NOT_FOUND

=1

NO_ACTIVE_INTEGRATION = 2
OTHERS

= 3.

IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.


ENDIF.
ENAME = ITAB_DATA-ENAME.
PERSG = ITAB_DATA-PERSG.
PERSK = ITAB_DATA-PERSK.
ORGEH = ITAB_DATA-ORGEH.
PLANS = ITAB_DATA-PLANS.
KOSTL = ITAB_DATA-KOSTL.

WERKS = ITAB_DATA-WERKS.
ORGEHTXT = ITAB_DATA-ORGEH_TXT.
PLANSTXT = ITAB_DATA-PLANS_TXT.
*Function Module To check Existance of Image
CALL FUNCTION 'HR_IMAGE_EXISTS'
EXPORTING
P_PERNR
IMPORTING

= PPERNR

P_CONNECT_INFO = P_CONNECT_INFO
EXCEPTIONS
OTHERS

= 2.

P_DOCUMENT_TYPE = P_CONNECT_INFO-RESERVE.
*Function Module To Get the URL of Image
CALL FUNCTION 'SCMS_DOC_URL_READ'
EXPORTING
STOR_CAT = SPACE
CREP_ID

= P_CONNECT_INFO-ARCHIV_ID

DOC_ID

= P_CONNECT_INFO-ARC_DOC_ID

COMP_ID

= 'DATA'

DP_URL_ONLY = 'X'
IMPORTING
URL

= URL

EXCEPTIONS
OTHERS

= 10.

IF SY-SUBRC <> 0.
ENDIF.
*Method To load Image from URL
CALL METHOD PICTURE->LOAD_PICTURE_FROM_URL_ASYNC
EXPORTING
URL = URL.
IF SY-SUBRC NE 0.
ENDIF.
IF PPERNR NE PERNR.

*Function Module To Reset Image


CALL FUNCTION 'HR_IMAGE_RESET'
EXPORTING
HANDLE

= HANDLE

EXCEPTIONS
INVALID_HANDLE = 1
OTHERS

= 2.

IF SY-SUBRC <> 0.
ENDIF.
ENDIF.
*&---------------------------------------------------------------------*
*& Form Get_Pic
*&---------------------------------------------------------------------*
FORM GET_PIC.
DATA: REPID LIKE SY-REPID.
REPID = SY-REPID.
IF PICTURE IS INITIAL.
*Object To Create the Custom Container
CREATE OBJECT PICTURE
EXPORTING
PARENT = DOCKING_CONT.
CHECK SY-SUBRC = 0.
*Method To Set Position of Image
CALL METHOD PICTURE->SET_POSITION
EXPORTING

HEIGHT = 47
LEFT = 610
TOP = 25
WIDTH = 70.
*Method To Set Display Mode Fit to Container
CALL METHOD PICTURE->SET_DISPLAY_MODE
EXPORTING
DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_FIT.
ELSE.
*Function Module To Reset Image
CALL FUNCTION 'HR_IMAGE_RESET'
EXPORTING
HANDLE

= HANDLE

EXCEPTIONS
INVALID_HANDLE = 1
OTHERS

= 2.

IF SY-SUBRC <> 0.
ENDIF.
ENDIF.
ENDFORM. "Get_pic
View Selection Screen

After executing above code your Selection Screen appears as follows

Infotypes with buttons and huge data fields stored in cluster tables
By Ribhu Ahuja, Tata Consultancy Services

Creating the infotype and putting active button in the same

Some infotype and cluster table properties


Generally the infotype would contain some 10 - 15 fields with each field having a length of say 10 - 15
characters. But sometimes the requirement may arise to store huge amount of data of an employee.
Imagine we want to create an infotype - exit interviews with say around 20 - 25 fields and we want to
store remarks for say 10 15 of these fields, which would be of roughly 500 characters each. Just to let you
know, if we create a custom infotype for the same, we must be aware that SAP gives a total space of 2000
characters for all fields in an infotype. In other words, we can't increase the fields in an infotype if the
sum of length of all fields in the infotype increases 2000 characters. Now what??? Nothing to worry
about. We can create a button in the infotype and then call a sub screen on the click of that button. In this
sub screen, we can type as much as we want and on the green tick mark below, we can code to write this
data in cluster table PCL3, simultaneously creating a unique 40 character key comprising of personal
number, system date, system time and a 2 character key which would work as a switch when data is
written. This key is used to insert and retrieve data while creating and displaying the data respectively.

Creating the infotype


Go to transaction PM01. We can create a custom infotype through the transaction PM01. The number
range for custom infotypes starts from 9001 to 9999. SAP has reserved infotypes numbers from 0000 to
9000 for its standard infotypes.
For creating an infotype say Exit Interview, go to transaction PM01 and type any infotype number from
9001 to 9999.

Select the Employee Infotype radio button.


Select the PS Structure from sub objects box.
Click on the edit button below A separate table maintenance window appears.
Create a PS structure with all the fields we want on the Infotype. Whatever fields we will put in this
PS structure will come in the infotype as input fields.

Notice that the first field ZTYPEOFEXIT is type of Exit - whether resignation or retirement and
would be an LOV in our infotype. For this, domain and data element have to be created.
Double click on Component type ZTYPEOFEXIT, it gives a warning, Click yes.

Choose Data element

Give short description and domain name, which we are about to create as ZTYPEOFEXIT

Double click on this domain ZTYPEOFEXIT and choose Yes when it prompts us to create the
domain.
Give short description and data type as CHAR 1 as shown.

Choose the value ranges tab and give the keys and values as shown. We will see these values in the
infotype, while creating a record and displaying and in Keys values (1 or 2) would be actually getting
stored in the database table of the infotype.

Save and activate the domain and the data element and go back. We are now in the PS Structure of the
infotype.
It is to be noted that we have to put all the fields which we want to make input enabled in the PS
structure. Now we have to give the enhancement type of the PS Structure.

Choose Can be Enhanced radio button and click on copy.

Now Save and Activate the PS structure.


Go back to the initial screen of PM01.
Click on Generate Objects push button. Now few message boxes appear click on green check box on them.
Finally we reach the Infotype Characteristics screen.

Click on New Entries Button. We see the Details of added entries Screen.

Enter our Infotype number and short text.


Here we have to set different Infotype Characteristics as per the requirement. (Better open another session with
some standard Infotypes infotype characteristics screen and use as the reference to fill ours).

Save our entries. Click on the back button to go to the initial screen of PM01.
Click on Technical Attributes. Infotype list screen appears.
Click on Change (pencil) button. It gives us a warning. Click on the green tick mark.
Click on Position button and browse to our infotype. In our case it would be 9080.

Select our Infotype and click on Detail (magnifying glass) button.


Give T591A as subtype table.
Give T591S as subtype txt tab.

Give our subtype field as subtype field if we want to keep subtypes in this infotype.
Save and come back to PM01 initial screen.
Now the Infotype is created and ready to use and is in its basic form.
To see how infotype looks in its basic form, go to PA30, enter a personal number and give
infotype number as 9050.

Click on the

create button. Notice how the infotype looks in its basic form.

Changing the labels of the fields, adding buttons and incorporating a sub screen which stores data in a cluster table

Notice the red circle - We would need to change the texts of that field and we would create a
button here which would call a sunscreen and data on this sunscreen would be stored.

Go to PM01 again and give infotype number.


Now choose the Screen radio button. Click the edit button.

On the next screen, which is the module pool screen, click on the change button.

Notice that we can change this program despite it being not starting with a 'Z' or a 'Y'. It is so because this is a
custom infotype.

Now we are in the module pool. Following is the source code written:
PROCESS BEFORE OUTPUT.
*

general infotype-independent operations


MODULE BEFORE_OUTPUT.
CALL SUBSCREEN subscreen_empl INCLUDING empl_prog empl_dynnr.
CALL SUBSCREEN subscreen_header INCLUDING header_prog header_dynnr.

infotype specific operations


MODULE P9080.

*
MODULE HIDDEN_DATA.
*
PROCESS AFTER INPUT.
*---------------------------------------------------------------------*
* process exit commands
*---------------------------------------------------------------------*
MODULE EXIT AT EXIT-COMMAND.
*---------------------------------------------------------------------*
*

processing after input

*---------------------------------------------------------------------*
*
*

check and mark if there was any input: all fields that

accept input HAVE TO BE listed here

*---------------------------------------------------------------------*

CHAIN.
FIELD P9080-BEGDA.
FIELD P9080-ENDDA.
FIELD P9080-ZZKEY1.
FIELD P9080-ZZDATE.
FIELD P9080-ZTYPEOFEXIT.
MODULE INPUT_STATUS ON CHAIN-REQUEST.
ENDCHAIN.
*---------------------------------------------------------------------*
*

process functioncodes before input-checks

*---------------------------------------------------------------------*
MODULE PRE_INPUT_CHECKS.
*---------------------------------------------------------------------*
*

input-checks:

*---------------------------------------------------------------------*
* insert check modules here:
* ...
*---------------------------------------------------------------------*
*

process function code: ALL fields that appear on the

screen HAVE TO BE listed here (including output-only fields)

*---------------------------------------------------------------------*
CHAIN.
FIELD P9080-BEGDA.
FIELD P9080-ENDDA.
FIELD RP50M-SPRTX.

FIELD P9080-ZZKEY1.
FIELD P9080-ZZDATE.
FIELD P9080-ZTYPEOFEXIT.
MODULE POST_INPUT_CHECKS.
ENDCHAIN.

We will first of all go to the graphical layout of this infotype, change some texts, and create a
button on which we can call a sub screen.
Click on the Layout button.

First of all we will delete the input field p9080-zzkey1 and we will create a button there. There is a field in our infotypes
database table (which is pa9080) named zzkey . We would not be displaying this field in the infotype. But whenever a
record is created, a unique key comprising of Personal number, current date and current time would be inserted in the
database table pa980's zzkey1 field. This key would act as a pointer to the cluster table where we would be storing the
'Huge Data'. It would help us retrieve data from cluster table PCL3 while displaying the already created data and while
making any report or form on our infotype.

After deleting the field zzkey1 from layout, create a button at that place

Let us give it a name 'B1' and give its functional code say 'T1'. Click on the icon button next to
Icon name field in the properties box of this button and choose the icon say '
ICON_DESELECT_ALL' . It would make our button as shown above.
Nets change the text 'Key for what we did' to ' What did you like most about working in our
company ' by double clicking and going into the properties of the text and changing text there as
shown:

Now, if we activate our screen and see the infotype in PA30, the button would come grey and we
wont be able to press it or perform any action on it.
To make the button 'Alive' in the infotype, we need to give specific screen group codes to it. In
the properties box of our button, give ' 01F' in the first box of the 'Groups' and ' 004' in the
second box of the 'Groups' section as shown.

Our button is now 'Alive'. Lets go for the coding part now to open a sunscreen on click of this
button, unique key generation and storing of data in the cluster table.
Save and close the layout so we are again in module pool of the screen.
Now when we check the module pool program by pressing 'Ctrl + F2' , it gives us an error.

This error is coming since we deleted the input field zzkey1 from the layout. So we need to deactivate the lines
wherever it is being used in the code:
PROCESS BEFORE OUTPUT.
*

general infotype-independent operations

MODULE BEFORE_OUTPUT.
CALL SUBSCREEN subscreen_empl INCLUDING empl_prog empl_dynnr.
CALL SUBSCREEN subscreen_header INCLUDING header_prog header_dynnr.
*

infotype specific operations


MODULE P9080.

*
MODULE HIDDEN_DATA.
*
PROCESS AFTER INPUT.
*---------------------------------------------------------------------*
* process exit commands
*---------------------------------------------------------------------*
MODULE EXIT AT EXIT-COMMAND.
*---------------------------------------------------------------------*
*

processing after input

*---------------------------------------------------------------------*
*
*

check and mark if there was any input: all fields that

accept input HAVE TO BE listed here

*---------------------------------------------------------------------*
CHAIN.
FIELD P9080-BEGDA.
FIELD P9080-ENDDA.
*

FIELD P9080-ZZKEY1. --> Here


FIELD P9080-ZZDATE.

FIELD P9080-ZTYPEOFEXIT.
MODULE INPUT_STATUS ON CHAIN-REQUEST.
ENDCHAIN.
*---------------------------------------------------------------------*
*

process functioncodes before input-checks

*---------------------------------------------------------------------*
MODULE PRE_INPUT_CHECKS.
*---------------------------------------------------------------------*
*

input-checks:

*---------------------------------------------------------------------*
* insert check modules here:
* ...
*---------------------------------------------------------------------*
*

process function code: ALL fields that appear on the

screen HAVE TO BE listed here (including output-only fields)

*---------------------------------------------------------------------*
CHAIN.
FIELD P9080-BEGDA.
FIELD P9080-ENDDA.
FIELD RP50M-SPRTX.
*

FIELD P9080-ZZKEY1. --> Here


FIELD P9080-ZZDATE.
FIELD P9080-ZTYPEOFEXIT.
MODULE POST_INPUT_CHECKS.
ENDCHAIN.

Our program is now error free. Activate it and come back to PM01 screen. Now choose the
'Module pool' radio button and click on edit and on the next screen, click change.
We are in the main program of the infotype - here we see the following code:
INCLUDE MP908010. <-- Double click here " Data Definitions
INCLUDE MPPDAT00.
INCLUDE FP50PPSB.

" Global Data


" Buffer

INCLUDE MPPERS00.

- Do not change

- Do not change

" Standard Modules- Do not change

INCLUDE MP908020.

" Output Modules

INCLUDE MP908030.

" Input Modules

INCLUDE MP908040.

" Subroutines

INCLUDE MP908050.

Double click on the 'Data definition include and we are with the following code:
*----------------------------------------------------------------------*
*
*

*
Data definition for infotype 9080

*
*

*----------------------------------------------------------------------*
PROGRAM MP908000 MESSAGE-ID RP.
TABLES: P9080.
* the following tables are filled globally:
* T001P, T500P
* they can be made available with a TABLES-statement
FIELD-SYMBOLS: <PNNNN> STRUCTURE P9080
DEFAULT P9080.
DATA: PSAVE LIKE P9080.
Add the following data declaration there.

TYPES: BEGIN OF TY_ALKEY,


PERNR TYPE P0001-PERNR,
AEDTM TYPE SY-DATUM,
TIME TYPE SY-UZEIT,
key type char2,
END OF TY_ALKEY.
DATA: AL_KEYtab TYPE TABLE OF TY_ALKEY,
IT_TEXT1 TYPE TABLE OF TXW_NOTE,
it_ln like line of it_text1,
itab type table of pa9080 with header line,
AL_KEY1 LIKE LINE OF AL_KEYtab,
pcomm type sy-ucomm,
pp type c value 'X'.

Check and activate the code and come back to the PM01 transaction.
Again choose 'Screen' radio button , click on edit and on the next screen click change.
Now we are on the Module pool.
Add a PBO module ' MODULE Z9080 as shown in the code below.
PROCESS BEFORE OUTPUT.
*

general infotype-independent operations


MODULE BEFORE_OUTPUT.
CALL SUBSCREEN subscreen_empl INCLUDING empl_prog empl_dynnr.
CALL SUBSCREEN subscreen_header INCLUDING header_prog header_dynnr.

infotype specific operations


MODULE P9001.
module z9080.

<-- Add it here

*
MODULE HIDDEN_DATA.
*
PROCESS AFTER INPUT.

Now Double click on ' module z9080. '


It asks " PBO Module Z9080 does not exist.Create Object?"
Click yes and give an include name starting with 'Z'.

Click on the green tick mark and we are now in the PBO module ' MODULE Z9080 OUTPUT'
Give the following code there:
*----------------------------------------------------------------------*
***INCLUDE Z9080O01 .
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*&

Module Z9080 OUTPUT

*&---------------------------------------------------------------------*

text

*----------------------------------------------------------------------*
MODULE Z9080 OUTPUT.
PCOMM = SY-UCOMM.
** Generate the Unique Key for the Cluster.
PERFORM F001_GENERATE_CLUSTER_KEY.
IF PSYST-IOPER = 'DIS'.
PP = ' '.
ENDIF.
CASE PCOMM.
WHEN 'T1'.
** Import the Text from the cluster which is stored in the Infotype.
IF P9080-ZZKEY1 IS NOT INITIAL.
IMPORT IT_TEXT1 FROM DATABASE PCL3(AN) ID P9080-ZZKEY1.
ENDIF.
** Call the text editor.
CALL FUNCTION 'TXW_TEXTNOTE_EDIT'
EXPORTING
EDIT_MODE = PP
TABLES
T_TXWNOTE = IT_TEXT1.
P9080-ZZKEY1 = AL_KEY1.
** Export the latest changes to the cluster.
EXPORT IT_TEXT1 TO DATABASE PCL3(AN) ID P9080-ZZKEY1.
** Update the field with the Cluster Key.

WHEN 'UPD'.
** When Save button is clicked the latest key is stored in the Infotype and
** also the latest changes are reflected in the cluster.
EXPORT IT_TEXT1 TO DATABASE PCL3(AN) ID P9080-ZZKEY1.
CLEAR IT_TEXT1.
ENDCASE.
ENDMODULE.

" z9080 OUTPUT

*&---------------------------------------------------------------------*
*&

Form f001_generate_cluster_key

*&---------------------------------------------------------------------*
*

text

*----------------------------------------------------------------------*
* --> p1

text

* <-- p2

text

*----------------------------------------------------------------------*
FORM F001_GENERATE_CLUSTER_KEY .
AL_KEY1-PERNR = P9080-PERNR . " PERNR
AL_KEY1-AEDTM = SY-DATUM. " Startdate
AL_KEY1-TIME = SY-UZEIT.
AL_KEY1-KEY = '1'.
* Remaining fields of the cluster
PCL3-AEDTM

= SY-DATUM.

" Current System Date

PCL3-UNAME

= SY-UNAME.

" User Name

PCL3-PGMID

= SY-REPID.

" Program Name

PCL3-VERSN

= '01'. " Version for Cluster

ENDFORM.

" f001_generate_cluster_key

Check and activate the code and the main module pool too. All things being taken care off - When we want to see
the infotype in display mode, the field pp would be blank and the same would be passed to
'TXW_TEXTNOTE_EDIT' and it will open the sub screen in display mode and pull up the data from the cluster
table PCL3 using the key generated.
Our infotype is now ready for use - see it in PA30

When we press this button, a sub screen comes up and we can enter large text.

Close the sub screen and save the infotype. Lets see our infotype in the display mode now:

Hiding fields of an Infotype


By Bhumika Mahawar, Yash Technologies

Sometimes we require hiding some fields in the Infotypes. This can be done using the view V_T588M.
1. If we see in PA30, the standard screen for 0023 (Other/Previous Employers) is:

2. Let us hide the field Work Contract & Job from the standard Infotype screen.
Go to SM30 & enter view name as V_T588M. Click on Maintain.

3. Enter the module pool program & click on

4. Now click on

5. Now enter the Module Pool (mandatory) Standard screen (mandatory).Press Enter.

6. After we press Enter, all the screen fields of the Infotype are shown along with their attributes.

7. Now, we can change the attributes according to our requirements by selecting the desired radio button. After that
press

8. Then Go to PA30 and check the changes done to the standard Infotype (here Infotype 0023).

Enhancement of Standard Infotype


By Bhumika Mahawar, Yash Technologies

Many times, there might be a requirement to have additional fields along with the standard fields for an infotype.
This can easily be done through Enhancement of Infotypes.

1. The actual standard screen for Infotype 0023 is shown below (see in PA30).

2. The desired screen for Infotype 0023 is:

3. Go to transaction PM01. Select Single Scrn tab .Now enter Infotype no & Infotype Version. The radio button
Customer Include should be selected. Now click on Generate Objects.

4. Click Create.

5. Now create your Customizing include with the additional fields & activate.The components tab appears as
follows.

6. The Currency/Quantity fields tab appear as follows.

7. The fields added in the CI include would also now appear in the table PA0023 in se11as below.

8. Now go back to PM01, tab Single Scrn. Select the radio button Include Screen and enter the screen no (here
0200).Then press Edit.

9. It takes you to se38 with a default module pool program generated automatically. Click on Layout Editor &
then on Change.

10. This navigates you to Screen Painter. Align the fields according to your requirements. Activate the screen.
(a). Before alignment

(b). After alignment

11. Now go back to PM01 and click on Assign Enhancement.

12. Then click on Change. Now you would see the New Entries button. Click on it.

13. Enter all the information as shown below and click on SAVE.

14. Go to PA30 & check the enhancement done to the Infotype. Thus the Infotype Screen is enhanced with the
required fields.

Creating Organization Management infotype


By Venkateswara Rao Appikonda, Intelligroup Inc

1. Check the non-existence of the info type: Check for the existence of any info type with the given number in the
tables T582A and T777D.
2. Go to SE11 and create a data type with the prefix HRI...like HRI9334 (example)

Choose create--->structure

Enter the required fields. Save and activate the structure.


3. Go to transaction code PPCI .
Enter the info type number: 9334 and name as test infotype org man
Choose create---> (F5)

Following screen is displayed:

Choose create then a confirmation box is displayed as shown below:

Choose YES to create, it will show an information message that the info type was created.

4. Go to transaction code SM30---> give the table name T777I.....choose--> maintain

Select the info type that you have created and double click on the time constraint

Then choose new entries...fill the values like this....


1. Object type must be * to allow all the object types.
Some of the objects are given below.
O--> Organizational unit

S--> Position
P--> Person
C--> Job
I1--> Personnel subarea
I2--> Employee subgroup
I3--> Employee group
IA--> Company
IC--> Company code
2. info type

9334

3.time constraint

Following values are possible:


0---> may only exist once
1---> without gaps
2---> with gaps
3---> as often as required

Save it under a transport request


Then click on the info types per object type---->new entries
1. Object type: O

(for Organization)

2. Info type

:9334

Then save it.


5. Go to PO10 transaction--->Select the info type you created. Give any organization unit which is existing in the
current plan. You can choose the entries from the f4 help

Choose create--->

Click on Save.
6. Check whether data is available in the info type HRP9334 or not.

Creating HR Report category in PNP logical database


By Venkateswara Rao Appikonda, Intelligroup Inc

1. Create a program using the transaction SE38.

Provide the logical database name as PNP. Click on SAVE.


2. Then again follow this menu path--->GOTO---->ATTRIBUTES

3. Click on the button HR report category to use the existing report category.

Select the radio button Master Data (Infotypes)

How to create the HR report category


1. Click on HR report category
Give name of the HR report category to be create like ____0001(4 underscores 3 zeros 1) here follow the
standards for creating the HR report category.
To create new HR report category, click on new entries
Give the report category name : ____0002 (this is an example )

Description

: this is test report category

Then save it under a transport request.


Click on allowable selection criteria--->choose enter----> new entries

Get the fields from select option field with F4 help and give the values to be appeared in the selection screen of the
LDB you want.

Save it.
How to use the report category in the LDB
If the report category is space, it means there is nothing given in the HR report category.

The output screen will be like this...with more field options

If the report category is _____000 (5 underscores 3 zeros no gap) No LDB selection screen is displayed. It shows
a clear screen.

The output screen will be like this...

_____001 (5 underscores 2 zeros 1 no gap) only personnel number with out search help

_____003 (5 underscores 2 zeros 3 no gap) personnel number, Employment status, Payroll area,
Pers.area/subarea/cost center

This is a simple program for understanding the PNP LDB... with report category _____001.
report zpnpldb .
INFOTYPES: 0001.
tables : pernr .
GET PERNR.

PROVIDE * FROM P0001 BETWEEN PN-BEGDA AND PN-ENDDA.


WRITE: / P0001-PERNR,
P0001-STELL,
P0001-BEGDA,
P0001-ENDDA.
ENDPROVIDE.
TABLES: PERNR.
INFOTYPES: 0001.
GET PERNR.
RP_PROVIDE_FROM_LAST P0001 SPACE PN-BEGDA PN-ENDDA .
IF PNP-SW-FOUND = 1.
WRITE: / PERNR-PERNR, P0001-STELL, PN-BEGDA, PN-ENDDA.
ELSE.
REJECT.
ENDIF.
This is a simple program for understanding the PNP LDB... with report category
space or with no report category.
report zpnpldb .
tables : pernr .
INFOTYPES: 2001 MODE N.
initialization .
*pnpbegda = sy-datum - 30 .
*pnpendda = sy-datum .
pnppernr-sign = 'I'.
pnppernr-option = 'EQ' .

pnppernr-low = '1000'.
append pnppernr.
pnppernr-low = '1001'.
append pnppernr.
pnppernr-low = '1002'.
append pnppernr.
pnppernr-low = '1003'.
append pnppernr.
start-of-selection .
GET PERNR.
RP_READ_ALL_TIME_ITY PN-BEGDA PN-ENDDA.
LOOP AT P2001.
WRITE: / p2001-pernr , p2001-begda, p2001-endda, P2001-ABWTG.
ENDLOOP.
end-of-selection .

Linking SAP User-id to Personnel no


By Sunitha S

The linking between Personnel No and the SAP Userid is available in the infotype 0105. This information can be
maintained as shown below:
Go to transaction PA30.

Enter the infotype 0105 in the Direct selection and 0001 in the subtype.

Click on Create.
Following screen appears:

Enter the start date and the end date as required. Also enter the SAP User-id to which this personnel number has to
be mapped.
Click on Save to update your records

Maintaining Employee Master Data in HR


Part 1 - Configuration of PA30 Transaction

Configuration of PA30 Transaction


By Arpita Karmakar, ABAP & XI Fast Trac Manager, IBM India

The SAP HR module enables companies to effectively manage information about the people in their organization. It
is integrated with other SAP modules and external systems.
The five submodule of SAP HR Module are which we normally come across are:
1.

Personnel Administration (PA)

2.

Organization Management (OM)

3.

Personnel Development (PD)

4.

Time Management (TM)

5.

Payroll

From the Organization Management (OM) perspective, companies can model a business hierarchy, the relationships
of employees to various business units and the reporting structure among employees.
The Personnel Administration (PA) sub module helps employers to track employee master data, work schedules,
salary and benefits information.
The Personnel Development (PD) functionality focuses on employees' skills, qualifications and career plans.

Finally, the Time Management (TM) and Payroll sub modules process attendance and absences, gross salary and tax
calculations, and payments to employees and third party vendors.
It is all because of the time-constrained nature of HR data; we have slightly different terminology than the rest of
SAP. We have the concept of Infotypes, which are just tables storing HR with respect to time.
HR ones, in general, starts with PA and then the IT number. Hence, IT0001 is PA0001 when you are looking at
tables.
So IT001 will be having PA0001 as the database table underlying and the structure P0001.
OM infotypes start with HRP and similarly IT1000 is HRP1000 in the data dictionary.
If you want to create a new infotype then use transaction PM01. The idea is that you have a way to configure what
you need via tables T588M (Infotype Screen Control) and T582A (Infotypes: Customer-Specific Settings).
Master data in Personal Administration, can be also coined, as Employee Master data in HR, is stored in PA
infotypes.
Each infotype pertains to a specific type of data.
Each infotype has a database table and a structure associated with it.
Example: For Infotype 0000, the corresponding Structure is P0000 and the database table associated with it is
PA0000.
The information units used to enter the data of an employee are called infotypes.
The Infotypes are used to group related data fields together.
E.g.. IT0000 (Actions), IT0002 (Personal Data), IT0006 (Address) or IT0105 (Communications)
As HR is related to time, we require old data as well as new data. The data we enter into the infotypes are
automatically checked for accuracy and against the table entries.
In simple, HR data is huge and to access data easily we require Infotype.
The sub-division of infotype records is subtypes. Each subtype represents an infotype category with its own time
character.
Infotype 0006 is for addresses. These addresses are sub-divided in the IT0006 as permanent residence, secondary
residence and home address.
Like wise Infotype 0105 is for Communication. One employee can have various Communication Media like SAP
User Name, EMAIL, and CREDIT CARD etc. So IT PA0105 is subdivided into multiple subtypes as 0001 for SAP
USER, MAIL for Email, 0011 for Credit Card etc.
Also some Employee Information like BAND, Annual Salary etc is also maintained in Employee Master via
subtypes in Communication Infotypes.
Subtype BAND 0008

Annual Salary 0009


Contractor Rate - 0014
Contractor Vendor 0015
Contractor Type - 0016
In this tutorial, we will try to show how Employee Master Data is maintained in HR.
Part 1. Configuration of PA30 transaction, which is heart of HR Employee Master data Maintenance
Part 2. Maintaining Employee Master data via PA30 which covering the entire life cycle of an Employee
Starting with HIRING of an Employee to CHANGING some data for the Employee, ROLL BACK
Changes made to the Employee data TERMINATING the employee, REACTIVATING and REHIRING the
Employee.
1. Maintaining Infotype Menus for PA30 and other related transactions
Overview
This screen shot from PA30 Maintain Master Data shows the selection of menu tabs and infotypes available. This
document explains how to change these setting to suit the user.

This layout is configured in 3 steps:


Configuration part 1 Infotype Menu Tab

Configuration part 2 Infotype list


Configuration part 3 Determine choice of infotype menu
These are detailed below.
Configuration part 1 Infotype Menu Tab
IMG Personnel Management Personnel Administration Customizing Procedures Infotype Menus
Infotype Menu
This presents two menu options; select the first - User group dependency on infotype menus that presents the
following screen:

It is recommended that you do not change the existing menu tabs; instead create your own. To create a new menu
tab click New Entries - the code in column 1 is just an identifier for the menu tab. To easily identify your tabs from
SAP example/standard ones, it is recommended that you start your menu code with Z and enter a description that
appears on the menu tab when displayed on PA30.
The column for User-dep is ticked to make the menu tab user dependant. This means further configuration of the
infotype list, is done by user group to allow different presentation depending on the type of user. You should decide
if this is applicable and select appropriately. User groups are a wider topic than just for this configuration and
should be reviewed as part of the project. If you do not have different user groups on your project, do not tick the
User-dep column and do all work against user group 00.
The Reaction column is the reaction if the user parameter UGR (user group) is not maintained for a particular user
when displaying the menu tab. If this is left blank, there is no message and the settings for the standard user group
are used (i.e. reference user group). W is the same as blank, but also displays a warning message for the user that
they need to maintain their user group. E will give an error message and will not display the menu tab.
The ref. Column is the reference user group i.e. the user group settings that should be used. E.g. if the user in
group 07 uses PA30, but no menus have been set for 07, you can enter another user group number in this column as
the one that should be used instead.
Configuration part 2 Infotype list

IMG Personnel Management Personnel Administration Customizing Procedures Infotype Menus


Infotype Menu
This presents two menu options, select the second - infotype menus and enter the menu tab number you created
earlier. When in the screen, click New Entries, once your configuration is complete, the screen may look something
like this:

The entries here show that for user group 08, infotypes 0000,0001,0002, etc are displayed in the order shown. The
second column is a sequential number which determines the order the infotypes appear on the list it is not possible
to overtype this number, so if you wish to change it, you have to delete the line and put it back with a different
sequence number. The next column is the infotype number you wish to appear. The column Scre.. is not normally
used it is for infotype screen control, e.g. if infotype 0006 Address normally goes to screen for country 08 (GB),
you can force it to go to another version of the screen, i.e. enter a different country number.
User Group Example
Here we see an example using different user groups:

Menu tab 95 is for Basic Data; we see from the list that if the user has group 08, they will be presented with
infotypes 1,2,6,8 and 65. For Germany (presuming user group 01) the selection will not include infotype 65. A user
belonging to group other that 08 or 01 would not be found in this table, but the reference user group is set to 08
which means they will be directed to the 08 settings.
Note that this example presumes user groups based on MOLGA country code, as is usually the case.
The user group numbers do not have to represent the country of the user, they can refer to their
department, job function etc. Menu tabs and infotype lists are configured accordingly.

Configuration part 3 Determine choice of infotype menu


IMG Personnel Management Personnel Administration Customizing Procedures Infotype Menus Determine
choice of infotype menus

In this final step, we set up which of the menu tabs appear on PA30 and in which order (and various other
transactions)
This IMG step has two options, select the second = Infotype Menus. A box will prompt for a menu number, enter 01
if you wish to make changes to PA30 Maintain Master Data, click the possible entries button to see other options for
areas like travel.
There will be entries in this table already that you must delete or change according to your requirements. Here we
see a simple example:

Users going to PA30 in user group 01 will be presented with the menu tabs for Basic Details, and Time Data, for 08
they will also get Payroll menu tab.
Refer to the example at the very beginning of this document to see how this would look.
Now test the configuration has worked by going to PA30 and reviewing the infotype menus. Follow back through
steps 1 to 3 to correct any problems or make adjustments.
In our project we have a customized User Menu set up for the PA30 transaction as below.
Following the same path
IMG Personnel Management Personnel Administration Customizing Procedures Infotype Menus
Infotype Menu
In the first option: (User group dependency on menus and info groups) the entry TR (AOL -Mini Master) view is
taken into consideration for the project.

In the next option (Infotype Menu) select TR and press enter.

Now the next screen (Display View Infotype Menu :Overview), which comes up, explains the screen flow
sequence, which we will be observing henceforth in our PA30 transaction.
The Infotypes configured for our system and the sequence number in which they come are explained by the
following screen shot.

Now in the final set up


IMG Personnel Management Personnel Administration Customizing Procedures Infotype Menus Determine
choice of infotype menus

Choose the option (Infotype menus) and set TR (AOL Mini Master) for all.
This will ensure when you go to PA30 the view set up in TR will come up.

Maintaining Subtypes for Communication Infotype.


Follow the path
IMG Personnel Management Personnel Administration Communication-Create communication types.

Following Subtypes are maintained for our project.

Part 2 - Maintaining Employee Master Data using PA30


Create an Employee using PA30

Create an Employee using PA30


By Arpita Karmakar, ABAP & XI Fast Trac Manager, IBM India

Go to PA30.Enter a new Employee Number. Choose Actions Infotype (PA0000). Hit Create.

The Employee Number entered in the system is a new one. So none of the Infotypes came as ticked with a green
mark.

Press Create Button.


You will be taken to the next screen. Choose (HIRE) for our case AOL Hire in Action Type to hire the Employee.

Save the ACTIONS records. System will automatically take to you next Infotype screen, which is PA0002 (Personal
Data).
Enter the personal details as Last Name, Middle Name First Name etc. Save the PA0002 Infotype.

System will then take you to the next Infotype screen, which is PA0001 (Organizational Assignment).
Enter the required fields like Sub Area and save. This Infotype PA0001 stores data about the employees position the
Organization Structure.

Save the Org data and you will be guided to the next Infotype Screen Address in our case; Infotype PA0006.
Enter Address related field values Save the data.

You will be guided to the next Infotype screen Planned Working Time Infotype PA0007.
Save the Planned Working Time Infotype PA0007.

You are next taken to the Bank Details Infotype Screen PA0009.
Save the Bank Details data in Infotype PA0009.

System takes you to next Infotype that is Travel Privilege. (PA0017).


Notes: If you want to skip any Infotype in the screen flow to enter data manually at a later stage you might press Skip
Button. As in our case. We might have skipped the Bank Details Screen, as this data is confidential and can be maintained
later.
Enter Travel privilege data like Cost Center etc. Save the Infotype (PA0017).

System takes you to the Communication Infotype IT PA0105 with a variety of Subtypes.

Communication Subtype 0001 (SAP User ID). Save the data entered.

Communication Subtype MAIL (Email). Save the data entered.

Communication Subtype Credit Card (0011). Save the Data

Communication Subtype Annual Salary (0009). Save the Data

Communication Subtype Contractor Hourly Rate (0014). Skip the screen, as you dont need this information for an
Employee.

If you were entering the data for a Contractor determined by Employee Group-Subgroup combination then you
would have been needed to save this Subtype.
An overview of Employee Group Subgroup concept is taken up later in this course.
Communication Subtype Contractor Vendor (0015). Skip the screen, as you dont need this information for an
Employee.

If you were entering the data for a Contractor determined by Employee Subgroup then you would have been needed
to save this Subtype.
Communication Subtype Contractor Type (0016). Skip the screen, as you dont need this information for an
Employee.

If you were entering the data for a Contractor determined by Employee Subgroup then you would have been needed
to save this Subtype.
Communication Subtype Band (0008). Save the data.

Communication Subtype Screen Name (CDID). Save the data.

Enter Time Sheet Details Data. Save the Infotype (PA0315).

In our case that is the final Infotype coming in the screen flow logic.
Save the data and you have created the employee successfully.
Now you can see all the infotypes you have created are coning with green tick mark as shown below.

You can go to PA10 and get the employee details with all the Infotypes created, as you have desired.

Change Employee data using PA30


By Arpita Karmakar, ABAP & XI Fast Trac Manager, IBM India

In this example we track the changes on Personal Data (PA0002), Credit Card Information of the Employee
(PA0105 Subtype 0011), Annual Salary (PA0105 Subtype: 0009), Band (PA0105 Subtype 0008) and Time Sheet
details (PA0315).
The employee data was changed on 02/02/2005.In that case the first set of data will be delimited and new sets will
take the old place.
So for example if we consider the Sender Cost Center Information in Time Sheet Details Infotype PA0315, getting
changed:
The old value will be valid in the system from his/her date of join, which in our case is 01/01/2005 till the day
before changes are perceived, by the system.
So the old Sender Cost Center will be delimited and will only be valid from 01/01/2005 till 02/01/2005.
The new changes will be effective from 02/02/2005 till infinity that is 9999/12/31.
To create a change record; first create a new action which will be CHANGE ACTION and proceed as follows:

Save the Action Infotype and note the system message that says last action record delimited.
Enter new data in the system and save the data. New PA0002 records are created and old one is delimited.

No change in Org Data. So skip forward.

Skip the confirmation pop up screen in case of no change.


Skip Address. No Change in address.

Skip Planned Working Time. No Change in that.

Skip Bank Details. No Change in that.

Skip Travel Privilege. No Change in that.

Skip Communication IT Subtype 0001 (SAP User Name). No Change in that.

Skip Communication IT Subtype MAIL (Email). No Change in that.

So in case you needed to change Credit Card data delimit the old one and then save the new data in next screen.

Delimit the record.


Enter new Credit Card Number and SAVE for Communication Subtype (0011).

There was a change in Gross Average Monthly Salary Communication Subtype 0009 (Salary). Enter the new value
and SAVE.

There was a change in BAND. Communication Subtype 0008 (Band/Grade).


Enter the new value and SAVE.

No change in CDID Communication Subtype CDID (Screen Name). Skip forward.

Enter the new values in IT PA0315 (Time Sheet Details). Save the data.

As this was the last infotype in our case; the change process was complete. You can go to PA10 and see the changed
and delimited values.

Terminating an Employee using PA30


By Arpita Karmakar, ABAP & XI Fast Trac Manager, IBM India
To terminate an employee you need to create an ACTION record with Action Type as Terminate and proceed as follows:
Create Terminate ACTION and SAVE the data.

The last Change Action record delimited.

Skip the Org Data

Delimit the Address Data

Delimit the Planned Working Time Data

Delimit the Travel Privilege Data

Delimit Communication (Sub type SAP USER NAME)

Delimit Communication (Sub type MAIL)

Delimit Communication (Sub type Credit Card 0011)

Delimit Communication (Sub type Average Monthly Salary 0009)

Delimit Communication (Sub type Band/Grade 0008)

Delimit Communication (Sub type CDID)

Delimit Time Sheet Details

As this is the last Infotype in our case delimiting this record takes you to end of TERMINATION.

ALV report listing all the infotypes that are customized in a SAP system with
the structure name
By Swarna S, Tata Consultancy Services

*&---------------------------------------------------------------------*
*& Report ZINFOTYPE

*& Author : Swarna.S

*&---------------------------------------------------------------------*
*&

*& This program lists all the infotypes maintained in SAP system
*&---------------------------------------------------------------------*

REPORT zinfotype .
TYPE-POOLS : slis.
*Structure declaration for Infotypes for customer
TYPES : BEGIN OF ty_table,
infty TYPE infty,
pnnnn TYPE pnnnn_d,
END OF ty_table.
*Structure for infotype text
TYPES : BEGIN OF ty_itext,
infty TYPE infty,
itext TYPE intxt,
sprsl TYPE sprsl,
END OF ty_itext.
*Structure for output display
TYPES : BEGIN OF ty_output,
infty TYPE infty,
itext TYPE intxt,
pnnnn TYPE pnnnn_d,
END OF ty_output.
*internal table and work area declarations
DATA : it_table TYPE STANDARD TABLE OF ty_table INITIAL SIZE 0,
it_output TYPE STANDARD TABLE OF ty_output INITIAL SIZE 0,
it_ittext TYPE STANDARD TABLE OF ty_itext INITIAL SIZE 0,
wa_table TYPE ty_table,
wa_output TYPE ty_output,

wa_ittext TYPE ty_itext.


*Data declarations for ALV
DATA: c_ccont TYPE REF TO cl_gui_custom_container, "Custom container object
c_alvgd

TYPE REF TO cl_gui_alv_grid, "ALV grid object

it_fcat

TYPE lvc_t_fcat,

it_layout

TYPE lvc_s_layo.

"Field catalogue
"Layout

INITIALIZATION.
START-OF-SELECTION.
*select the infotypes maintained
SELECT infty
pnnnn
FROM t582a
INTO TABLE it_table.
*Select the infotype texts
IF it_table[] IS NOT INITIAL.
SELECT itext
infty
sprsl
FROM t582s
INTO CORRESPONDING FIELDS OF TABLE it_ittext
FOR ALL ENTRIES IN it_table
WHERE infty = it_table-infty
AND sprsl = 'E'.
ENDIF.
*Apppending the data to the internal table of ALV output

LOOP AT it_table INTO wa_table.


wa_output-infty = wa_table-infty.
wa_output-pnnnn = wa_table-pnnnn.
* For texts
READ TABLE it_ittext INTO wa_ittext WITH KEY infty = wa_table-infty.
wa_output-itext = wa_ittext-itext.
APPEND wa_output TO it_output.
CLEAR wa_output.
ENDLOOP.
* Calling the ALV screen with custom container
CALL SCREEN 0600.
*On this statement double click it takes you to the screen painter SE51.
*Enter the attributes
*Create a Custom container and name it CC_CONT and OK code as OK_CODE.
*Save check and Activate the screen painter.
*Now a normal screen with number 600 is created which holds the ALV grid.
* PBO of the actual screen , Here we can give a title and customized menus
*&---------------------------------------------------------------------*
*&

Module STATUS_0600 OUTPUT

*&---------------------------------------------------------------------*
*

text

*----------------------------------------------------------------------*
module STATUS_0600 output.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.

endmodule.

" STATUS_0600 OUTPUT

* calling the PBO module ALV_GRID.


*&---------------------------------------------------------------------*
*&

Module ALV_GRID OUTPUT

*&---------------------------------------------------------------------*
*

text

*----------------------------------------------------------------------*
MODULE alv_grid OUTPUT.
CREATE OBJECT c_ccont
EXPORTING
container_name = 'CC_CONT'.
CREATE OBJECT c_alvgd
EXPORTING
i_parent = c_ccont.
* Set field for ALV
PERFORM alv_build_fieldcat.
* Set ALV attributes FOR LAYOUT
PERFORM alv_report_layout.
CHECK NOT c_alvgd IS INITIAL.
* Call ALV GRID
CALL METHOD c_alvgd->set_table_for_first_display
EXPORTING
is_layout

= it_layout

CHANGING
it_outtab

= it_output

it_fieldcatalog

= it_fcat

EXCEPTIONS
invalid_parameter_combination = 1
program_error

=2

too_many_lines

=3

OTHERS

= 4.

IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDMODULE.

" ALV_GRID OUTPUT

*&---------------------------------------------------------------------*
*&

Form alv_build_fieldcat

*&---------------------------------------------------------------------*
*

text

*----------------------------------------------------------------------*
*

<--P_IT_FCAT text

*----------------------------------------------------------------------*
FORM alv_build_fieldcat.
DATA lv_fldcat TYPE lvc_s_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '1'.
lv_fldcat-fieldname = 'INFTY'.
lv_fldcat-tabname = 'IT_OUTPUT'.

lv_fldcat-outputlen = 8.
lv_fldcat-scrtext_m = 'Infotype'.
lv_fldcat-icon = 'X'.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '2'.
lv_fldcat-fieldname = 'PNNNN'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 15.
lv_fldcat-scrtext_m = 'Structure'.
lv_fldcat-icon = ''.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '3'.
lv_fldcat-fieldname = 'ITEXT'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 60.
lv_fldcat-scrtext_m = 'Description'.
lv_fldcat-icon = ''.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
ENDFORM.

" alv_build_fieldcat

*&---------------------------------------------------------------------*

*&

Form alv_report_layout

*&---------------------------------------------------------------------*
*

text

*----------------------------------------------------------------------*
*

<--P_IT_LAYOUT text

*----------------------------------------------------------------------*
FORM alv_report_layout.
it_layout-cwidth_opt = 'X'.
it_layout-zebra = 'X'.
ENDFORM.

" alv_report_layout

* PAI module of the screen created. In case we use an interactive ALV or


*for additional functionalities we can create OK codes
*and based on the user command we can do the coding.
*&---------------------------------------------------------------------*
*&

Module USER_COMMAND_0600 INPUT

*&---------------------------------------------------------------------*
*

text

*----------------------------------------------------------------------*
module USER_COMMAND_0600 input.
endmodule.

" USER_COMMAND_0600 INPUT

Create the screen 0600 for the above program and place a custom container on the same:

Name the custom container as CC_CONT.

Also enter the attribute OK_CODE for the OK code as shown above.
Activate and execute the program:

Demo program using the logical database PNP


By Chandeep Singh, Fujitsu India

************************************************************************
*** NAME

: Chandeep Singh

*** DESCRIPTION : TO GENERATE SIMPLE REPORT USING HR ABAP


**

LOGICAl DATABASE- PNP .

************************************************************************
REPORT ZChandeep_HR_prog_1
LINE-SIZE 200 .
****************************
*Database Table
****************************

TABLES: PERNR,

" Pernr structure for Logical database

PA0001,

" Actions

PA0002.

" Personnel Info

****************************
*Infotypes
****************************
INFOTYPES: 0001,
0002.

" Actions

" personnel info

****************************
*Variable Declaration
****************************
DATA: FORM_NAM LIKE P0001-ENAME,
V_AGE(5) TYPE C,

"variable for calculating age in days

V_CTR1 TYPE I VALUE 0, "counter


V_CTR2 TYPE I VALUE 0, "counter
VAR(5) TYPE C ,

" variable to store btrtl

VAR1(5) TYPE C .

" variable to store werks

*****************************
*Internal Table Decalartion
*****************************
DATA: BEGIN OF I_TAB1 OCCURS 0,
WERKS LIKE PA0001-WERKS, "personnel area
BTRTL LIKE PA0001-BTRTL, "personnel sub area
PERNR LIKE PA0001-PERNR, "employee number
ENAME LIKE PA0001-ENAME, "employee name

BEGDA LIKE PA0002-BEGDA, "employee join date


PERSG LIKE PA0001-PERSG, "employee group
PERSK LIKE PA0001-PERSK, "employee sub-group
PLANS LIKE PA0001-PLANS, "position
GBDAT LIKE P0002-GBDAT, "date of birth
END OF I_TAB1.
******************************
*START-OF-SELECTION
******************************
START-OF-SELECTION .
GET PERNR .
RP-PROVIDE-FROM-LAST P0001 SPACE PN-BEGDA PN-ENDDA . " Macro for IFT-0001
RP-PROVIDE-FROM-LAST P0002 SPACE PN-BEGDA PN-ENDDA . " Macro for IFT-0002
**--> Populate internal table
MOVE P0001-WERKS TO I_TAB1-WERKS .
MOVE P0001-BTRTL TO I_TAB1-BTRTL .
MOVE P0001-PERNR TO I_TAB1-PERNR .
MOVE P0001-ENAME TO I_TAB1-ENAME .
MOVE P0002-BEGDA TO I_TAB1-BEGDA .
MOVE P0001-PERSG TO I_TAB1-PERSG .
MOVE P0001-PERSK TO I_TAB1-PERSK .
MOVE P0001-PLANS TO I_TAB1-PLANS .
MOVE P0002-GBDAT TO I_TAB1-GBDAT .
**--> Append data to internal table
APPEND I_TAB1 .

CLEAR I_TAB1 .

" Clear header I_TAB1

******************************
*END-OF-SELECTION
******************************
END-OF-SELECTION.
*****sorting the internal table on Personnel Area & Personnel Sub-Area
SORT I_TAB1 BY WERKS BTRTL.
******************************
*TOP_OF_PAGE
******************************
PERFORM TOP_OF_PAGE.
******************************
*Output Display
******************************
LOOP AT I_TAB1.
*for calculating the age in days
V_AGE = SY-DATUM - I_TAB1-GBDAT.
*control break on Personal Sub Area
AT NEW BTRTL .
IF SY-TABIX NE 1.
FORMAT COLOR COL_NORMAL ON.
WRITE:/5 'Total Number of Employees for personnel Sub-Area:',
VAR , 'is ',
V_CTR1.
CLEAR V_CTR1.

FORMAT COLOR OFF.


ENDIF.
ENDAT .
**Control Break on personnel Area
AT NEW WERKS.
IF SY-TABIX NE 1.
FORMAT COLOR COL_TOTAL ON.
WRITE:/5 'Total Number of Employees for Personal Area: ',
VAR1 ,'is

', V_CTR2. "color col_total.

CLEAR V_CTR2.
SKIP 1.
FORMAT COLOR OFF.
ENDIF.
ENDAT .
WRITE:/5 I_TAB1-PERNR, "personnel number
16 I_TAB1-ENAME, "emp name
47 I_TAB1-BEGDA, "join date
60 V_AGE,

"age in days

74 I_TAB1-WERKS, "P area


84 I_TAB1-BTRTL, "P sub Area
94 I_TAB1-PERSG, "emp group
104 I_TAB1-PERSK, "emp sub group
114 I_TAB1-PLANS. "position
V_CTR1 = V_CTR1 + 1.
V_CTR2 = V_CTR2 + 1.

VAR = I_TAB1-BTRTL .
VAR1 = I_TAB1-WERKS .
ENDLOOP.
*&---------------------------------------------------------------------*
*&

Form top_of_page

*&---------------------------------------------------------------------*
*

Header Output

*----------------------------------------------------------------------*
*----------------------------------------------------------------------*
FORM TOP_OF_PAGE.
FORMAT COLOR COL_HEADING ON.
WRITE:/5 'Employee',
16 'Employee',
47 'Join Date',
62 'Age',
74 'Personal',
84 'Personal',
94 'Employee',
104 'Employee',
114 'Position ',
/5 'Number',
16 'Name',
60 '(In Days)',
74 'Area',
84 'Sub-Area',

94 'Group',
104 'Sub-Group'.
FORMAT COLOR OFF.
SKIP 1.
ENDFORM.

" top_of_page

Following is the output:

Difference between logical database PNP and PNPCE


By Chandeep Singh, Fujitsu India
Purpose
The PNPCE logical database supports the evaluation of HR master data. It includes the functions of the PNP logical
database and offers additional evaluation options. Therefore, you should use the PNPCE logical database instead of the
PNP logical database for all new developments.
The enhanced functionality of PNPCE in comparison to PNP essentially concerns the evaluation of Concurrent
Employment, that is the possibility to group evaluate several assignments/personnel numbers of a person. The new events
'GET PERSON' and 'GET GROUP' as well as an enhanced syntax for the INFOTYPES statement (addition AS PERSON
TABLE) for the procurement of infotype data enable you to use the new functionality. The use of these new functions is
optional. You can run a PNPCE report that does not use the new events and the addition for the INFOTYPES statement in
a PNP-compatible session. Since the PNPCE also has an improved selection screen, each report benefits from this even if
the report does not use the functions for evaluating Concurrent Employment.
Prerequisites
A report that wants to use the PNPCE must enter this in its report attributes under Logical database.
In addition, the PERNR structure must be declared in the report using the 'TABLES PERNR' statement. You can only use
the PERNR structure again in certain circumstances. The use of the 'GET PERNR' event is therefore forbidden. Instead,
use the 'GET PERAS' event. Except for the PERNR-PERNR component, all other components of the PERNR structure are
no longer filled and have initial values. This kind of programming (with the exception of PERNR-PERNR) therefore not

permitted.
In addition to the 'GET PERAS' event, you can also use the GET PERSON' and 'GET GROUP' events. To be able to use
these events, you must declare them using the NODES statement (NODES PERSON', 'NODES GROUP', or. NODES
PERAS').
Explanation of Terms
If the 'GET PERSON' and 'GET GROUP events and the 'AS PERSON TABLE' addition for the INFOTYPES statement
are not used, the report indicates that it does not require the functionality for evaluating Concurrent Employment. In this
case, the report runs in a PNP-compatible session. This is referred to as PNP mode in the following documentation. On the
other hand, if the report uses the functionality for evaluating Concurrent Employment we refer to CE mode.
Features
Process of an Evaluation
The PNPCE selection screen offers you as standard a range of functions that you can use to restrict the personnel number
and person selection. These are discussed in more detail in the following sections. The process is initially as follows
regardless of whether the report runs in CE or PNP mode. All available functions and selection conditions leads to the
selection of personnel numbers. If you use the sorting function, this set of personnel numbers is then sorted according to
the sort criteria you selected. In PNP mode, the GET PERAS event is triggered as a result for each personnel number.
In CE mode, the persons belonging to the personnel numbers are determined first for all personnel numbers selected. The
GET PERSON event is then triggered for each person. The person ID is specified in the OBJID component of the
PERSON structure. PERNR_NUM contains the total number of personnel assignments (= personnel numbers) that this
person has and the ALL_PERNRS table, which contains a list of these personnel numbers regardless of whether they were
actually selected or not. The SELECTED flag is set to X for the personnel numbers selected. The flag is initial for all
personnel numbers that are not selected. The PROCESS flag specifies whether the personnel number should be processed
in the rest of the process. This flag is set to X by default for the personnel numbers selected. However, the report can set or
delete this flag at the GET PERSON event for all personnel numbers. In this way, report and logical database
communicate with each other which enables the report to control the rest of the process.
In the next step, the logical database groups all personnel numbers of a person that are to be processed (that is, all
personnel numbers that have the PROCESS flag set). The report can control the type of grouping using the
PNPCE_GROUPING_FROM_PAYROLL flag (normal or payroll grouping) and using the PNPGPRSN (grouping reason)
and PNPGPVAL (grouping value) parameters of the selection screen. The GET GROUP event is triggered for each group
of personnel numbers determined. The GROUPING_REASON and GROUPING_VALUE components contain the
grouping reason and grouping value of this group. The number of personnel numbers that belong to this group and that are
processed subsequently is in PERNR_NUM. The included ALL_PERNR table contains a list of these personnel numbers
with additional information. The SELECTED flag specifies whether the current personnel number was originally selected
(flag is set) or was marked by the report as to be processed. GROUPING_BEGDA and GROUPING_ENDDA contain the
validity period that the personnel number has for this grouping. The NO_AUTHORITY flag is set if there is insufficient
authorization for a personnel number. This personnel number is not processed further. The SORT component defines a
standard sort order for the personnel numbers of a group. The report can change this by overwriting the values. In this way,
report and logical database communicate with each other, which controls the further processing sequence of the personnel
numbers.
The GET PERAS event is then triggered for all personnel numbers of the group (with the exception of the personnel
numbers for which no authorization exists) in the sequence defined by the SORT component (see above). The
SELECTED, GROUPING_BEGDA, and GROUPING_ENDDA components have the same meaning here as with the
GET GROUP event. The PROCESSED_BEFORE flag specifies whether the personnel number has already been
processed once before (it is possible that the personnel number belongs to several groupings and has been therefore been
processed several times).

Retrieving the details of a user from the SAP User-id


REPORT ztest.
PARAMETERS: p_usr
DATA: i_bapiret2
wa_address

TYPE usr21-bname DEFAULT sy-uname OBLIGATORY.

TYPE TABLE OF bapiret2 WITH HEADER LINE,


TYPE bapiaddr3,

g_iderror(20) TYPE c.
CALL FUNCTION 'BAPI_USER_GET_DETAIL'
EXPORTING
username = p_usr
IMPORTING
address = wa_address
TABLES
return = i_bapiret2.
IF i_bapiret2[] IS INITIAL.
MESSAGE s000(su) WITH wa_address-firstname
wa_address-lastname.
ELSE.
LOOP AT i_bapiret2 WHERE NOT id IS INITIAL.
CONCATENATE i_bapiret2-type
i_bapiret2-number
'(' i_bapiret2-id ')'
INTO g_iderror.
CONDENSE g_iderror.
CONDENSE i_bapiret2-message.

WRITE: /,g_iderror,
space,
i_bapiret2-message.
ENDLOOP.
ENDIF.

Creating an Organizational Structure


By Madhusudhan M

Before we go ahead and create an Organizational Structure, lets have a quick look at the terminology used in the
organization structure.
Structures in SAP HCM

1. Organizational structure.
2.

Enterprise structure.

3. Personnel structure

Pay scale structure

Applicant structure

Wage type structure

1. Organizational structure: It contains organizational objects /elements. These are called building elements.
Organizational objects / elements are:

Organizational objects

Org. key

Organizational unit

Job

Position

Person

Cost center

Task

Task group

Ts

If we create any organizational object, System will assign a eight digit numeric number, which is called unique
Number.
1. Organizational Unit: Represents a functional unit in your enterprise, Human Resources department, for
example. According to how tasks are divided up within an enterprise, this could be a department, group or project
team, plant, for example. Organizational units differ from other units in an enterprise such as personnel areas,
company codes, business areas etc. These are used to depict structures (administration or accounting, for example)
in the corresponding components.
Kinds of organizational units
A). Main Organizational unit / Root organizational unit: Whatever the organization we create for the first
time is called Main organizational unit.
B). Sub organizational unit: Under Main org. unit whatever we create is called sub org.units.
2. Job: Jobs, in contrast, are classifications of functions in an enterprise (administrator, for example), which are
defined by the assignment of characteristics. Jobs serve as job descriptions that apply to several positions with
similar tasks or characteristics.
Jobs are used as templates to create Positions that means to say without a job we cant create a position.
Example:

Manager

Engineer

Consultant

Designer

Administrator

3. Position: Represents a post that can be occupied by a person (employee) in the staff assignments of an
organizational unit, purchasing administrator, for example. Positions differ from jobs. A job is not concrete but
rather the basis for the creation of various positions with similar tasks and characteristics. . Positions are created
based on jobs; it means to say without a job we cant create a Position.

Job

Position

Manager

HR manager

Marketing manager

Finance manager

Plant manager

Engineer

Production engineer

Site engineer

Software engineer

Consultant

SAP HR consultant

FI/CO consultant

SD consultant

Designer

Software designer

Web designer

1.

Person: An individual, who is listed as an employee in Personnel Administration. A position can be occupied
partially, hundred percentage.

2.

Task: It is a collection of duties and responsibilities. Tasks are assigned to jobs and positions.
Activity which is performed within an organizational unit
1.

Task group: It is a group of tasks which can be assigned either a job or a position.

* HOW TO CUSTOMIZE ORGANIZATIONAL STRUCTURE*


Organizational structure can be created in three procedures.
1.

Simple Maintenance

2.

Expert Mode / Detailed Maintenance

3.

Organization and Staffing

Comment: If we create organizational Structure in any procedure, the same structure reflects in other two
procedures.
If we create organizational structure in Simple maintenance and Organization and Staffing the relationship between
the objects are assigned by the system. Where as in detailed Maintenance the user has to assign the relationship
code.
The relationship between two objects is expressed in three digit numeric characters.
Each and every relation can be expressed in two ways.
1. Top down which is indicated with B
2. Bottom up which is indicated with A
For example:
TATA group of business---Btop down.
TATA mobiles business-- -Abottom up
In the above Organizational units i.e. BTATA group of business shows its relationship towards A i.e. TATA
mobiles, in the same way A i.e. TATA mobiles shows its relationship towards B i.e. TATA group of business. That
means to say TATA mobiles reports to TATA group of business / TATA group of business is the line supervisor of
TATA mobiles.
So we come to know that the lower level organizational object is A
So we come to know that the higher-level organizational object is B
The relationship codes can be seen through transaction code OOVK table name is T778V
The relationship codes:

Relationship
code

Relationship bottom up

Indicates with A

Relationship top down

Indicates with B

001

Is a subdivision of

Is subdivided into

002

Reports (line) to

Is line supervisor of

003

Belongs to

Incorporates

004

Is subordinate to (disc.)

Is disc.supervisor of

005

Is subordinate to

Is supervisor of

006

Substitutes for

Is substituted by

007

Describes

Is described by

008

Holder

Holder

009

Successor

Successor

010

Substitute

Substitute

011

Cost center assignment

Cost center assignment

012

Manages...

Is managed by...

013

Staffing requirement

Staffing requirement

014

Cost distribution

Cost distribution

015

Is identical to

Is identical to

017

Is carried out by

Carries out

018

Previous org. assignment

019

Planned org. change

Planned org. change

020

Is a specialization of

Is a generalization of

021

Is equipped with

Is contained in

Previous org. assignment

022

Requires

Is required by

023

Reserves

Is reserved by

024

Takes place in

Is location of

025

Is attended by

Takes part in

026

Is held by

027

Has a prebooking for

Is the instructor for

Is prebooked for

028

Imparts

Is imparted by

029

Presupposes

Is presupposed by

030

Is a specialization of

Is a generalization of

031

Requires

Is required by

032

Fulfils

Is fulfilled by

033

Is planned for

Can attend

034

Was attended by

Attended events of type

035

Is previous job of

Is subsequent job of

036

Is organized by

037

Designated as successor

038

Has potential for

039

Supplies

Organizes

Designated as successor

Is a potential of

Is supplied by

040

Was cancelled by

Has cancelled

041

Is an equivalent job

Is an equivalent job

042

Interests and preferences

Interests and preferences

043

Dislikes

Is dislike of

044

Consists Of

Is part of

045

Created

Was created by

046

receives

Was created for

047

Contains

Is an element of

048

Application by

049

Is developed by

050

Assesses

Application for

Develops

Is assessed by

051

Is a session of

Is main event of

052

Attends session

Is attended by

053

Still requires

Is still required by

054

Uses (for attendee)

Is used by (attendee)

055

Uses (for bus. event)

Is used by (bus. event)

056

Person has cost center

Persons on cost center

057

Has attendee apprsl model

Is at'ee apprsl model for

058

Has event apprsl model

Is event apprsl model for

059

Employee pool

Employee pool

060

061

062

063

Capacity assignment

Equals

Requirement description

Requires

Person assignment

Equals

Requirement description

Defines demand for

064

Requirements definition

Requirements definition

065

Planned assignment

066

Reserve pool assignment

Reserve pool assignment

067

Exclusive temp.assignment

Exclusive temp.assignment

068

No shift planning

069

Is temporarily done by

Works temporarily as

070

Responsible for cost plan

Responsible for cost plan

071

Parallel temp.assignment

Parallel temp.assignment

072

Shift planning by

Shift planner for

077

Passes through

Is passed through by

Planned assignment

No shift planning

080

Assigned to exposure grp

Exposure group contains

081

Higher duty holder

083

Is Key Position of

Incorporates Key Position

088

Dotted Line Reports to

Dotted Line Supervises

089

Dotted Line Reports to

Dotted Line Includes

090

Is responsibility of

Is responsible for

101

Country reassgmt to

108

Is assigned to

Is assigned to

200

Replaces

Is replaced by

201

Assigned role

Role incorporates

202

Notification agent

Notification agent

204

Possible roles

Possible roles

Higher duty holder

Country reassgmt from

207

Is identical to

Is identical to

208

Is identical to

Is identical to

209

Is filled by

Has employment contract

210

Substitutes with profile

Substitutes with profile

220

Belongs to

221

Is object reference of

222

Belongs organizationally

Incorporates SAP objects

223

Is assigned (valid.per)

Incorporates(for valid.)

224

Is object type of

Is container instance of

has

Contains objects

225

Is event of

Has event

226

Is method of

Has method

227

Triggers

228

Terminates

Is triggered by

Is terminated by

230

Is part of

Contains

231

Assignment exists

Assignment exists

232

Has element

Is an element of

240

Existence depends on

250

Is responsible for

Is responsibility of

262

Reports to

Is superior of

263

Belongs (not uniquely) to

Incorporates (not unique)

264

Belongs (uniquely) to

Incorporates (uniquely)

280

Belongs to system

Uses function

281

Belongs to function

Has combination

282

Is an element of

Has object

283

Sends message

Receives message

290

Has administrator

Is adminstrator for

Defines

291

Partner agreement

292

Maintains brokers

Brokers are maintained

293

Has user for commissions

Is user for commissions

299

Is supported by...

300

Is financed by...

301

Increases

Partner agreement

Supported

Finances...

Is increased by

310

Is responsible for

Is responsibility of

311

Substitutes for

Is substituted by

312

Belongs to (reclassif.)

313

Reclassified from

Reclassified into

314

Is to be financed by

Is earmarked for

315

Responsible for Financing

Incorporates (re-valuatn)

Responsible for Financing

400

Is child of

Is parent of

401

Is assigned

Is assigned

601

Represents

Is Represented By

605

Is an Element Of

Includes Element

606

Is attribute ref. for

Refers to attributes of

607

Is described by

Descriptive element of

620

Is assigned

Is assigned

700

Is responsible for

Is responsibility of

701

Is assigned

Is assigned

710

Fulfils

Is fulfilled by

711

Requires

Is required by

712

Imparts

Is imparted by

750

Vacant position in

Incorporates vacant pos.

751

Is responsibility of

Is responsible for

752

Fills

Will be filled by

753

Publishes

Published by

754

Publishes in

Publishes

755

Application by

756

Has applicant

Applied for position in

900

Manager to manager

Manager under manager

903

Belongs to (alternative)

Incorporates(alternative)

962

Reports to (alternative)

Is superior (alternative)

963

Belongs to (preferred)

Incorporates (preferred)

Application for

Simple maintenance:
How to create organizational structure in Simple maintenance?
PathSAP easy accesshuman resourcesOrganizational managementExpert mode Simple Maintenance

Text

Transaction code

Create

PPOC_OLD

Change

PPOM_OLD

Display

PPOS_OLD

Enter PPOC_OLD in the command field Or Go through the path

Press enter you will get a screen Create Organizational Unit

Here in the above screen enter Organizational unit abbr.


Name of the root organizational unit and its validity period.

After entering abbreviation and name of the unit, enter foundation day of the unit.
Press enter or Press F8 or clicks on create.
Then you will get a screen, which contains unique number organizational key

In the above screen we can see the organizational unit, which we have created.
You can see o which specifies org. key (org. unit) and Unique No i.e. 50017316
Through this number we can identify this org. unit.
This organizational unit is known as Main / Root organizational unit.
HOW TO CREATE SUB ORGANIZATIONAL UNIT:
We can create sub organizational units.
Select SSS1 and Press F7
You will get the following screen in which enter abbreviation and name of org. units.

Here too, enter abbreviation of the sub organizational units and name.
Press enter

Like the above procedure we can create many organizational Units.


How can we see this organizational structure in a structural procedure?
Select the root organizational unit i.e. SSS1

Click on -

or

Again click on

to get only abbreviation codes

HOW TO CREATE JOBS:


Now we are at a screen known as organizational structure/ change
Change the screen, so click on Staff Assignments or F8

Now we are into a screen know as Staff Assignments/ change

Now you can see a screen, known as Staff Assignments / Change, where we can create jobs.
So Press F9

In the above screen we have defined jobs abbreviations and text,


Then press enter.
Here we cant see these jobs in organizational structure, but we can get a message on status bar like

Like this we can create many jobs as per our client requirement
HOW TO CREATE POSITIONS
Be sure that you should be at screen Staff assignments / change:
Select the Organizational unit in which you want to create position
Click on

or F8

Now I have selected corporate office

Here, enter job i.e. mgr1.

Press enter so that this job will transfer under position field.

Here you can create a position

Here we can create 999 positions at a time, but here I have created only one position.

Save.
Click on plus mark so that you can see the position

Like this we can create many positions as per our client requirement
For more information you can see the positions list

HOW TO CREATE A CHIEF


Be on the same screen Staff Assignments/ Change
Select the position to whom you are making as a chief i.e. I am selecting CEO 50017335
Click on Edit chief positionCreate.

Press enter
Now you can see the chief position
Chief position icon is

REPORTING STRUCTURE
It shows who is boss and who is subordinate and who reports to whom.
Select the organizational units in which you are creating the reporting structure.
For example I am selecting corporate officeclick on Go to and click on reporting structure.

Here we will get screen in which we are going to create a reporting structure.

Now select any position to whom you are making boss. I am selecting Position No 50017327 click on elevate

Select the position who is immediate subordinate to him. i.e. I am selecting position no 50017328
Press enter.

Like this you can create reporting structure.


For more information you can see the total structure

HOW TO CREATE A TASK


Click on Go to click on Task Maintenance

Select customer task under task type and click on create or F5

Here write abbreviation and name of the task and press enter and save so that system will assign a unique number

Like this we can create many tasks as per our requirement


HOW TO ASSIGN A TASK TO A POSITION
Select the position to which we are assigning a task
For example select position no 50017327 and click on task profile or F6

Here you can see position, job and Organizational Unit.


Select the position and click on Assign task or F8enter the abbreviation of task which we have created

Press enter
Again Press enter

Now here we can see the task, which we assigned to a position.


ACCOUNT ASSIGNMENT
In account Assignment we have to assign company code, controlling area, personnel area, personnel sub area and
business area to a position.
Select the position to which we are maintaining the account assignment feature, click on Go to click on Account
Assignmentselect the position click on account assignment feature or Shift F7

How to assign a cost center to a position


Select the position and Press F7

Now we can see cost center how it is assigned to a position


Which will reflect in Organizational Assignment (0001) infotype

How to maintain infotypes


Organizational infotypes are:
Note: Business area, cost centre and controlling area will be created by the Fi/co consultants.

1. Where do we create these Organizational objects?


Transaction code OOOT

1. Where do we maintain number ranges to objects?


Transaction code OONR Table t77Iv

Where do we see info types in IMG?


Transaction code OOIT table name t778t

IT

Info type Name

1000

object

1001

Relationships

1002

Description

1003

Department/Staff

1004

Character

1005

Planned Compensation

1006

Restrictions

1007

Vacancy

1008

Acct. Assignment Features

1009

Health Examinations

1010

Authorities/Resources

1011

Work Schedule

1012

work area

1013

1014

Employee Group/Subgroup

Obsolete

1015

Cost Planning

1016

Standard Profiles

1017

PD Profiles

1018

Cost Distribution

1019

Quota planning

1021

Prices

1023

1024

Availability Indicators

Capacity

1025

Deprec. Meter/Validity

1026

Business Event Info

1027

Site-Dependent Info

1028

Address

1029

1030

Business Event Type Info

Procedure

1031

Room Reservations Info

1032

Mail Address

1033

Scale

1034

Name Format

1035

Schedule

1036

Costs

1037

Billing/Allocation Info

1038

External Key

1039

Shift Group

1040

NICHT MEHR VERWENDEN

1041

Business Event Blocks

1042

Schedule Model

1043

Appraisal Model Info

1044

Results Specification

1045

1046

Valuation

Requirements Attributes

1047

Processing Modules

1048

Proficiency Description

1049

Requirements Attributes

1050

Job Evaluation Results

1051

Survey Results

1060

Business Event Demand

1061

Web Link

1062

Knowledge Link

1063

Info business event grp

1070

Application area

1201

WF Object Method

1205

WF Workflow Definition

1206

WF Work Item Text

1207

Customer Task,replaces TS

1208

SAP Organizational Object

1209

Cost Data

1210

WF Container Definition

1211

WF Container Texts

1212

WF Event Binding

1213

WF Role Binding

1214

WF Other Binding

1216

Function Area Assigned

1217

Classification/Lock Ind.

1218

WF Def. Responsibility

1220

Activity Profiles

1221

Excluded Activities

1222

General Attribute Maint.

1240

Existence Dependency

1250

Prof.Gen.: Authorizations

1251

Prof.Gen.: Specifications

1252

Profile Gen.: Org. Levels

1253

Profile Gen.: Variants

1254

User Variables/Activ.Grps

1260

CIC Profile

1270

CO Group assignment

1403

Exposure: LTA

1404

Exposure: Task

1500

BS element management

1501

Pay scale valuation

1502

Allowance valuation

1503

Service type/category

1504

Budget Updates

1505

Budgeting Rule

1506

Reclassification rule

1507

Teaching hours

1516

Funding Status

1517

Excel Communication

1518

Assignment FM designation

1519

Integration FM

1520

Original budget

1600

Organizer ID (F)

1601

Statutory Specifications

1610

US Job Attributes

1612

WC State and Code

1613

WC State, Code, Attribute

1620

Job Attributes (D)

1630

NQF Unit standard

1631

NQF Qualifications

1632

NQF Outcomes

1633

Equity Attributes (ZA)

1650

Grade (FR)

1651

Grades (BE)

1652

Occupational Categories

How to write a description to an object i.e. we have to maintain the infotypes:

1. Select the object to which you are going to write the description, Shift +F4
Here I am selecting

Shift +F4

Select description option.

And click on
Write the description like

You might also like