Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ABAP HR data extraction

Former Member
0 Likes
513

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
454

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

2 REPLIES 2
Read only

Former Member
0 Likes
455

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

Read only

Former Member
0 Likes
454

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.