Skip to Content
0
Jul 24, 2013 at 06:33 AM

How to modify only the last object ID using dynamic actions

38 Views

My requirement is to modify the latest entry in IT0715 using dynamic actions. Since I have developed a form that feeds a pre-defined end date while modifying the record it is important for me to make sure that it picks only the last record (Object ID) in that subtype. Everything works fine until I have just one record in the subtype 'HOME'.

Problem starts when I have multiple records maintained in the IT0715, StyHOME. Becuase my 'MOD' operation starts pulling all the available entries right from the first object. So my Z-form tries to modify the end date of the wrong record (first entry) instead of the last entry. I can also define the object ID in the dynamic code, but we never know how many entries we would have for this subtype.

The question is how to always modify only the last entry in IT0715 with 31.12.9999 using dynamic actions

00 166 P PSPAR-MASSN='X4' 00 168 I MOD,0715,HOME,02,,, 00 169 F GET_DAY_BEFORE_0000_DAY(ZHR_DYNAMIC_ACTIONS_FORMS) 00 170 W P0715-ENDDA=RP50D-DATE1 00 172 W P0715-ASSIGN_STATUS='09'