Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Dynamic Actions - Multiple Scenarios

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7
At a glance
Powered by AI
The key takeaways are that dynamic actions allow activities to be triggered automatically by SAP R/3 during infotype maintenance. They are configured using table V_T588Z and can be used for various purposes like sending emails or deleting related records.

The components of a dynamic action are the infotype number, subtype, field name, function, sequence number, and step. The step specifies the type of action like plausibility checks or calling other infotypes.

Examples provided configure dynamic actions to send an email when basic pay is changed, create allowance records under certain conditions, and delete related records when one is deleted.

The Power of Dynamic Actions

Tips and Tricks to Get Best Results.


Brief Technical Background:
Dynamic actions are activities triggered automatically by SAP R/3 during infotype
maintenance.
The database table T588Z is a set of records that stores information related to dynamic actions.
The module pool MPNNNN00 (where NNNN is the Infotype number) of all infotypes includes
the standard program MPPERS00. The program MPPERS00 contains routines for calling
dynamic action functionality. Each time you press the save button on the maintenance screen
of an infotype, the PAI (process after input) section of the screen calls these routines. This is to
check the table T588Z for starting any dynamic action relevant to the current infotype.
The maintenance of dynamic actions is done via the view V_T588Z, as shown in Figure 1
(SAP HR 5.0) (IMG menu path Personnel Management>Personnel Administration
>Customizing procedure >Dynamic Actions).

Figure 1: The path to configure Dynamic action.


The table V_T588Z can also be accessed through the transaction SM30 as shown in the
Figure 2.

.
Figure 2: Maintain Table V_T588Z through transaction SM30.

Figure 3. Maintenance screen for dynamic actions.

Components of a Dynamic Action:


A dynamic action has the following components.

Infotype Number (INFTY): specifies the infotype for which you want the dynamic
action triggered

Subtype (SUBTY): narrows the focus to a specific subtype

Field Name (FIELDN): starts your action when a maintenance function is performed
on a particular field

Function (FC): specifies the various maintenance operations to which your dynamic
action would respond. They are 02 (change); 04 (create); 06 (create and change); 08
(delete); 10 (change and delete); 12 (create and delete). Dynamic actions are only
applicable in maintenance operations, not in display functions.

Sequence Number (NO): refers to a sequential number.

Step (A): specifies a particular type of action. No dynamic action is executed if the
function character has a value other than one of the following:
P: Plausibility checks, which allow you to check certain conditions.
I: Calls an infotype for processing
W: Called after the I statement and used to assign values to screen fields while
creating or copying another infotype record through the I statement
V: Lets you treat collectively a number of fields for which you want to define a
common dynamic action
F: Calls a FORM routine (subroutines in ABAP) during your action. The
routine may reside in or out the module pool MPNNNN00
M: Sends SAP Office mail

Variable function part: The variable function part along with the step indicator
forms the core part of your action. It specifies the processing details when the
dynamic action is triggered.

****************************************************************************

Example 1:
Requirement: When there is a change in Basic pay infotype 0008 for country Ireland, an email
should be sent to the administrator.
For this requirement table V_T588Z is configured as follows.

The first line 0 is a comment.


The next four lines are for checking conditions like user name, transaction class, country
grouping and sub type.
Is T526-USRID not equal to SYST-UNAME?
Is PSPAR-TCLAS equals to A?
Is T001P-MOLGA equal to 11?
Is P0008-SUBTY equals to 0?
The statement on line 1 checks for Administrators userid and it should not match with log on
user id. I,e dynamic action will not work for those who are having userids in the table T526.
The statement on line 2 checks for the transaction class A.
The statement on line 3 is for checking the country Ireland. So this will work only for country
Ireland.
The statement on line 4 is for subtype 0 Basic contract.
When a record is created or changed in infotype 0008 with all the conditions mentioned , an
email is sent using the feature M0008. Information such as the recipient address, subject, and
content of the mail is derived from M0008.

****************************************************************************

