cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic actions

Former Member
0 Kudos
127

Dear Experts,

I am facing the following problem concerning dynamic actions.

Requirement: Defaulting WTs 2023 and 2037 upon hiring in IT0014.

I've tried doing this through dynamic action based on the creation of IT0001 which is part of the hiring action. So I created a dynamic action that is triggered after the creation of IT0001 to add those wage types in the background. But If during the hiring action I got back to IT0001, changed something and saved data, the dynamic action for creating wage types is triggered once again. But this time with no default values (as per the dynamic action illustrated below).

I need to write the dynamic action in a way so such an error won't appear.

Here the code to the dynamic action I'm creating (IT0001).

04 10 **Labor Allowance**

04 15 P PSPAR-TCLAS='A'

04 20 P T001P-MOLGA='99'

04 25 P P0001-PERSG='1'/X

04 30 P P0001-PERSG='2'/X

04 35 P P0001-PERSG='4'/X

04 40 P P0000-MASSN='Z1'

04 45 I INS,0014,2023/D

04 50 W P0014-BETRG='1000'

04 55 W P0014-BEGDA=P0001-BEGDA

04 60 P P0001-PERSK='10'/X

04 65 P P0001-PERSK='11'/X

04 70 P P0001-PERSK='17'/X

04 75 P P0000-MASSN='Z1'

04 80 I INS,0014,2023/D

04 85 W P0014-BETRG='1000'

04 90 W P0014-BEGDA=P0001-BEGDA

and a similar dynamic action is created to the other wage type.

Your help would be highly appreciated.

Regards,

View Entire Topic
antoine_foucault
Active Contributor
0 Kudos

How about MOD action instead of INS?

Former Member
0 Kudos

What if there is no existing record? Would it insert a new one in this case?

Regards,

antoine_foucault
Active Contributor
0 Kudos

How about you test it in your system? does not sounds too much time consuming.

All possible infotype operations

COP Copy

DEL Delete

DIS Display

EDQ Lock/unlock

INS Create

LIS9 Delimit

MOD Change

INSS Create for Actions is not converted to Change

ACTIO field help offer the following information:

When you create infotype records while processing actions, the system checks if an infotype with the same subtype already exists. If it does, the system switches from "Create" to "Change". It only makes sense to use the Create (INS) operation for the initial entry action. For all other actions, use the Copy(COP) operation. When you use the copy operation, the system proposes the start date of existing action records. If no records exist for the infotype, the system automatically switches to Create.

Dynamic actions are interpreted by subroutine dyn_measure in include MPPERS00, I type record in T588Z will populate internal table dynmeas which later is processed in subroutines refresh_infogr_from_dynmeas. This last subroutines is responsible for translating dynamic measure from dyn_meas table to infogr internal table... So basically dynamic measure will behave very similarly any action configured in T588D.

I guess if INS does not work for you, then try MOD or COP or INSS.

One idea : If your wage is configured to only exist once in V_T512Z then maybe COP will overwrite the existing records since you copy it for the same begda endda...

Another idea: You can try DEL first and INS then... another good option can be first DEL to delete the existing records then INS to insert a new one... you can't delete a record that doesnot exit, right? If any combination won't work out then your left with calling a rountine within dynamic measure and program code as needed.

Good luck and please post-back succesful option!

Former Member
0 Kudos

Hello,

I've tried the copy option and that worked for me.

I've tested it and no problems appeared so far.

Thanks a lot for your valuable contributions.

Regards,