4
Author: Jayanthi Jayaraman Submitted: 02.01.2009 Related Links: IMG Activity Documentation http://it.toolbox.com/wiki/index.php/Dynamic_Action#Dynamic_Actions Applies to: SAP ECC 6.0 ABAP Summary This tutorial will explain how to Configure Dynamic Action. This is being explained by illustrating the below two scenarios. 1) Default the Pay scale Type, Area and Group based on the Employee group and subgroup. 2) Default the Valid Until field in Contract Elements Infotype based on the hiring date. Prerequisite The action needs to be identified for which dynamic action is to be configured. Here for the action 'Test Hiring', we are going to configure the dynamic action. Make sure that the Hiring Action is properly configured in infogroup. Ensure that Personnel Action types are configured for the action (It should mention infogroup name). Infogroup: Go to SPRO>Personnel Management>Personnel Administration>Customizing Procedures>Actions>Define Infogroups for infogroup configuration. Personnel Action Types: Go to SPRO>Personnel Management>Personnel Administration>Customizing Procedures>Actions>Set up Personnel Actions (choose Personnel Action Types) About Dynamic Action Go to SPRO>Personnel Management>Personnel Administration>Customizing Procedures>Dynamic Actions.Dynamic Action is used to control the action in infotypes dynamically based on some condition.The dynamic action can be performed when creating/changing/deleting records in infotypes.T588Z is the table which holds all the information about dynamic actions. The table structure itself explains about the field in dynamic action. INFTY First field which specifies the infotype should be responsible to trigger the action. SUBTY Respective subtype of the infotype. This is optional. FNAME Name of the field in the infotype. This is again not mandatory.

Dynamic Actions Tutorial

Embed Size (px)

DESCRIPTION

SAP HR Dynamic Actions Tutorial

Citation preview

Page 1: Dynamic Actions Tutorial

 

Author: Jayanthi JayaramanSubmitted: 02.01.2009Related Links:

IMG Activity Documentation

http://it.toolbox.com/wiki/index.php/Dynamic_Action#Dynamic_Actions

Applies to:SAP ECC 6.0 ­ ABAP

SummaryThis tutorial will explain how to Configure Dynamic Action. This is being explained by illustrating the below two scenarios. 

1) Default the Pay scale Type, Area and Group based on the Employee group and subgroup.

2) Default the Valid Until field in Contract Elements Infotype based on the hiring date.

PrerequisiteThe action needs to be identified for which dynamic action is to be configured. Here for the action 'Test Hiring', we are going to configure thedynamic action. Make sure that the Hiring Action is properly configured in infogroup. Ensure that Personnel Action types are configured forthe action (It should mention infogroup name).

Infogroup: Go to SPRO­>Personnel Management­>Personnel Administration­>Customizing Procedures­>Actions­>Define Infogroups forinfogroup configuration.

Personnel Action Types: Go to SPRO­>Personnel Management­>Personnel Administration­>Customizing Procedures­>Actions­>Set upPersonnel Actions (choose Personnel Action Types)

About Dynamic ActionGo to SPRO­>Personnel Management­>Personnel Administration­>Customizing Procedures­>Dynamic Actions.Dynamic Action is used tocontrol the action in infotypes dynamically based on some condition.The dynamic action can be performed when creating/changing/deletingrecords in infotypes.T588Z is the table which holds all the information about dynamic actions.  

 

 

 

 

 

 

The table structure itself explains about the field in dynamic action.

INFTY ­ First field which specifies the infotype should be responsible to trigger the action.

SUBTY ­ Respective subtype of the infotype. This is optional.

FNAME­ Name of the field in the infotype. This is again not mandatory.

Page 2: Dynamic Actions Tutorial

OPERA­ Name of the operation performed in the infotype. That is entry in this field will execute the Dynamic action when that operation isperformed to the infotype in action.Ex: when a record is created in IT0001, do this action.

The possible values are:

00 for Independent of the current function carried out02 for Change04 for Create06 for Change and create08 for Delete10 for Change and delete12 for Create and delete

SEQNO: This field specifies the sequence number.

KENNZ: This field specifies about the nature of the action to be performed.

The value can be:

P ­ Plausibility Check ­ This is used for checking a condition. Operators <, >, <=, >=, = and <> can be used. Consecutive checks mustbe linked by a logical AND. Logical OR links must also be indicated by a /X. Note that all checks with OR links must have a /X.I ­ 'I' is used to maintain Infotype. Maintenance includes actions INS, COP, MOD and DEL.W­ Using 'W', default values can be set for the infotype field. 'Q' values cannot be defaulted because values for these fields are derivedfrom the corresponding P fields.V­ Cross­reference to another step. Using 'V", we can combine fields to groups. The variable function part contains the value in the fieldwhich follows the "field" column.F­ TO call external or internal subroutine.M­ Sending mailAny other entries refer to "comment line".VINFO ­ This field is used to brief the exact action. 

Configuring Dynamic ActionScenario 1:To default the Pay scale Type, Area and Group based on the Employee group and subgroup. We need this to be done after OrganizationalAssignment changes. We are going to default the Pay Scale Type and Area as 'AB' and Group as 'TEST1234' in infotype 0008. We aredoing to this only if the employee group is '0' and employee subgroup is either 'AB' or '11'.

 

ITYPE STY FIELDN FC NO S Variable function part

0001     04 90 P P0001­PERSG = '0'

0001     04 91 P P0001­PERSK = 'AB'/X

0001     04 92 P P0001­PERSK='11'/X

0001     04 95 I INS,0008

0001     04 98 W P0008­TRFGR='TEST1234'

0001     04 99 W P0008­TRFAR='AB'

 0001     04  100  W  P0008­TRFGB='AB' 

Infotype is 0001.Here specifying the subtype and field name is not required.This will happen when the record is created in 0001.So we haveused '04' for operation.We need to mention the sequential numbers without contrary to the existing numbers.We have used the nature of

Page 3: Dynamic Actions Tutorial

action as 'P' for the first three lines to specify conditions.We have used /X to specify the OR condition.First line specifies the employeegroup should be equal to '0'. Second line and Third line specifies the employee subgroup should be either equal to 'AB' or '11'. We haveused 'I' in fourth line to maintain infotype operation. Insertion will be done for infotype 8.In the rest of the lines, we are specifying the defaultvalues to be set for the fields in the infotype. 

Scenario 2:To default the Valid Until field in Contract Elements Infotype based on the begin date of Organizational assignment by using a subroutinefrom a program.

  

Create a program zzz_jay(as specified in dynamic action) with subroutine GETDATE.Write the following code in the program.

RP50D is the structure which is meant for HR: Return Fields for Dynamic Actions.

In the program, we are going to add 365 days to the hiring date and populating it as default for Valid Until field in infotype 0016.

First line in Dynamic Action specifies that Subroutine getdate is called in program zzz_jay.

Second line is used to maintain(Insert a record) in infotype 0016.

Third line is defaulting the value for the field Valid Until from the program calculation. 

OutputExecute the Test Hiring Action from PA40. 

 

Pay Scale Type, Area and Group is defaulted in Infotype 8. Valid Until is defaulted in Contract Elements. 

Page 4: Dynamic Actions Tutorial