cancel
Showing results for 
Search instead for 
Did you mean: 

Setting date type value in Dynamic action

Former Member
0 Kudos

I have a dynamic action triggered of the Action infotype 0000. The dynamic action copies the date specifications infotype 0041. I wish to set a date type value to be 1 day less than the begin date on action record. I am trying to do this as follows

W P0041-DAR02='42'

W P0041-DAT02=(P0000-BEGDA)-1

the value (P0000-BEGDA)-1 does not set the dat02 value to 1 day less than the P0000-BEGDA.

How do I code the setting of the date to be 1 day less than P0000-BEGDA?

Accepted Solutions (0)

Answers (1)

Answers (1)

marksullivan
Explorer
0 Kudos

Maybe enclosing the calculation within the brackets will work:

P0041-DAT02 = (P0000-BEGDA - 1)

Former Member
0 Kudos

No, (P0000-BEGDA-1) does not work

Former Member
0 Kudos

Do you get any error or what date do you get?

Former Member
0 Kudos

Well currently I have a user exit on IT0041 that is ensuring the last day worked is = term action begda -1 so the error gets triggered so I do not see the value

Former Member
0 Kudos

Well currently I have a user exit on IT0041 that is ensuring the last day worked is = term action begda -1 so the error gets triggered so I do not see the value

Former Member
0 Kudos

You may like to try something like this:

GEN_DATES(ZDYNMS)

MOD,0041,,,(P0000-BEGDA),(P0000-ENDDA)/D

P0041-DAR12='36'

P0041-DAT12=RP50D-DATE1

where ZDYNMS is a report where-in you say:

form gen_dates.

rp50d-date1 = pspar-begda - 1.

endform.

Let me know if this helps,

Thanks,

Former Member
0 Kudos

I was hoping I could do it without having to using a function.

Can you provide the exact coding for the report program. I am referring to p0000-begda but it is not recognized. I need to know how to pass it in

Former Member
0 Kudos

I had to write a function

Action:

P P0000-MASSN='Z7'

F GET_LDW(ZHR_GETLDW)

I COP,0041,,,(P0000-BEGDA),(P0000-ENDDA)/D

W P0041-DAR02='42'

W P0041-DAT02=RP50D-DATE1

Program

*& Report ZHR_GETLDW

*&

&----


*&

*&

&----


REPORT zhr_getldw.

TABLES: rp50d. "HR: Return Fields for Dynamic Actions

TABLES: p0000.

&----


*& Form GET_LDW

&----


  • get last date worked, ldw is p0001-begda minus 1

----


FORM get_ldw.

DATA: ldw TYPE d. "Last day worked

CLEAR: rp50d-date1, rp50d-date1.

  • Get a day prior to action (P0001-BEGDA is date of action)

CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'

EXPORTING

date = p0000-begda

days = '1'

months = '00'

signum = '-'

years = '00'

IMPORTING

calc_date = ldw.

MOVE ldw TO rp50d-date1.