This website is not affiliated with, sponsored by, or approved by SAP AG.

Problem with setting up a dynamic action

Human Resources (PM, OM, PA, TM ,PD)

Moderators: Snowy, thx4allthefish, muhnkee_2

Problem with setting up a dynamic action

Postby DeathAndPain » Wed Jan 29, 2014 9:40 am

Hello everyone,

I am having trouble with a P-clause in a dynamic action.

I am trying to create an infotype 19 whenever an infotype 2001 (absences) is created whose duration P2001-KALTG exceeds 3 days. Here is what I have tried:
Code: Select all
2001   0210      02   87   P   P2001-KALTG>'3'
2001   0210      02   88   P   T001P-WERKS='Z001'
2001   0210      02   90   F   IT19_Z6_VORSCHLAGSDATUM_ERZEUG(ZHR_IT2001_DYN_MASSN)
2001   0210      04   70   I   INS,0019,Z6,,(P2001-BEGDA)

Unfortunately, the very first comparison P2001-KALTG>'3' does not seem to work. I have tried with and without single quotes, but there is no difference.

My theory is that this is because P2001-KALTG is a decimal value. It seems that operands in dynamic actions, including the "greater than" operand I used here, can only deal with character-type values. In my above code the condition P2001-KALTG>'3' (with or without single quotes around the 3) always evaluates to true; the dynamic action is always executed, even if P2001-KALTG is 1 or 2 (1.00 or 2.00 to be precise).

The program IT19_Z6_VORSCHLAGSDATUM_ERZEUG(ZHR_IT2001_DYN_MASSN) was written by me, so I am having an easy time placing a break point there and seeing that P2001-KALTG = 2.00 (meaning that based on the above dynamics action-logics, my program should not have been started in the first place).

Is there any way to solve this?
Image
DeathAndPain
 
Posts: 85
Joined: Wed Oct 06, 2004 12:49 am

Re: Problem with setting up a dynamic action

Postby DeathAndPain » Mon Feb 03, 2014 12:21 pm

Thx for nothing; I eventually found the solution myself. The comparison works when I change P2001-KALTG>'3' into P2001-KALTG>'3.00', seeing that P2001-KALTG is a decimal field with two decimal places.
Image
DeathAndPain
 
Posts: 85
Joined: Wed Oct 06, 2004 12:49 am


Return to Human Resources

Who is online

Users browsing this forum: No registered users and 3 guests





This website is not affiliated with, sponsored by, or approved by SAP AG.