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?