2009 Apr 23 7:20 PM
Hi guys,
I am confused at certain things in payroll. Sometimes we fetch data from rgdir by declaring internal table and including pc261 in it and sometimes we declare internal table like hrpy_rgdir and then fetch payroll data. Is there any difference between these two methods?
And pls also tell me how do we decide that from which tables,infotypes and clusters we have to fetch payroll data because sometimes we use pcl2 or pcl1 and with different tables or infotypes each type?
Thanks
Aditya
Thread locked for Improper subject line
Edited by: Vijay Babu Dudla on Apr 24, 2009 10:18 AM
Hi guys,
I am confused at certain things in payroll. Sometimes we fetch data from rgdir by declaring internal table and including pc261 in it and sometimes we declare internal table like hrpy_rgdir and then fetch payroll data. Is there any difference between these two methods?
And pls also tell me how do we decide that from which tables,infotypes and clusters we have to fetch payroll data because sometimes we use pcl2 or pcl1 and with different tables or infotypes each type?
Thanks
Aditya
Thread locked for Improper subject line
Edited by: Vijay Babu Dudla on Apr 24, 2009 10:18 AM
2009 Apr 24 7:45 AM
Hi Adithya,
If you want to fetch the data through function modules you can follow the below method which uses PC261 structure.
DATA: gt_rgdir TYPE STANDARD TABLE OF pc261,
gs_rgdir TYPE pc261,
gt_result TYPE pay99_result.
DATA: ld_seqnr TYPE pc261-seqnr.
REFRESH gt_rgdir.
CALL FUNCTION 'CU_READ_RGDIR'
EXPORTING
persnr = pernr-pernr
NO_AUTHORITY_CHECK = ''
IMPORTING
MOLGA =
TABLES
in_rgdir = gt_rgdir
EXCEPTIONS
no_record_found = 1
OTHERS = 2
.
IF sy-subrc <> 0.
REJECT.
ENDIF.
LOOP AT gt_period INTO gs_period.
CLEAR ld_seqnr.
READ TABLE gt_rgdir INTO gs_rgdir
WITH KEY fpbeg = gs_period-fpbeg srtza = 'A'.
IF sy-subrc = 0.
ld_seqnr = gs_rgdir-seqnr.
CLEAR gt_result.
CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'
EXPORTING
clusterid = 'RU'
employeenumber = pernr-pernr
sequencenumber = ld_seqnr
read_only_international = 'X'
check_read_authority = 'X'
CHANGING
payroll_result = gt_result.
ENDIF.
If you want to direct fetch the data regarding the payroll directory you can use the table hrpy_rgdir.
Second question is not clear, still I can say...
PCL2 stores payroll result. You can use cluster id to get the data like cluster id RU for USA payroll.
PCL1 stores PDC data and time event also many more like infotype texts cluster TX. Let me know if you need any further info.
Br/Manas
2009 Apr 24 3:14 PM
Thanks for your reply but why are you looping around gts_period and where does it come from because you have not defined that in the program and other thing is if we can directly access through hrpy_rgdir then why do we use other method. Also tell me something about pay99_result
Thanks
Aditya