Selection View
Selection View
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.
Enhances report by including selection options not included in the standard selection screen of Logical Databases
"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:
Step 3:
Enter the table names whose fields need to be used in the selection view to be created.
Press Enter.
Step 4: The below screen is displayed.
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.
Choose the report category which you are using for your report. By Default it is blank.
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.
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.
Management->Personnel Administration->Tools->Revision->Set up
change document
Below popup window will be displayed, double click on HR documents: Infotypes to be logged
Now Save the table entries and go back to HR documents: Field group definition as mentioned in below screen
shot
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
Step1.
Step2 Click on Store and Assign the below screen will appear. Then click create.
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:-
STEP 7:
Enter Personnel number and info type. Click on Enter button.
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.
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
Click on components push button and double click on function exit EXIT_SAPFP50M_002
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.
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:
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.
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.
IN this screen, you can add the fields which you want to have on your LDB Screen. For example:
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.
icon and then suggest values, and then save and generate the
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
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 :
Create (F5).
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.
create (F5).
Current entry makes sure that the record is active and value would be look like below.
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.
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.
And execute it .This will create a text file on your system, which will contain all the results.
How to delete previous runs results:
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
5. It Prompts for Main program and Includes .Click on Suggest Values it will propose Main program and Includes.
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.
All Attributes are explained in SAP Documentation (give F1 in any checkbox for Documentation).
Click on icon
We can filter filed values. Place the cursor on filed and click on Filter.
After filtering, find filter symbol for the field like below.
Find the icon for the field after Constante value conversion is defined.
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.
Program name and form routine should defined before itself. Logic in the form is dependent on requirement.
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.
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.
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
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.
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.
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.
From the initial screen, Select Decision Tree option and click on change
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.
Select the Personnel Sub Area value, Select Return Value Radio button, Select value from Employee Group.
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.
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.
Enter the Personnel Number in the selection screen whose Company code, Personnel area and Personnel sub area
satisfies the requirements mentioned in the FEATURE.
The company code (BUKRS), personnel area (WERKS), personnel subarea (BTRTL)
Values match the requirement mentioned in the Decision Tree.
DE
77
12345678
1234567890
Country Code
Check Digit
Bank Number
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.
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.
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.
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.
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.
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.
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.
There are two ways to write our code for the newly created Function.
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 )------------------------------------------------------$*$*
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.
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 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.
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.
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'.
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:
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:
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.
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.
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
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
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:
We see one Enhancement Spot line no 2534, where we write the code to retrieve the required HRA/CLA exemption
logic.
*-->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.
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
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.
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
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:
Activating HR forms
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
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:
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.
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.
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 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.
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
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:
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.
Use the following Function Modules and Methods to define the custom container on Selection
Screen
Set Position of Photo by passing values of Height, Width, Top and Left using method SET_POSITION of Class
CL_GUI_PICTURE.
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.
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
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.
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
*
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.
= 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
Infotypes with buttons and huge data fields stored in cluster tables
By Ribhu Ahuja, Tata Consultancy Services
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.
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.
Click on New Entries Button. We see the Details of added entries Screen.
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.
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.
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.
*
*
MODULE HIDDEN_DATA.
*
PROCESS AFTER INPUT.
*---------------------------------------------------------------------*
* process exit commands
*---------------------------------------------------------------------*
MODULE EXIT AT EXIT-COMMAND.
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
*
*
check and mark if there was any input: all fields that
*---------------------------------------------------------------------*
CHAIN.
FIELD P9080-BEGDA.
FIELD P9080-ENDDA.
FIELD P9080-ZZKEY1.
FIELD P9080-ZZDATE.
FIELD P9080-ZTYPEOFEXIT.
MODULE INPUT_STATUS ON CHAIN-REQUEST.
ENDCHAIN.
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
MODULE PRE_INPUT_CHECKS.
*---------------------------------------------------------------------*
*
input-checks:
*---------------------------------------------------------------------*
* insert check modules here:
* ...
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
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.
*
MODULE BEFORE_OUTPUT.
CALL SUBSCREEN subscreen_empl INCLUDING empl_prog empl_dynnr.
CALL SUBSCREEN subscreen_header INCLUDING header_prog header_dynnr.
*
*
MODULE HIDDEN_DATA.
*
PROCESS AFTER INPUT.
*---------------------------------------------------------------------*
* process exit commands
*---------------------------------------------------------------------*
MODULE EXIT AT EXIT-COMMAND.
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
*
*
check and mark if there was any input: all fields that
*---------------------------------------------------------------------*
CHAIN.
FIELD P9080-BEGDA.
FIELD P9080-ENDDA.
*
FIELD P9080-ZTYPEOFEXIT.
MODULE INPUT_STATUS ON CHAIN-REQUEST.
ENDCHAIN.
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
MODULE PRE_INPUT_CHECKS.
*---------------------------------------------------------------------*
*
input-checks:
*---------------------------------------------------------------------*
* insert check modules here:
* ...
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CHAIN.
FIELD P9080-BEGDA.
FIELD P9080-ENDDA.
FIELD RP50M-SPRTX.
*
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.
INCLUDE MPPERS00.
- Do not change
- Do not change
INCLUDE MP908020.
INCLUDE MP908030.
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.
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.
*
*
MODULE HIDDEN_DATA.
*
PROCESS AFTER INPUT.
Click on the green tick mark and we are now in the PBO module ' MODULE Z9080 OUTPUT'
Give the following code there:
*----------------------------------------------------------------------*
***INCLUDE Z9080O01 .
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
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.
*&---------------------------------------------------------------------*
*&
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.
PCL3-UNAME
= SY-UNAME.
PCL3-PGMID
= SY-REPID.
PCL3-VERSN
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:
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.
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).
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).
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.
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
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.
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
Choose YES to create, it will show an information message that the info type was created.
Select the info type that you have created and double click on the time constraint
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
(for Organization)
2. Info type
:9334
Choose create--->
Click on Save.
6. Check whether data is available in the info type HRP9334 or not.
3. Click on the button HR report category to use the existing report category.
Description
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.
If the report category is _____000 (5 underscores 3 zeros no gap) No LDB selection screen is displayed. It shows
a clear screen.
_____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.
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 .
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
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.
2.
3.
4.
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
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
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.
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.
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.
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.
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.
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 the Communication Infotype IT PA0105 with a variety of Subtypes.
Communication Subtype 0001 (SAP User ID). Save the data entered.
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.
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.
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.
So in case you needed to change Credit Card data delimit the old one and then save the new data in next screen.
There was a change in Gross Average Monthly Salary Communication Subtype 0009 (Salary). Enter the new value
and SAVE.
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.
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
*&---------------------------------------------------------------------*
*&
*& 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,
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
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module STATUS_0600 output.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
endmodule.
*&---------------------------------------------------------------------*
*
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.
*&---------------------------------------------------------------------*
*&
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
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module USER_COMMAND_0600 input.
endmodule.
Create the screen 0600 for the above program and place a custom container on the same:
Also enter the attribute OK_CODE for the OK code as shown above.
Activate and execute the program:
************************************************************************
*** NAME
: Chandeep Singh
************************************************************************
REPORT ZChandeep_HR_prog_1
LINE-SIZE 200 .
****************************
*Database Table
****************************
TABLES: PERNR,
PA0001,
" Actions
PA0002.
****************************
*Infotypes
****************************
INFOTYPES: 0001,
0002.
" Actions
****************************
*Variable Declaration
****************************
DATA: FORM_NAM LIKE P0001-ENAME,
V_AGE(5) TYPE C,
VAR1(5) TYPE C .
*****************************
*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
CLEAR 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.
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
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
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).
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.
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
Applicant 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.
Simple Maintenance
2.
3.
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
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
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
019
020
Is a specialization of
Is a generalization of
021
Is equipped with
Is contained in
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
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
035
Is previous job of
Is subsequent job of
036
Is organized by
037
Designated as successor
038
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
043
Dislikes
Is dislike of
044
Consists Of
Is part of
045
Created
Was created by
046
receives
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
Is used by (attendee)
055
056
057
058
059
Employee pool
Employee pool
060
061
062
063
Capacity assignment
Equals
Requirement description
Requires
Person assignment
Equals
Requirement description
064
Requirements definition
Requirements definition
065
Planned assignment
066
067
Exclusive temp.assignment
Exclusive temp.assignment
068
No shift planning
069
Is temporarily done by
Works temporarily as
070
071
Parallel temp.assignment
Parallel temp.assignment
072
Shift planning by
077
Passes through
Is passed through by
Planned assignment
No shift planning
080
081
083
Is Key Position of
088
089
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
207
Is identical to
Is identical to
208
Is identical to
Is identical to
209
Is filled by
210
220
Belongs to
221
Is object reference of
222
Belongs organizationally
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
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
293
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
Incorporates (re-valuatn)
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
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
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
900
Manager to 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
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
Click on -
or
Again click on
Now you can see a screen, known as Staff Assignments / Change, where we can create jobs.
So Press F9
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
Press enter so that this job will transfer under position field.
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
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.
Here write abbreviation and name of the task and press enter and save so that system will assign a unique number
Press enter
Again Press enter
IT
1000
object
1001
Relationships
1002
Description
1003
Department/Staff
1004
Character
1005
Planned Compensation
1006
Restrictions
1007
Vacancy
1008
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
1027
Site-Dependent Info
1028
Address
1029
1030
Procedure
1031
1032
Mail Address
1033
Scale
1034
Name Format
1035
Schedule
1036
Costs
1037
Billing/Allocation Info
1038
External Key
1039
Shift Group
1040
1041
1042
Schedule Model
1043
1044
Results Specification
1045
1046
Valuation
Requirements Attributes
1047
Processing Modules
1048
Proficiency Description
1049
Requirements Attributes
1050
1051
Survey Results
1060
1061
Web Link
1062
Knowledge Link
1063
1070
Application area
1201
WF Object Method
1205
WF Workflow Definition
1206
1207
Customer Task,replaces TS
1208
1209
Cost Data
1210
WF Container Definition
1211
WF Container Texts
1212
WF Event Binding
1213
WF Role Binding
1214
WF Other Binding
1216
1217
Classification/Lock Ind.
1218
WF Def. Responsibility
1220
Activity Profiles
1221
Excluded Activities
1222
1240
Existence Dependency
1250
Prof.Gen.: Authorizations
1251
Prof.Gen.: Specifications
1252
1253
1254
User Variables/Activ.Grps
1260
CIC Profile
1270
CO Group assignment
1403
Exposure: LTA
1404
Exposure: Task
1500
BS element management
1501
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
1613
1620
1630
1631
NQF Qualifications
1632
NQF Outcomes
1633
1650
Grade (FR)
1651
Grades (BE)
1652
Occupational Categories
1. Select the object to which you are going to write the description, Shift +F4
Here I am selecting
Shift +F4
And click on
Write the description like