‎2008 Jul 26 8:20 PM
Hi Experts
how can i get the HR data for current year ,uptoday and fromtoday. can anyone please supply for me functional module names .
Thanks & Regards
Rags
‎2008 Jul 27 3:08 AM
In HR all the data will not be in one table.
Address data,
Pay data,
etc all these will be stored in one one infotypes.
You have to read them Individually.
You can make use of HR_READ_INFOTYPE , for this you have to pass the Infotype number and dates and PERNR.
You will get the records with in the date range for that Infotype.
‎2008 Jul 27 8:01 AM
Hi
i could not use that one coz i am working on OM (Orgnisationa management). i am using infotype 1001 for the output and table hrp1001 . please see the code below and change it . please help me . check the case when 3 , 4 ,5 and 6.
&----
*& Form data_selection
&----
text
----
--> p1 text
<-- p2 text
----
FORM data_selection .
case date_selection .
when '1'.
pchbegda = sy-datum.
pchendda = sy-datum.
when '2'.
CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
EXPORTING
IV_DATE = sy-datum
IMPORTING
EV_MONTH_BEGIN_DATE = pchbegda
EV_MONTH_END_DATE = pchendda .
when '3'.
delete ITAB where begda np w_year.
when '4'.
DELETE ITAB where begda gt sy-datum.
when '5'.
delete itab where begda lt sy-datum.
when '6'.
delete itab where begda not in so_datum.
ENDCASE.
ENDFORM. " data_selection
‎2008 Jul 27 5:02 AM
Hi Raghava,
HR data is stored in INFOTYPES. Infotype is nothing but a table which contaims logically group of fields.
In Infotypes BEGDA and ENDDA are Key fields. BEGAD is nothing but Begin date and ENDDA is Enddate.
You can make use of this function module to read HR data.
HR_READ_INFOTYPE Read Employee/Applicant Data From Infotypes
You need to pass the ENDDA and BEGDA data according to your requirment.
For current year ,uptoday and fromtoday You need to pass SY-DATUM. As this is the system field which stores the current date .
Best regards,
raam
‎2008 Jul 27 8:02 AM
Hi reddy
i could not use that one coz i am working on OM (Orgnisationa management). i am using infotype 1001 for the output and table hrp1001 . please see the code below and change it . please help me . check the case when 3 , 4 ,5 and 6.
&----
*& Form data_selection
&----
text
----
--> p1 text
<-- p2 text
----
FORM data_selection .
case date_selection .
when '1'.
pchbegda = sy-datum.
pchendda = sy-datum.
when '2'.
CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
EXPORTING
IV_DATE = sy-datum
IMPORTING
EV_MONTH_BEGIN_DATE = pchbegda
EV_MONTH_END_DATE = pchendda .
when '3'.
delete ITAB where begda np w_year.
when '4'.
DELETE ITAB where begda gt sy-datum.
when '5'.
delete itab where begda lt sy-datum.
when '6'.
delete itab where begda not in so_datum.
ENDCASE.
ENDFORM. " data_selection
Edited by: raghava reddy on Jul 27, 2008 6:57 PM
Edited by: raghava reddy on Jul 27, 2008 6:59 PM
‎2008 Jul 27 6:12 AM
Hi Raghava,
You can use the function module:
HR_READ_INFOTYPE - Read Employee/Applicant Data
Check this code sample:
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
* TCLAS = 'A'
pernr = pernr
infty = 0910
BEGDA = '20070717'
ENDDA = '99991231'
* BYPASS_BUFFER = ' '
* LEGACY_MODE = ' '
* IMPORTING
* SUBRC =
tables
infty_tab = P0910
* EXCEPTIONS
* INFTY_NOT_FOUND = 1
* OTHERS = 2
.
IF sy-subrc 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.Hope this helps you.
Regards,
Chandra Sekhar
‎2008 Oct 02 9:18 AM