Quantcast
Channel: SCN : Blog List - SAP ERP Human Capital Management (SAP ERP HCM)
Viewing all articles
Browse latest Browse all 889

Dynamic Actions

$
0
0

Dynamic actions

Dynamic actions are really useful in SAP and allow you to automate certain activities between different infotypes. For example, when one infotype is created, another unrelated infotype can be automatically created at the same time and values can be pre-populated from another infotype.

 

1.jpg

An example of this is that when a maternity absence is created in infotype 2001 the SMP master record in infotype 0088 can also be created without the user having to manually create the infotype 0088 record separately.

Access to the set-up of Dynamic actions is via the IMG in a number of different application areas – search for the text Dynamic Actions. In addition you can modify the table T588Z using the transaction code SM30 for table maintenance.

Each separate process of the dynamic action is held on a separate line number and has an operation specified for that line e.g. check conditions, maintain an infotype, set the value of field(s) within an infotype etc.

 

 

General Tips and Tricks

Always place a comment at the start of the dynamic action to identify it. A comment should have no value in the Indicator column and should start with an * in the Variable Function part. This makes it far easier to find a specific dynamic action in the table. This tip will make sense once you have configured many dynamic actions for the same infotype. It can be quite difficult to spot a particular dynamic action amongst the many similar ones. This also gives you an idea of what it is supposed to do when you come back to modify it in 6 months time.

If you want to edit the whole of the dynamic action table – use table T588Z in table maintenance. Use this when you start the configuration for the dynamic action and you need to view other examples of dynamic actions against other infotypes.

If you wish to edit a dynamic action for a specific infotype, you can use the view V_T588Z. Once you click on the “maintain” button, you are asked to enter the infotype you wish to use. This then restricts the number of entries to that infotype only.
You may need to find an example of a similar dynamic action and would like to search through the whole table. On certain versions of SAP, the “find” and “find next” buttons are grayed out. A simple work around is to click on the print icon and this then takes you to an overview screen of the dynamic actions table. You will now be able to make use of the “find” and “find next” buttons. Once you have found the relevant piece that you wish to copy, just make a note of it or copy it onto the clipboard and click on the green “back” arrow to be taken back to the maintain table screen.

If you wish to select a piece of text in SAP, it is often not possible if you are not in a particular field or table view. Use the Ctrl + Y buttons to highlight a piece of text which you can then copy onto the clip board.

When you first start configuring your dynamic action – you may find that it doesn’t work 100% – this is quite common. If the dynamic action is not being called at all, then simply comment out your plausibility checks. Once you have the dynamic action correctly bringing up the infotype screen, then you can take off the comments and turn the plausibility checks back on – one at a time. You will then get a better idea as to where it is failing.
In addition if your dynamic action is to work during an action, then don’t put on the TCODE = ‘PA40’ plausibility check until you are happy that it is working to your satisfaction – otherwise you could be creating a lot of new starters. Just have the dynamic action set to transaction code PA30 and once you have it working, change the transaction code to PA40. This will save you a lot of time.

It is important to provide gaps in the numbering between different dynamic actions. A gap of 10 lines is the minimum you should have between dynamic actions. Remember this is not MS Excel where you can just easily insert a row. All of the rows in a dynamic action table are numbered and it is a real pain to insert rows. It is good practice to leave bigger gaps if you can. Use even or odd numbers for your lines of configuration. Even better use every 3rd line. This allows you to insert the odd line or 2 without having to laboriously copy and move all the lines of the dynamic action, which can be a bit of a pain.

If you want the dynamic action to look at multiple values for the same field on a plausibility check, make use of the “/X” at the end of each line for all of the values.
You may wish the dynamic action to take place in the background and not be visible to the user. It is good practice to only put the “/D” in at the very end once you have thoroughly tested your dynamic action and are happy that it works 100%.

Remember that if you find that your dynamic action is not meeting your requirements, you can always get your dynamic action to call a user program which will be far more flexible than the functionality offered by standard dynamic actions.

If you are writing away values for infotype 0000 Actions then you need to use P0000-xxxx. This is unlikely to happen often as infotype 0000 is always saved first and will in most cases be used to set off other dynamic actions.

If you want to check a certain action type or action reason, then use the field PSPAR-MASSN (action type) and PSPAR-MASSG (action reason).

 

Open the view in maintenance mode (SM30). A new popup will come for Infotype. Pass the Infotype for which you want to maintain the Dynamic Action. I am taking example for a custom Infotype 9800.Press Enter.

Now maintenance screen will open for view V_T588Z. Click on New Entries.

 

2.jpg

