‎2008 Feb 11 10:30 AM
Hi,
My query is related to ABAP HR.
I have to extract Job record for the
employee where hiredate lies within the set period ( 60 days in my case
i.e.
PN-BEGDA = ( SY-DATUM ) - 60. "Begin date
PN-ENDDA = ( SY-DATUM ) - 1 . "End date)
if no record exists within the set period i have to check the history for the same employee and extract the latest record for the same.
Please suggest me what can be done.
Regards,
Richs
‎2008 Feb 11 3:55 PM
Hi Richs,
write this way.
PN-BEGDA = sy-datum - 60.
PN-ENDDA = sy-datum - 1.
RP_PROVIDE_FROM_LAST P0000 space PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
*print the pernr.
ELSE.
PN-BEGDA = '18000101'.
PN-ENDDA = '99991231'.
RP_PROVIDE_FROM_LAST P0000 space PN-BEGDA
PN-ENDDA.
IF PNP-SW-FOUND = 1.
print the pernr
ELSE.
REJECT.
ENDIF.
ENDIF.
Edited by: Velangini Showry Maria Kumar Bandanadham on Feb 11, 2008 4:58 PM
‎2008 Feb 11 3:55 PM
Hi Richs,
write this way.
PN-BEGDA = sy-datum - 60.
PN-ENDDA = sy-datum - 1.
RP_PROVIDE_FROM_LAST P0000 space PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
*print the pernr.
ELSE.
PN-BEGDA = '18000101'.
PN-ENDDA = '99991231'.
RP_PROVIDE_FROM_LAST P0000 space PN-BEGDA
PN-ENDDA.
IF PNP-SW-FOUND = 1.
print the pernr
ELSE.
REJECT.
ENDIF.
ENDIF.
Edited by: Velangini Showry Maria Kumar Bandanadham on Feb 11, 2008 4:58 PM
‎2008 Feb 11 4:05 PM
Get the Hire date from PA0041 ... and check if it lies between
your prescribed dates .. (Generally Hiredates are stored
in PA0041 ... field from DAT01 ....DAT12 )
v_hiredate ...
PN-BEGDA = sy-datum - 60.
PN-ENDDA = sy-datum - 1.
IF v_hiredate between PN-BEGDA PN_ENDDA
*Get the pernr.
ELSE.
PN-BEGDA = '18000101'.
PN-ENDDA = '99991231'.
RP_PROVIDE_FROM_LAST P0000 space PN-BEGDA
PN_ENDDA.
IF PNP-SW-FOUND = 1.
get this pernr ...
ELSE.
REJECT.
ENDIF.