Example 2:
Requirement: For country Austria (Country code =3), when the city ( Field ORT01) of an
employees permanent residence is changed in infotype 0006, an entry in Infotype 0367 and
subtype 6 should be modified with the same beginning date and End date as in Infotype 0006.
For this requirement table V_T588Z is configured as follows.

The statement on line 70 is used as a comment.


The statement on line 71 is used to check the transaction class. Dynamic action will not work
for Transaction class B.
The statement on line 72 is for country Austria.
The statement on line 73 is for checking address record type. permanent residence.
The statement on line 74 is for checking Transaction code. I,e Dynamic action will not work
for Transaction code PA40.
If all the above condition met then dynamic action insert an entry in Infotype 0367 and subtype
6 with the same beginning date and End date as in Infotype 0006. The last statement is
assigning a value in one of the field in Infotype 0367.
****************************************************************************
Example 3:
Requirement: You want to create allowance 2001 in infotype 0014 with the creation of Basic
Pay - 0008 for employees belonging to Personnel Sub-area SUB1 and having either Grade 1 or
Grade 2. The Allowance 2001 must be created in online mode.
For this requirement table V_T588Z is configured as follows.

The lines 001-003 formulate the condition for the action (note the OR logic achieved by /X).
The insertion lines 004, 005, and 006 are executed only when the conditions mentioned are
true.
****************************************************************************

Example 4:
Requirement: On successful deletion of an infotype 0015 record having subtype 1234, all
records with subtype 1235 and 1236 should be deleted automatically.
For this requirement table V_T588Z is configured as follows.

The first two lines check that the record being deleted belongs to country grouping
international (code 99) and that the wage type is 1234. If this is found true, the two delete
statements are fired, each deleting all the records having wage type 1235 and 1236.
If you are puzzled about how many dynamic actions exist for a particular set of lines in table
T588Z, follow a simple rule: Each I, F, and M statement is a separate dynamic action.
In the following example, two dynamic actions are executed for the same combination of
SUBTYP,FIELD/FUNCTION. One action creates infotype 0041 if the reason is 01 and
another action creates infotype 8 if the reason is 02.

****************************************************************************
Example 5:
Requirement: Let's look at an example of an action. These statements check the country
grouping and the action type. If these match the desired criteria, a record is inserted in infotype
41 having date types U1 and U2.
For this requirement table V_T588Z is configured as follows.

When you create a new record (04) in infotype 0000, this dynamic action checks the following
conditions:
Is T001P-MOLGA equal to 99?
Is PSPAR-MASSN equal to 01?
If both conditions specified by the P statements are found to be true, then a new record is
created in infotype 41 in background mode. The values specified by the W statements are also
assigned to the corresponding screen fields of infotype 0041. If the condition defined by the P
statement is not filled, the system skips the subsequent commands until it reaches a new
plausibility check or F statement.
****************************************************************************

External Factors That May Cause Dynamic Actions to Fail.


Even if you have strictly followed the guidelines, you may still have problems with the
execution of your action. This is because your dynamic action is dependent on numerous
external factors. Let's consider a few:

You may encounter problems assigning values to fields having the form QNNNNFIELDNAME. These are fields that are visible on the infotype screen Examples are
Q0082-datwc and Q0112-PZIN3. There lies a chance that these fields are overwritten
by values computed during the PBO and PAI modules of the infotype screen. For this
reason, assigning values to these fields in W statements may or may not have any
practical effect. However, you can use them in your P statements.

You may experience problems when your dynamic action calls an infotype that has its
own dynamic action written. When the second infotype is called and the user presses
the save button, the dynamic action of the second infotype runs. It may be a problem if
the second dynamic action calls a FORM routine that takes you to an undesirable
screen for the first one.

Dynamic actions are turned off during the execution of batch input sessions. This is a
standard behavior. Any updates that happen via dynamic actions in online mode must
be explicitly included in the BDC session.

********************************************* End **************************************************************

You might also like