Field contains below 6 columns:


  1. 1. Sty: This column is to maintain Dynamic Action for Specific Subtype. If user need to execute the Dynamic Actions based on specific Subtype then this column need to be filled else it can be blank.

  1. 2. Field Name: Column to specify field name, if require to process Dynamic Actions.

  1. 3. Function Character of step (FC): This column is important part of Dynamic Actions. It’s specified on which action (Create/Change/Delete), dynamic action need to be called.

This column required to fill with two digit of below numbers as per the requirements.

00 - An action is carried out irrespective of whether specified Infotype was created/ Changed/ deleted.

02 – For Change

04 – For Create

06 – For Change and Create

08 – For Delete

10 – For Change and Delete

12 – For Create and Delete

  1. 4. Sequence Number: To determine the sequence of each step

  1. 5. Indicator of Step: Below are the available indicators.

P– Check conditions

I– Maintain infotype record

W– Set default values when creating a new record

V– Reference to another step

F– Call routine

M– Send mail

  1. 6. Variable Function part: Another important column which contains the steps and definition on the based of previous column‘Indicator of Step’.

If maintained Indicator of Step Column as ‘P’ Plausibility checks

Here you can enter values for infotype field to check the condition before proceeding the next step. Infotype field values are available in PSAVE structure.

 

For example to check the Employee Status maintained as below:

Infotype         Field …..                     Ind.                  Variable function part

0007               STAT3                         P                       P0007-STAT3=’0′

If maintained Indicator of Step Column as ‘I’ Maintain Infotype record

To create/Change/Delete another infotype ,Enter the step, infotype, subtype, object ID, start and end dates of the record and an indicator which defines whether the step is to be run in the background.

Separate the indicator for suppressing dialog from other entries by a slash D (/D).

9800….  I          INS,6,,,(P9800-BEGDA),(P9800-ENDDA)

 

Step: Create a Infotype record (0006) without subtype and object ID. The start and end dates are the same as those in the current Infotype (9800); specify these two fields only if they are filled because the dynamic action was triggered by this Infotype.

If maintained Indicator of Step Column as ‘W’ Default values for new record

This step used to default the variable values for new Infotype.

Set the defaults for the Infotype, subtype, object ID, start and end dates using an ‘I’ step and not a ‘W’ step.

Do not set defaults for Q fields of an Infotype because the values for these fields are derived from the corresponding P fields.

Examples

Infotype                Subtype …..              FC Ind.         Variable function part

0021                            2                      04              I               INS,0015,M430

0021                            2                      04              W             P0015-BETRG=’10000′

When a Family/Related Person record (0021) record with subtype 2 (child) is created, an Additional Payments record (0015) with a default amount of 100.00 is created.

If maintained Indicator of Step Column as ‘V’ Cross-reference to another step

Here, you can combine fields to groups. The variable function part contains the value in the field which follows the “field” column. Steps which are specified only for the following field are also triggered for each of the other fields.

Examples

Infotype                      Field                       FC           Ind. Variable function part

0016                          PRBZH                    06             V         PRBZT

0016                          PRBZT                    06             I           DEL,0019,01/D

Infotype 0019, subtype 01 is deleted in the background when the field PRBZT or PRBZH in infotype 0016 is changed or created (function code 06).

If maintained Indicator of Step Column as ‘F’ Call a routine.

Sometimes user wants to do some complex validations before processing the Dynamic action which cannot be easily maintained in V_T588Z. IN that case, developer can developed a ABAP programs in a routine and called the routine in Dynamic Actions.

Below is the syntax to call the routine,

Infotyp …..                     Ind.                   Var.                  function part

0001                             F                                              GET_DATE(ZPUDYN01)

GET_Date is the routine name in ABAP program ZPUDYN01.

If maintained Indicator of Step Column as ‘M’ – Send a mail

Enter the name of the feature which defines the characteristics of the mail.

Example

Infotype                         Field …..           Ind.                   Var.                  function part

0001                             SACHP                                     M                     M0001

A mail is sent when the field SACHP is changed. The characteristics of the mail are defined in feature M0001

Let’s take a scenario, whenever user Create or Change Infotype 9800, Infotype 6 need to be created. So maintain entries in V_T588Z as below.

 

3.jpg

Now create a new record for IT9800. Now as you press save, dynamic action will be triggered and a new window will open to maintained Infotype 0006.

You can restrict the Infotype creation on the basis of Subtype and also suppress the dialog by executing it in background using ‘/D’.

(let’s say, in our example: INS,6,,,(P9800-BEGDA),(P9800-ENDDA)/D ).



Viewing all articles
Browse latest Browse all 889

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>