RFC for reading payroll results into Accounting
hi folks,
I have the HR payroll results forwarded to accounting. I need to display these results in the accounting system. Is there a RFC enabled function module to do that?
your help is really appreciated.
thanks
Vinu
Hi
Well theres a Fm "RFC_READ_TABLE" , if you have authorization of target system you can read PCL1,2 Tables.
Here`s the FM "BAPI_GET_PAYROLL_RESULT_LIST"
Hope thisll help you
Thanks
Message was edited by: Suleman Javed
Similar Messages
-
Function module for reading payroll results
HI,
I need a function module for reading payroll results RT table.
Import parameters are personal number, payroll area, and payroll period.
Export should be RT table.
Regards,
Wasim AhmedHai Wasim
Check the following Code
data: payroll_cluster like t500l-relid.
call function 'PYXX_READ_PAYROLL_RESULT'
exporting
clusterid = payroll_cluster
employeenumber = pernr-pernr
sequencenumber = payroll-evp-seqnr
READ_ONLY_BUFFER = ' '
READ_ONLY_INTERNATIONAL = ' '
CHECK_READ_AUTHORITY = 'X'
IMPORTING
VERSION_NUMBER_PAYVN =
VERSION_NUMBER_PCL2 =
changing
payroll_result = payroll_us
exceptions
illegal_isocode_or_clusterid = 1
error_generating_import = 2
import_mismatch_error = 3
subpool_dir_full = 4
no_read_authority = 5
no_record_found = 6
versions_do_not_match = 7
others = 8
if sy-subrc <> 0.
if sy-subrc <> 0.
write: / 'Fehler beim Laden des US Abrechnungsergebnisses'(003).
write: /'zu Personalnummer'(008), pernr-pernr,
'bei Sequence-Number'(012),
payroll-evp-seqnr.
write: / 'Fehlercode ='(004), sy-subrc.
endif.
endif.
Thanks & regards
Sreenivasulu P -
Payroll Results to Accounting-Help Needed
Dear All
We have problems in Posting Payroll Results to Accounting. Please go through the following and pass on your suggestions and comments.
We are doing HR implementation. Client already has FI system in place. They are maintaining 3 production servers for different divisions.
Now we have to post payroll results to three FI boxes.
AHR system B, C, D--Three Different FI boxes.
Till this point we can configure in ALE and send the results by filtering company code wise as company code is standard filter which is provided by SAP and any way three BOXES are maintained in my HR are three different Company codes.
Now they want
1. Expenses, Liabilities of "B" , only Liabilities of "C" and only Liabilities of "D" in to "B".
2. Only Expenses of C into "C" and Only Expenses of D into "D". The balancing part will be taken care by Finance manually.
We are thinking of solutions.....
1. For the first requirement we will put filter for G/L accounts-Expenses then expenses accounts of C and D will be filtered out. Note: No Standard filter for G/L accounts is available.
2. For the second requirement we will use standard company code filter and G/L accounts-Liabilities filter then only C and D data will be carried out with out liabilities data.
Please let us know if there is any approach other than specified to meet these requirements.
Please revert back to me if more details are required for better understanding the problem.
Waiting for your responses.
Thanks and Regards
Suresh Babu Mannem
Message was edited by: Suresh Babu MannemDear All
We have created filter object G/L account and processed the Idoc. But it didn't work.
Could any body suggest better approach to resolve this problem. The solution could be even in FI side.
Awaiting your reply.
Thanks and Regards
Suresh Babu Mannem -
Reading Payroll Results using PNPCE
Hi All,
As far as reading infotypes/master data is concerned, I am comfortable using "PNPCE" instead of logical database "PNP".
Can any one tell me how can I read payroll results using "PNPCE". Since Get payroll event is not available in pnpce.Hi khalid,
1. U want the remuneration (monthly salary )
2. U won't get it DIRECTLY from any table.
(Its stored in cluster format)
3. Use this logic and FM.
DATA: myseqnr LIKE hrpy_rgdir-seqnr.
DATA : mypy TYPE payin_result.
DATA : myrt LIKE TABLE OF pc207 WITH HEADER LINE.
SELECT SINGLE seqnr FROM hrpy_rgdir
INTO myseqnr
WHERE pernr = mypernr
AND fpper = '200409'
AND srtza = 'A'.
IF sy-subrc = 0.
CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'
EXPORTING
clusterid = 'IN'
employeenumber = mypernr
sequencenumber = myseqnr
CHANGING
payroll_result = mypy
EXCEPTIONS
illegal_isocode_or_clusterid = 1
error_generating_import = 2
import_mismatch_error = 3
subpool_dir_full = 4
no_read_authority = 5
no_record_found = 6
versions_do_not_match = 7
error_reading_archive = 8
error_reading_relid = 9
OTHERS = 10.
myrt[] = mypy-inter-rt.
READ TABLE myrt WITH KEY lgart = '1899'.
4. the internal table myrt
will contain what u require.
regards,
amit m. -
Reading payroll results for an employee from ABAP-HR?
Hi,
I dont know whether i must post this question in this category ? but i had a problem in reading of the payroll data for employees.
I used the function of PYXX_READ_PAYROLL_RESULT and passed the PERNR(employee number), SEQNR, RELID(clusterid) for a given period of say PN-BEGDA AND PN-ENDDA. And i took the payroll structure of germany (its PAYDE_RESULT). program is showing the exceptions since between the selected periods i had many different country employees other than germany DE. how can i solve that problem ? if i use PAY99_RESULT then i cant read the National wage types? how to solve this problem?
which function i must use so that i must get all the payroll data of the employees between the given period with inter/national payroll details and also which structure(like PAYDE_RESULT) i must use for holding the payroll data that is unique?
please help me.
***Ratings are must for a possible answer.Hi KK,
In this sample code...you will find the use of the method i meantioned.
REPORT zgratuity_ipcl MESSAGE-ID zh.
TABLES : pernr , pa0001, pa0008 , pa0000 , t569v.
TYPE-POOLS: slis.
CONSTANTS:
gc_formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
INFOTYPES: 0008 ,0001,0002,0000.
DATA : period(6),
pay_period(6),
c_period(6).
DATA: number LIKE pc261-seqnr.
DATA : refdt LIKE p0000-begda.
DATA: ason_yr LIKE p0347-scryy,
ason_mon LIKE p0347-scrmm.
DATA : BEGIN OF it_0000 OCCURS 100,
pernr LIKE pa0000-pernr,
stat2 LIKE pa0000-stat2,
massn LIKE pa0000-massn,
begda LIKE pa0000-begda,
endda LIKE pa0000-endda,
END OF it_0000.
DATA : g_molga LIKE t512t-molga.
DATA: BEGIN OF package,
lga LIKE p0008-lga01,
bet LIKE p0008-bet01,
END OF package.
DATA : BEGIN OF rgdir OCCURS 0.
INCLUDE STRUCTURE pc261.
DATA : END OF rgdir.
DATA : BEGIN OF rx-key OCCURS 0.
INCLUDE STRUCTURE pc200.
DATA : END OF rx-key.
DATA : BEGIN OF crt OCCURS 0. "result table
INCLUDE STRUCTURE pc208.
DATA : END OF crt.
DATA : b_date LIKE sy-datum,
e_date LIKE sy-datum.
DATA : darate LIKE t539j-gwcht.
DATA : gamt TYPE p.
DATA : BEGIN OF it_0001 OCCURS 100,
pernr LIKE pa0000-pernr,
ename LIKE pa0001-ename,
bukrs LIKE pa0001-bukrs,
persk LIKE pa0001-persk,
persg LIKE pa0001-persg,
werks LIKE pa0001-werks,
END OF it_0001.
**start of mod by tejas on 31.05.06
DATA : BEGIN OF it_final_sup OCCURS 100,
pernr LIKE pa0001-pernr, "PL No
ename LIKE pa0001-ename, "NAME
persg LIKE pa0001-persg, "EMP GROUP
persk LIKE pa0001-persk, "ESG
zzpla LIKE pa0001-zzpla, "PLANT/BUSINESS
orgeh LIKE pa0001-orgeh, "ORG UNIT
orgtx LIKE t527x-orgtx, "ORG UNIT TEXT
gbdat LIKE pa0002-gbdat, "DOB
termn LIKE pa0019-termn, "DOJ
zzrtdt LIKE pa0002-zzrtdt,"DOR
sepdt LIKE pa0000-begda,
no_years TYPE i, "SERVICE YEARS
stat2 LIKE pa0000-stat2, "STATUS
s_text(15), "STATUS TEXT
basic LIKE pa0008-bet01, "BASIC
da LIKE pa0008-bet01, "DA
total LIKE pa0008-bet01, "TOTAL
crt LIKE pc207-betrg, "GRTUITY
massn LIKE pa0000-massn,
begda LIKE pa0000-begda,
ason(6) ,
dates LIKE pa0002-zzrtdt,
END OF it_final_sup.
DATA : BEGIN OF it_final_nonsup OCCURS 100,
pernr LIKE pa0001-pernr, "PL No
ename LIKE pa0001-ename, "NAME
persg LIKE pa0001-persg, "EMP GROUP
persk LIKE pa0001-persk, "ESG
zzpla LIKE pa0001-zzpla, "PLANT/BUSINESS
orgeh LIKE pa0001-orgeh, "ORG UNIT
orgtx LIKE t527x-orgtx, "ORG UNIT TEXT
gbdat LIKE pa0002-gbdat, "DOB
termn LIKE pa0019-termn, "DOJ
zzrtdt LIKE pa0002-zzrtdt,"DOR
sepdt LIKE pa0000-begda,
no_years TYPE i, "SERVICE YEARS
stat2 LIKE pa0000-stat2, "STATUS
s_text(15), "STATUS TEXT
basic LIKE pa0008-bet01, "BASIC
da LIKE pa0008-bet01, "DA
total LIKE pa0008-bet01, "TOTAL
crt LIKE pc207-betrg, "GRTUITY
massn LIKE pa0000-massn,
begda LIKE pa0000-begda,
ason(6) ,
dates LIKE pa0002-zzrtdt,
END OF it_final_nonsup.
DATA : BEGIN OF it_final OCCURS 100,
pernr LIKE pa0001-pernr, "PL No
ename LIKE pa0001-ename, "NAME
persg LIKE pa0001-persg, "EMP GROUP
persk LIKE pa0001-persk, "ESG
zzpla LIKE pa0001-zzpla, "PLANT/BUSINESS
orgeh LIKE pa0001-orgeh, "ORG UNIT
orgtx LIKE t527x-orgtx, "ORG UNIT TEXT
gbdat LIKE pa0002-gbdat, "DOB
termn LIKE pa0019-termn, "DOJ
zzrtdt LIKE pa0002-zzrtdt,"DOR
sepdt LIKE pa0000-begda,
no_years TYPE i, "SERVICE YEARS
stat2 LIKE pa0000-stat2, "STATUS
s_text(15), "STATUS TEXT
basic LIKE pa0008-bet01, "BASIC
da LIKE pa0008-bet01, "DA
total LIKE pa0008-bet01, "TOTAL
crt LIKE pc207-betrg, "GRTUITY
massn LIKE pa0000-massn,
begda LIKE pa0000-begda,
ason(6) ,
dates LIKE pa0002-zzrtdt,
END OF it_final.
**end of mod by tejas on 31.05.06
DATA : f_pabrj LIKE t549s-pabrj,
f_pabrp LIKE t549s-pabrp.
DECLARATIONS FOR ALV DISPLAY
DATA: gt_fieldcat TYPE slis_t_fieldcat_alv,
gs_layout TYPE slis_layout_alv ,
gs_print TYPE slis_print_alv,
gt_filter TYPE slis_t_filter_alv,
gt_sp_group TYPE slis_t_sp_group_alv,
gt_alv_graphics TYPE dtc_t_tc,
gt_excluding TYPE slis_t_extab ,
gt_events TYPE slis_t_event,
gt_print TYPE slis_print_alv.
DATA: gt_list_top_of_page TYPE slis_t_listheader.
DATA: g_boxnam TYPE slis_fieldname VALUE 'BOX',
p_f2code LIKE sy-ucomm VALUE '&ETA',
p_lignam TYPE slis_fieldname VALUE 'LIGHTS',
g_save(1) TYPE c VALUE 'X',
g_default(1) TYPE c VALUE 'X',
g_exit(1) TYPE c,
gx_variant LIKE disvariant,
g_variant LIKE disvariant,
g_repid LIKE sy-repid.
DATA : result TYPE pay99_result.
DATA : crt_header TYPE LINE OF hrpay99_crt.
INITIALIZATION.
SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.
SELECT-OPTIONS : sstat2 FOR pa0000-stat2.
SELECTION-SCREEN: END OF BLOCK b2.
*SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
*SELECTION-SCREEN : SKIP.
*PARAMETERS : P_STAT2 LIKE PA0000-STAT2.
*SELECTION-SCREEN : SKIP.
*SELECTION-SCREEN : END OF BLOCK B1.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-name = 'PNPABKRS-LOW'.
screen-required = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
AT SELECTION-SCREEN." on pnppabrj.
IF pnptimr9 = 'X'.
CONCATENATE pnpdispj pnpdispp INTO period.
CONCATENATE pnpdispp pnpdispj INTO pay_period.
ELSE.
CONCATENATE pnppabrj pnppabrp INTO period.
CONCATENATE pnppabrp pnppabrj INTO pay_period.
ENDIF.
IF period < '200505'.
MESSAGE e001 WITH
'Gratuity report is for period after month Auguest 2005' .
STOP.
ENDIF.
SELECT SINGLE * FROM t569v
WHERE abkrs = pnpxabkr.
CONCATENATE t569v-pabrj t569v-pabrp INTO c_period.
IF period > c_period.
MESSAGE e001 WITH 'Payroll for this period is not yet processed' .
STOP.
ENDIF.
CONCATENATE pnppabrj pnppabrp INTO period.
CONCATENATE pnppabrp pnppabrj INTO pay_period.
IF period =< '200505'.
MESSAGE e001 WITH 'Program is not valid for this period' pnppabrj
*pnppabrp.
ENDIF.
START-OF-SELECTION.
GET pernr.
PERFORM fill_data.
END-OF-SELECTION.
PERFORM final_data.
PERFORM display_data.
*& Form FILL_DATA
text
--> p1 text
<-- p2 text
FORM fill_data.
SORT p0000 BY pernr.
SORT p0001 BY pernr.
SORT p0002 BY pernr.
SORT p0008 BY pernr.
start mod made by kinjal for payroll dates
IF pnptimr9 = 'X'.
CALL FUNCTION 'HR_GB_PERIOD_DATES'
EXPORTING
abkrs = pnpxabkr
PERMO =
pabrj = pnpdispj
pabrp = pnpdispp
IMPORTING
begda = b_date
endda = e_date .
EXCEPTIONS
PERIOD_NOT_FOUND = 1
OTHERS = 2
ELSE.
CALL FUNCTION 'HR_GB_PERIOD_DATES'
EXPORTING
abkrs = pnpxabkr
PERMO =
pabrj = pnppabrj
pabrp = pnppabrp
IMPORTING
begda = b_date
endda = e_date
EXCEPTIONS
PERIOD_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.
ENDIF.
ENDIF.
CONCATENATE pnppabrj pnppabrp '01' INTO b_date.
CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
EXPORTING
iv_date = b_date
IMPORTING
EV_MONTH_BEGIN_DATE =
ev_month_end_date = e_date.
end of modification
*DATA FETCHING FOR SUPERVISOR EMPLOYEES
LOOP AT p0001 WHERE begda <= e_date AND
endda >= e_date AND
persg = 'R' OR
persg = 'P'
AND
( persk >= '11' AND
persk <= '17'
OR
( persk >= 'IA' AND
persk <= 'IJ'
MOVE-CORRESPONDING p0001 TO it_final_sup.
READ TABLE p0002 WITH KEY pernr = p0001-pernr BINARY SEARCH.
IF sy-subrc = 0.
MOVE-CORRESPONDING p0002 TO it_final_sup.
ENDIF.
LOOP AT p0000 WHERE pernr = p0001-pernr AND begda <= e_date AND endda
>= e_date AND stat2 IN sstat2.
SELECT SINGLE orgtx INTO it_final_sup-orgtx FROM t527x
WHERE sprsl = 'EN'
AND orgeh = p0001-orgeh.
SELECT SINGLE text1 INTO it_final_sup-s_text FROM t529u
WHERE sprsl = 'EN'
AND statn = '2'
AND statv = p0000-stat2.
MOVE-CORRESPONDING p0000 TO it_final_sup.
IF p0000-massn = 'A6'.
MOVE p0000-begda TO it_final_sup-zzrtdt.
ELSE.
it_final_sup-zzrtdt = ' '.
ENDIF.
ENDLOOP.
IF sy-subrc <> 0.
CONTINUE.
ENDIF.
SELECT SINGLE termn INTO it_final_sup-termn FROM pa0019
WHERE pernr = p0001-pernr
AND tmart = '06'.
IF sy-subrc = 0.
CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
EXPORTING
date1 = sy-datum
date2 = it_final_sup-termn
output_format = '05'
IMPORTING
years = ason_yr
months = ason_mon
DAYS =
EXCEPTIONS
invalid_dates_specified = 1
OTHERS = 2
IF ason_mon > 6.
ason_yr = ason_yr + 1.
ENDIF.
MOVE ason_yr TO it_final_sup-no_years.
ENDIF.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT p0008 WHERE begda <= e_date AND endda >= e_date AND pernr =
p0001-pernr.
DO 20 TIMES VARYING package-lga FROM p0008-lga01 NEXT p0008-lga02
VARYING package-bet FROM p0008-bet01 NEXT p0008-bet02.
CASE package-lga.
WHEN '0010'.
it_final_sup-basic = package-bet + it_final_sup-basic.
WHEN '0I10'.
it_final_sup-da = package-bet + it_final_sup-da.
ENDCASE.
ENDDO.
it_final_sup-total = it_final_sup-basic + it_final_sup-da.
ENDLOOP.
BREAK-POINT.
start mod made by kinjal
it_final_sup-zzrtdt = it_final_sup-zzrtdt - 1.
CALL FUNCTION 'HR_PAYROLL_PERIODS_GET'
EXPORTING
get_begda = it_final_sup-zzrtdt
GET_ENDDA =
get_permo = '67'
IMPORTING
get_pabrj = f_pabrj
get_pabrp = f_pabrp
TABLES
GET_PERIODS =
EXCEPTIONS
no_period_found = 1
no_valid_permo = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF it_final_sup-stat2 <> '3'.
CONCATENATE it_final-dates+4(2) INTO period.
CONCATENATE f_pabrj f_pabrp INTO period.
it_final_sup-ason = period.
ENDIF.
end of mod
rx-key-pernr = p0001-pernr.
CALL FUNCTION 'CU_READ_RGDIR'
EXPORTING
persnr = p0001-pernr
IMPORTING
molga = g_molga
TABLES
in_rgdir = rgdir
EXCEPTIONS
no_record_found = 1
OTHERS = 2.
LOOP AT rgdir WHERE fpper = period AND inper = period.
ENDLOOP.
With this Seq. number as a key for cluster Key
we can read the RT table from the cluster/..
IF 2
IF sy-subrc EQ 0.
rx-key-seqno = rgdir-seqnr.
IMPORT crt FROM DATABASE pcl2(in) ID rx-key.
IF NOT crt[] IS INITIAL.
PERFORM resultstab.
ENDIF.
APPEND it_final_sup.
CLEAR it_final_sup.
ENDIF.
LOOP AT rgdir WHERE
inper = period AND
srtza = 'A'.
rx-key-seqno = rgdir-seqnr.
number = rgdir-seqnr.
CLEAR rt.
REFRESH rt.
Importing Result table cluster
IMPORT rt FROM DATABASE pcl2(in) ID rx-key.
IF NOT rt[] IS INITIAL.
PERFORM resultstab.
ENDIF.
ENDLOOP.
APPEND it_final.
CLEAR IT_FINAL.
ENDLOOP.
RP-PROVIDE-FROM-LAST P0008 SPACE B_DATE E_DATE.
BREAK-POINT.
DO 10 TIMES varying PACKAGE-LGA from p0008-lga01 next p0008-lga02
varying package-bet from p0008-bet01 next p0008-bet02.
compute itab-gross = itab-gross + package-bet.
IF sy-index = 10.
itab-pernr = p0008-pernr.
append itab.
endif.
enddo.
*DATA FETCHING FOR NON SUPERVISOR EMPLOYEES
LOOP AT p0001 WHERE begda <= e_date AND
endda >= e_date AND
persg = 'R' OR
persg = 'P'
AND
persk >= 'IL' AND
persk <= 'IV'
MOVE-CORRESPONDING p0001 TO it_final_nonsup.
READ TABLE p0002 WITH KEY pernr = p0001-pernr BINARY SEARCH.
IF sy-subrc = 0.
MOVE-CORRESPONDING p0002 TO it_final_nonsup.
ENDIF.
LOOP AT p0000 WHERE pernr = p0001-pernr AND begda <= e_date AND endda
>= e_date AND stat2 IN sstat2.
SELECT SINGLE orgtx INTO it_final_nonsup-orgtx FROM t527x
WHERE sprsl = 'EN'
AND orgeh = p0001-orgeh.
SELECT SINGLE text1 INTO it_final_nonsup-s_text FROM t529u
WHERE sprsl = 'EN'
AND statn = '2'
AND statv = p0000-stat2.
MOVE-CORRESPONDING p0000 TO it_final_nonsup.
IF p0000-massn = 'A6'.
MOVE p0000-begda TO it_final_nonsup-sepdt.
MOVE p0000-begda TO refdt.
ELSE.
MOVE it_final_nonsup-zzrtdt TO refdt.
MOVE e_date TO refdt.
ENDIF.
ENDLOOP.
IF sy-subrc <> 0.
CONTINUE.
ENDIF.
SELECT SINGLE termn INTO it_final_nonsup-termn FROM pa0019
WHERE pernr = p0001-pernr
AND tmart = '06'.
IF sy-subrc = 0.
CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
EXPORTING
date1 = refdt
date2 = it_final_nonsup-termn
output_format = '05'
IMPORTING
years = ason_yr
months = ason_mon
DAYS =
EXCEPTIONS
invalid_dates_specified = 1
OTHERS = 2
IF ason_mon > 6.
ason_yr = ason_yr + 1.
ENDIF.
MOVE ason_yr TO it_final_nonsup-no_years.
ENDIF.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT p0008 WHERE begda <= refdt AND endda >= refdt AND
LOOP AT p0008 WHERE begda <= e_date AND endda >= e_date AND
pernr = p0001-pernr.
DO 20 TIMES VARYING package-lga FROM p0008-lga01 NEXT p0008-lga02
VARYING package-bet FROM p0008-bet01 NEXT p0008-bet02.
CASE package-lga.
WHEN '0010'.
it_final_nonsup-basic = package-bet.
ENDCASE.
ENDDO.
ENDLOOP.
IF it_final_nonsup-massn = 'A6'.
SELECT SINGLE gwcht FROM t539j
INTO darate
WHERE molga = '40'
AND bwlga = '0I10'
AND begda <= it_final_nonsup-begda
AND endda >= it_final_nonsup-begda.
ELSE.
SELECT SINGLE gwcht FROM t539j
INTO darate
WHERE molga = '40'
AND bwlga = '0I10'
AND begda <= e_date
AND endda >= e_date.
ENDIF.
it_final_nonsup-da = ( it_final_nonsup-basic * darate ) / 100.
it_final_nonsup-total = it_final_nonsup-basic + it_final_nonsup-da.
gamt = 0.
gamt = ( it_final_nonsup-total * 15 * it_final_nonsup-no_years )
/ 26.
IF gamt >= 350000.
gamt = 350000.
ENDIF.
MOVE gamt TO it_final_nonsup-crt.
CLEAR gamt.
CLEAR refdt.
APPEND it_final_nonsup.
CLEAR it_final_nonsup.
LOOP AT rgdir WHERE
inper = period AND
srtza = 'A'.
rx-key-seqno = rgdir-seqnr.
number = rgdir-seqnr.
CLEAR rt.
REFRESH rt.
Importing Result table cluster
IMPORT rt FROM DATABASE pcl2(in) ID rx-key.
IF NOT rt[] IS INITIAL.
PERFORM resultstab.
ENDIF.
ENDLOOP.
APPEND it_final.
CLEAR IT_FINAL.
ENDLOOP.
ENDFORM. " FILL_DATA
" GET_GRATUITY
*& Form RESULTSTAB
text
--> p1 text
<-- p2 text
FORM resultstab.
LOOP AT crt WHERE lgart = '9GRA' AND cumty = 'U'.
it_final_sup-crt = abs( crt-betrg ).
ENDLOOP.
ENDFORM. " RESULTSTAB
*& Form DISPLAY_DATA
text
--> p1 text
<-- p2 text
FORM display_data.
IF it_final[] IS INITIAL.
MESSAGE i001 WITH 'No data found'.
STOP.
ENDIF.
g_repid = sy-repid.
PERFORM e01_fieldcat_init USING gt_fieldcat[].
PERFORM eventtab_build CHANGING gt_events.
PERFORM e04_comment_build USING gt_list_top_of_page[].
PERFORM display_report.
ENDFORM. " DISPLAY_DATA
*& Form E01_FIELDCAT_INIT
text
-->P_GT_FIELDCAT[] text
FORM e01_fieldcat_init USING e01_lt_fieldcat TYPE slis_t_fieldcat_alv.
DATA: ls_fieldcat TYPE slis_fieldcat_alv.
gs_layout-group_change_edit = 'X'.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'PERNR'.
ls_fieldcat-tabname = 'IT_FINAL'.
ls_fieldcat-seltext_l = 'Pers No'.
ls_fieldcat-no_zero = 'X'.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ENAME'.
ls_fieldcat-tabname = 'IT_FINAL'.
ls_fieldcat-seltext_l = 'Name'.
ls_fieldcat-no_zero = 'X'.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'PERSK'.
ls_fieldcat-tabname = 'IT_FINAL'.
ls_fieldcat-seltext_l = 'ESG Cd'.
ls_fieldcat-no_zero = 'X'.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZZPLA'.
ls_fieldcat-tabname = 'IT_FINAL'.
ls_fieldcat-seltext_l = 'Plant/Business'.
ls_fieldcat-no_zero = 'X'.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ORGTX'.
ls_fieldcat-tabname = 'IT_FINAL'.
ls_fieldcat-seltext_l = 'Org.Unit'.
ls_fieldcat-no_zero = 'X'.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'GBDAT'.
ls_fieldcat-tabname = 'IT_FINAL'.
ls_fieldcat-seltext_l = 'Dt.Of Birth'.
ls_fieldcat-datatype = 'DATS'.
ls_fieldcat-no_zero = 'X'.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'TERMN'.
ls_fieldcat-tabname = 'IT_FINAL'.
ls_fieldcat-seltext_l = 'Dt.Of Joining'.
ls_fieldcat-datatype = 'DATS'.
ls_fieldcat-no_zero = 'X'.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ZZRTDT'.
ls_fieldcat-tabname = 'IT_FINAL'.
ls_fieldcat-seltext_l = 'Superannuation Dt'.
ls_fieldcat-datatype = 'DATS'.
ls_fieldcat-no_zero = 'X'.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'SEPDT'.
ls_fieldcat-tabname = 'IT_FINAL'.
ls_fieldcat-seltext_l = 'Dt.Of Seperation'.
ls_fieldcat-datatype = 'DATS'.
ls_fieldcat-no_zero = 'X'.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'NO_YEARS'.
ls_fieldcat-tabname = 'IT_FINAL'.
ls_fieldcat-seltext_l = 'Service Years'.
ls_fieldcat-datatype = 'CHAR'.
ls_fieldcat-no_zero = 'X'.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'S_TEXT'.
ls_fieldcat-tabname = 'IT_FINAL'.
ls_fieldcat-seltext_l = 'Status'.
ls_fieldcat-datatype = 'CHAR'.
ls_fieldcat-no_zero = 'X'.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'BASIC'.
ls_fieldcat-tabname = 'IT_FINAL'.
ls_fieldcat-seltext_l = 'Basic'.
ls_fieldcat-datatype = 'CHAR'.
ls_fieldcat-no_zero = 'X'.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'DA'.
ls_fieldcat-tabname = 'IT_FINAL'.
ls_fieldcat-seltext_l = 'DA'.
ls_fieldcat-datatype = 'CHAR'.
ls_fieldcat-no_zero = 'X'.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'TOTAL'.
ls_fieldcat-tabname = 'IT_FINAL'.
ls_fieldcat-seltext_l = 'Total'.
ls_fieldcat-datatype = 'CHAR'.
ls_fieldcat-no_zero = 'X'.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'CRT'.
ls_fieldcat-tabname = 'IT_FINAL'.
ls_fieldcat-seltext_l = 'Gratuity'.
ls_fieldcat-datatype = 'CHAR'.
ls_fieldcat-no_zero = 'X'.
APPEND ls_fieldcat TO e01_lt_fieldcat.
ENDFORM. " E01_FIELDCAT_INIT
*& Form EVENTTAB_BUILD
text
<--P_GT_EVENTS text
FORM eventtab_build CHANGING lt_events TYPE slis_t_event.
CONSTANTS:
gc_formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
DATA: ls_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = lt_events.
READ TABLE lt_events WITH KEY name = slis_ev_top_of_page
INTO ls_event.
IF sy-subrc = 0.
MOVE gc_formname_top_of_page TO ls_event-form.
APPEND ls_event TO lt_events.
ENDIF.
ENDFORM. " EVENTTAB_BUILD
*& Form E04_COMMENT_BUILD
text
-->P_GT_LIST_TOP_OF_PAGE[] text
FORM e04_comment_build USING e04_lt_top_of_page TYPE slis_t_listheader
DATA: ls_line TYPE slis_listheader.
DATA : v_text(100) TYPE c,
v_text1(100) TYPE c,
date1(10),
date2(10).
v_pernrlines TYPE i,
v_pernrchar(5).
DESCRIBE TABLE it_pernr LINES v_pernrlines.
MOVE v_pernrlines TO v_pernrchar.
CONCATENATE b_date6(2) '.' b_date4(2) '.' b_date+0(4) INTO date1.
CONCATENATE e_date6(2) '.' e_date4(2) '.' e_date+0(4) INTO date2.
CONCATENATE 'Gratuity Information for ' date1 'to' date2
INTO v_text SEPARATED BY space.
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-info = v_text.
APPEND ls_line TO e04_lt_top_of_page.
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-info = v_text1.
APPEND ls_line TO e04_lt_top_of_page.
ENDFORM. " E04_COMMENT_BUILD
*& Form DISPLAY_REPORT
text
--> p1 text
<-- p2 text
FORM display_report.
gs_layout-colwidth_optimize = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_background_id = 'ALV_BACKGROUND'
i_callback_program = g_repid
i_callback_user_command = 'USER_COMMAND'
i_structure_name = 'IT_FINAL'
is_layout = gs_layout
it_fieldcat = gt_fieldcat
it_special_groups = gt_sp_group[]
it_sort = gt_sort[]
it_filter = gt_filter[]
i_save = g_save
is_variant = g_variant
it_events = gt_events
is_print = gs_print
it_alv_graphics = gt_alv_graphics[]
it_excluding = gt_excluding
TABLES
t_outtab = it_final.
ENDFORM. " DISPLAY_REPORT
FORM top_of_page *
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
i_logo = 'ENJOYSAP_LOGO'
it_list_commentary = gt_list_top_of_page.
ENDFORM . "TOP_OF_PAGE
FORM user_command USING g_ucomm TYPE sy-ucomm
g_field TYPE slis_selfield.
CASE g_ucomm.
WHEN '&IC1'.
ENDCASE.
ENDFORM. "USER_COMMAND
*& Form FINAL_DATA
text
--> p1 text
<-- p2 text
FORM final_data.
LOOP AT it_final_sup.
MOVE-CORRESPONDING it_final_sup TO it_final.
APPEND it_final.
CLEAR it_final.
ENDLOOP.
LOOP AT it_final_nonsup.
MOVE-CORRESPONDING it_final_nonsup TO it_final.
APPEND it_final.
CLEAR it_final.
ENDLOOP.
SORT it_final BY pernr.
ENDFORM. " FINAL_DATA
<b>Reward if useful,</b>
Regards,
Tejas -
Short dump while reading Payroll results
we have a Z program to read the payroll results for a quarter(3 months)for a large number of employees.
As the internal allocated memory is 2G. This is exceeding that limit resulting in a short dump.
There are no big internal tables in the program except reading some 8 infotypes using rp-provide and get pernr one at a time.
But, in the FM CU_READ_RGDIR the pcl2 cluster records are being stored in an internal table IMPORT_DATA[] and not refreshed, which I think is the cause for the large memory usage. Any suggestions or directions are welcome.
Any suggestions
Thanks,
KumarSantosh,
Thanks for your inputs,
But my internal table type is of DEC (5,2) , I am getting that... it needs to be of type 'C'. Can you suggest.
Ex :
MOVE wa_temp-infile_string+106(8) TO wa_item-QT_PERCENT
This didnt work
so i tried moving into a seperate variable
MOVE wa_temp-infile_string+106(8) TO v_percent.
and then write to
WRITE v_percent to wa_item-QT_PERCENT. -
Error while posting the payroll results to accounts
Dear all,
Im facing a issue while posting the payroll results to the accounts in T.code PC00_M99_CIPE,
The error log says...
Inconsistence in payroll results (tables V0/RT)
Diagnosis:
An inconsistency results has been found during the evaluation of the payroll results. No referenced entry has been found in table V0.
Can anybody suggest me wat i hav to do...
Thanks & regards
Gopinath.BalakrishnanHi
Check whether the user is having the authorisation for the t.code PC_PAYRESULT or PC00_M40-PAYRESULT.
Because some times HR user will run the payroll and FI user will do the postings. If FI user is doing the postings, in general he will not have the authorisation for HR T.codes, then system will give such kind of errors.
If not check the paryoll results and control record.
Thanks & Regards
Bharathi -
Read Payroll Result table.
Hi,
Could you please explain to me the procedure or the different steps needed to read the payroll result table for a particular country?To be more specific for my present req. the country is Canada.I'm new to the payroll module and hence do not know how the payroll procedure is executed.
A code example will be greatly appreciated.
Any help will be of good to me.
Thanks,
Sandeep.
Edited by: Sandeep Ram on Mar 24, 2008 1:41 PMinclude rpc2cd09. "Cluster CD Data-Definition
include rpc2ca00. "Cluster CA Data-Definition
include RPC2RKK0. "Cluster RK Data-Definition
include rpc2rx09. "Cluster internat. part
include rpppxd00. "Data befinition buffer PCL1/PCL2
include rpppxd10. "Common part buffer PCL1/PCL2
include rpppxm00. "Buffer handling routine
data : it_rgdir like pc261 occurs 0 with header line.
data : it_rt like PC207 occurs 0 with header line.
First get the payroll results using the FM : CU_READ_RGDIR
CALL FUNCTION 'CU_READ_RGDIR'
EXPORTING
persnr = p_pernr <-- pass pernr here ...
TABLES
in_rgdir = it_rgdir.
IF sy-subrc = 0.
SORT it_rgdir BY seqnr.
ENDIF.
LOOP AT it_rgdir WHERE srtza = 'A'
AND void IS INITIAL
AND reversal IS INITIAL
AND fpper = v_fpper. <-- Pass the period for
which U want to get the payroll results
v_seqnr = it_rgdir-seqnr.
ENDLOOP.
rx-key-pernr = p_pernr.
rx-key-seqno = v_seqnr.
rp-imp-c2-rk. <-- relid for canada is 'RK'
it_rt[] = rt[]. ---> results table ...
Now loop at rt .. and get the amounts for wage types ...
just an example ...
loop at it_rt.
if it_rt-lgart = '/101'.
v_betrg = it_rt-betrg.
endif.
endloop. -
Need Tcode for viewing payroll results
what is the Tcode to view payroll results(RT n CRT).
Report RPCEDTx0 prints out payroll results (x=country indicators).
use t-code PT66 to display the cluster details that is results table
reward -
Remote Enabled RFC for Reading SMTP Adress out of ADR6
Hi,
just searching for a Remote Enabled Funtion which is able to return the SMTP Adress out of Table ADR6 for a given business Partner ID. (which needs also to be converted to ADDRNUMBER via BUT000 / BUT020 to match the Key Field of ADR6)
Any hints for me ?
Thanks
MarcoMarco,
Use the following sequence of BAPI's:
Call: BAPI_BUPA_ADDRESSES_GET,
Then call:
BAPI_BUPA_ADDRESS_GETDETAIL
This will allow you to get the e-mail address for a given partner id. You can write a wrapper bapi, to consoldiate the two steps into one process if needed.
Take care,
Stephen -
Uploading thrid party payroll results to HR
Dear Gurus/Experts,
I m pretty new to HR, and I will need some serious help around this area.
This is the situation; my organization is planning to outsource the HR module to one of our third party suppliers. The scenario is that we need the payroll results to be updated on a monthly basis to HR and we internally will run posting to FI. Thus I would like to know the best way to do this. The third party supplier will provide us with a csv file at the end of each period with the payroll results.
I was thinking may be LSMW is the best solution, in case yes would anyone be able to provide me with necessary details to create the mappings and the process thereafter?
Any help much appreciated.
Thanks
SharathHi Sharath,
In your business scenario following steps should performed, if you decide to use standard SAP solution only:
1. Export payroll results by service provider. As a minimum following information must be provided:
PERNR BEGDA ENDDA MOLGA LGART BETPE ANZHL BETRG
00000000 31.03.1993 31.03.1993 06 /101 0,00 0,00 0,00
00000000 31.03.1993 31.03.1993 06 /102 0,00 0,00 0,00
00000000 31.03.1993 31.03.1993 06 /103 0,00 0,00 0,00
00000000 31.03.1993 31.03.1993 06 /104 0,00 0,00 0,00
00000000 31.03.1993 31.03.1993 06 /105 0,00 0,00 0,00
00000000 31.03.1993 31.03.1993 06 /107 0,00 0,00 0,00
00000000 31.03.1993 31.03.1993 06 /110 0,00 0,00 0,00
PERNR - Employee number in SAP system
BEGDA - Payroll period beginning date
ENDDA - Payroll period end date
MOLGA - country grouping
LGART - wage type as configured in SAP system
BETPE - rate (not critical)
ANZHL - number (not critical)
BETRG - amount (critical)
2. Then information should be uploaded to table T558A in SAP with help of report RPULKT00.
3. Then you have to run payroll with schema XLK0 (transfer payroll account). This procedure will upload payroll data to SAP payroll cluster.
4. Then you can start posting process, program RPCIPE00. During posting process SAP system reads payroll cluster and assigns wage types to symbolic accounts and then to G/L accounts. How wage types are assigned you have to configure in SPRO, for example, Payroll>Payroll: International>Reporting for Posting Payroll Results to Accounting
5. Finance system should post results for financial accountring.
In overall it is quite complex procedure, but it happens due to complex system landscape. Alternatively you can ask payroll provider to prepare file for posting on there site.
Cheers -
Payroll Results posting to FI - Step by Step guide & Video tutorials if any
Hi Gurus,
Please help me on
Payroll Results posting to FI and details on CIPE program and CIPE reports of SAP HR.
Please provide me with Step by Step Configuration steps and guidance also video tutorials or screen shots if any available.
Thanx in Advance .... plzz helphttp://help.sap.com/saphelp_erp2005vp/helpdata/en/81/42b09e4a3711d189490000e8323c4f/content.htm
Table V_T52EM
Transaction Code SPRO
Menu Path IMG -> Payroll India -> Reporting for Posting Payroll Results to Accounting -> Activities in the HR System -> Employee Grouping and Symbolic Accounts -> Define Employee Grouping Account Determination
Details of Configuration Maintain SAP Standard entries. Account assignment can also be done based on various employee subgroup using the feature u2018PPMODu2019 which can be seen under this node.
Define Symbolic Accounts
Table V_T52EK
Transaction Code SPRO
Menu Path IMG -> Payroll India -> Reporting for Posting Payroll Results to Accounting -> Activities in the HR System -> Employee Grouping and Symbolic Accounts -> Define Symbolic Accounts
Details of Configuration Define Symbolic accounts for balance sheet and expense accounts. Account assignment type = C for expense and F for Balance sheet accounts.
Maintaining Wage Types
Define Posting Characteristics of Wage Types
Table V_T52EZ, V_T52EL
Transaction Code SPRO
Menu Path IMG -> Payroll India -> Reporting for Posting Payroll Results to Accounting -> Activities in the HR System -> Maintaining Wage Types -> Define Posting Characteristics of Wage Types
Details of Configuration The posting characteristics of individual wage type can be done here depending upon the requirement. For example, the basic pay wage type u20181000u2019 is linked to symbolic account u20188888u2019(Salaries & wages) as below. If the model wage type is used for creating a new wage type, then this entry is created automatically.
2.1.1 Maintain Posting Date for Payroll Periods
Table T549S
Transaction Code SPRO
Menu Path IMG -> Payroll India -> Reporting for Posting Payroll Results to Accounting -> Activities in the HR System -> Maintain Posting Date for Payroll Periods
Details of Configuration Posting Date for different payroll periods can be done as follows. The Pay Day is already generated in the earlier step 4.1.5. This Pay Day can be created as Posting date. Otherwise, the difference in days has to be mentioned in the specification screen for different Posting date.
Create Posting Variants
Table V_T52E2
Transaction Code SPRO
Menu Path IMG -> Payroll India -> Reporting for Posting Payroll Results to Accounting -> Activities in the HR System -> Maintain Posting Date for Payroll Periods
Details of Configuration Posting Variants for payroll posting can be created here. This is an optional step.
Activities in the AC System
Assigning Accounts
Assign Balance Sheet Accounts
Table T030
Transaction Code SPRO
Menu Path IMG -> Payroll India -> Reporting for Posting Payroll Results to Accounting -> Activities in the AC System -> Assigning Accounts -> Assign Balance Sheet Accounts
Details of Configuration This is basically interface between HR & AC system by linking Symbolic accounts to the respective Balance sheet accounts as follow.
Assign Expense Accounts
Table T030
Transaction Code SPRO
Menu Path IMG -> Payroll India -> Reporting for Posting Payroll Results to Accounting -> Activities in the AC System -> Assigning Accounts -> Assign Expense Accounts
Details of Configuration This is basically the interface between HR & AC system by linking Symbolic accounts to the respective Expense accounts as follow.
Assign Technical Accounts
Table T030
Transaction Code SPRO
Menu Path IMG -> Payroll India -> Reporting for Posting Payroll Results to Accounting -> Activities in the AC System -> Assigning Accounts -> Assign Technical Accounts
Details of Configuration The single entry here is required for accounting key u20181001u2019 to salary payable account u2018230116u2019 for the purpose of automatic account posting.
Assign Vendor Accounts
Table T030
Transaction Code SPRO
Menu Path IMG -> Payroll India -> Reporting for Posting Payroll Results to Accounting -> Activities in the AC System -> Assigning Accounts -> Assign Vendor Accounts
Details of Configuration This is basically the interface between HR & AC system by linking Symbolic accounts to the respective Vendor accounts(Account Assignment type K u2013 Personal Vendor, KF u2013 Fixed Vendor) which was created in Transaction u2018FK01u2019.
Check Customizing for Account Determination
Table None
Transaction Code SPRO
Menu Path IMG -> Payroll India -> Reporting for Posting Payroll Results to Accounting -> Check Customizing for Account Determination
Details of Configuration The account assignment for all the wage types through symbolic account can be displayed here. -
Generate XML file for payroll result
Hi,
I tried to generate XML file for chinese payroll result by t-code: pu12, but i can not find the interface format for china payroll(here is format for other country vesion like international, france...). How can i generate xml file for chinese payroll result. DO i need to create a format type? Is there any other way? thank you in advance.Coming back to my question is it really possible to generate bigger XML on 9i.
Sure. But not in one go.
I would use SQL/XML functions instead and paginate the result set so that each CLOB chunk doesn't exceed 4GB (or less). Each chunk could then be appended to a file using UTL_FILE.
Alternatively, as Oracle 9i supports parallel pipelined functions, you could also imagine doing the job in parallel using automatic data partitioning on an input ref cursor.
That would require some postprocessing steps to rebuild the entire file from the different chunks though.
See : Pipelined and Parallel Table Functions -
ABAP HR - How to insert payroll results using fm PYXX_WRITE_PAYROLL_RESULT
Hi,
I have a scenario where I want to read cluster information (PCL2 RX) from system A and insert it into system B. Both systems are SAP ECC 6.0. Employee master data already exists on target system, but no payroll results yet, so this is an insert and not an update.
I am using fm PYXX_READ_PAYROLL_RESULT (I also tried with HRCM_PAYROLL_RESULTS_GET) to read the data and then calling a RFC on system B where I use fm PYXX_WRITE_PAYROLL_RESULT to write the payroll results into database. Is this fm only to use in case of update, or it should also work when inserting new lines on the cluster? Because I always get a sy-subrc=0 but nothing is created on the db. Is there any other way to this? Do you have any code samples?
Many thanks,
MiguelHI Miguel:
I have succe add of new payroll records, the following reference code:
*& Report ZTEST_BJARNE8
REPORT ztest_bjarne8.
TABLES:pcl1,pcl2.
INCLUDE rpc2cd00. "Cluster CD data definition
INCLUDE rpc2ca00. "Cluster CA Data-Definition
INCLUDE pc2rxcn0. "Cluster CN data definition
INCLUDE rpc2rx00. "Cluster RX data definition internat. part
DATA: refvar_curr TYPE REF TO data.
DATA: refvar_prev TYPE REF TO data.
DATA: refvar_cumul TYPE REF TO data.
DATA: t52relid_header TYPE t52relid.
FIELD-SYMBOLS: <payresult_current>.
DATA: employee_number LIKE pc200-pernr,
client LIKE sy-mandt,
globalmolga TYPE T500L-MOLGA,
cluster_id LIKE t500l-relid,
isocode LIKE t500l-intca.
DATA: rgdir_entry LIKE pc261.
CALL FUNCTION 'HR_PCLX_INIT_BUFFER'.
employee_number = '81000463'.
CLEAR:rgdir.REFRESH rgdir[].
CALL FUNCTION 'CU_READ_RGDIR_NEW'
EXPORTING
persnr = employee_number
check_read_authority = space
imp_client = client
TABLES
in_rgdir = rgdir
EXCEPTIONS
no_record_found = 1
import_mismatch_error = 2
no_read_authority = 3
OTHERS = 4.
LOOP AT rgdir.
ENDLOOP.
cluster_id = 'CN'.
SELECT SINGLE * FROM t52relid INTO t52relid_header
WHERE relid = cluster_id.
CREATE DATA refvar_curr TYPE (t52relid_header-typename).
ASSIGN refvar_curr->* TO <payresult_current>.
CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'
EXPORTING
clusterid = cluster_id
employeenumber = employee_number
sequencenumber = rgdir-seqnr
check_read_authority = space"false "already done
filter_cumulations = space
CHANGING
payroll_result = <payresult_current>
EXCEPTIONS
illegal_isocode_or_clusterid = 1
error_generating_import = 2
import_mismatch_error = 3
subpool_dir_full = 4
no_read_authority = 5
no_record_found = 6
versions_do_not_match = 7
OTHERS = 8.
IF NOT <payresult_current> IS INITIAL.
"TODO changed RT data......
"Add new month payresult
rgdir-seqnr = rgdir-seqnr + 1.
CALL FUNCTION 'PYXX_WRITE_PAYROLL_RESULT'
EXPORTING
clusterid = cluster_id
employeenumber = employee_number
sequencenumber = rgdir-seqnr
payroll_result = <payresult_current>
CLIENT =
EXCEPTIONS
illegal_isocode_or_clusterid = 1
error_generating_export = 2
export_error = 3
subpool_dir_full = 4
no_update_authority = 5
incomplete_result_imported = 6
OTHERS = 7
IF sy-subrc <> 0.
ENDIF.
APPEND rgdir.
globalmolga = '28'.
client = '200'.
CALL FUNCTION 'CU_WRITE_RGDIR_NEW'
EXPORTING
persnr = employee_number
molga = globalmolga
imp_client = client
TABLES
rgdir = rgdir
EXCEPTIONS
no_update_authority = 1
OTHERS = 2.
CALL FUNCTION 'HR_FLUSH_BUFFER_UPDATE_PCLX'
EXPORTING
test = space
EXCEPTIONS
insert_error = 1
no_update_authority = 2
OTHERS = 3.
IF sy-subrc <> 0.
"MESSAGE e062.
ENDIF.
ENDIF.
"INCLUDE rpc2cd09.
*& INCLUDE
INCLUDE rpppxd00. "Data definition buffer PCL1/PCL2
INCLUDE rpppxd10. "Common part buffer PCL1/PCL2
INCLUDE rpppxm00. "Buffer handling routine -
RFC for Availbility check.
Hi all,
I am working for a Retail project. there is a requirement like...
Whenever POS (point of sales - Store) doing the billing for an article one request should go SAP to check the availbility of the product and get the status of the same.. is there any standard RFC for the req... pls do the needful...
it is some thing like online availability check...
Thanks in advance...
subbu..hi
Synchronous RFC (CALL FUNCTION-DESTINATION)
Syntax
CALL FUNCTION func DESTINATION dest parameter list.
Effect
Synchronous call of a remote-capable function module specified in func using the RFC interface. With the addition DESTINATION, the destination is specified in dest. Character-type data objects are expected for func and dest. The calling program is continued using the statement CALL FUNCTION, if the remotely called function has finished.
CALL FUNCTION - DESTINATION parameter list
Syntax
... http://EXPORTING p1 = a1 ... pn = an
http://IMPORTING p1 = a1 p2 = a2 ...
http://CHANGING p1 = a1 p2 = a2 ...
http://TABLES t1 = itab1 t2 = itab2 ...
[EXCEPTIONS exc1 = n1 exc2 = n2 ... MESSAGE mess
OTHERS = n_others].
Effect
These additions are used to assign actual parameters to the formal parameters of the function module, and return values to exceptions that are not class-based. The additions have the same meanings as for the general function module call, the only differences being that, with the addition TABLES, only tables with flat character types can be transferred, and that if a header line exists, it is not transferred. The additions EXPORTING, IMPORTING and CHANGING allow you to transfer tables that have deep character types, deep structures, and strings.
For EXCEPTIONS, you can also specify an optional addition MESSAGE for the special exceptions SYSTEM_FAILURE and COMMUNICATION_FAILURE. If one of these exceptions occurs, the first line of the corresponding short dump is entered in the field mess, which must be flat and of character-type.
Transferring tables using the addition TABLES is considerably faster than using the other additions, since a binary format is used internally instead of an XML format.
Parallel Processing with Asynchronous RFC
To achieve a balanced distribution of the system load, you can use destination additions to execute function modules in parallel tasks in any application server or in a predefined application server group of an SAP system.
Parallel-processing is implemented with a special variant of asynchonous RFC. Its important that you use only the correct variant for your own parallel processing applications: the CALL FUNCTION STARTING NEW TASK DESTINATION IN GROUP keyword. Using other variants of asynchronous RFC circumvents the built-in safeguards in the correct keyword, and can bring your system to its knees
Details are discussed in the following subsections:
· Prerequisites for Parallel Processing
· Function Modules and ABAP Keywords for Parallel Processing
· Managing Resources in Parallel Processing
Prerequisites for Parallel Processing
Before you implement parallel processing, make sure that your application and your SAP system meet these requirements:
· Logically-independent units of work:
The data processing task that is to be carried out in parallel must be logically independent of other instances of the task. That is, the task can be carried out without reference to other records from the same data set that are also being processed in parallel, and the task is not dependent upon the results of others of the parallel operations. For example, parallel processing is not suitable for data that must be sequentially processed or in which the processing of one data item is dependent upon the processing of another item of the data.
By definition, there is no guarantee that data will be processed in a particular order in parallel processing or that a particular result will be available at a given point in processing.
· ABAP requirements:
¡ The function module that you call must be marked as externally callable. This attribute is specified in the Remote function call supported field in the function module definition (transaction SE37).
¡ The called function module may not include a function call to the destination BACK.
¡ The calling program should not change to a new internal session after making an asynchronous RFC call. That is, you should not use SUBMIT or CALL TRANSACTION in such a report after using CALL FUNCTION STARTING NEW TASK.
¡ You cannot use the CALL FUNCTION STARTING NEW TASK DESTINATION IN GROUP keyword to start external programs.
· System resources:
In order to process tasks from parallel jobs, a server in your SAP system must have at least 3 dialog work processes. It must also meet the workload criteria of the parallel processing system: Dispatcher queue less than 10% full, at least one dialog work process free for processing tasks from the parallel job.
Function Modules and ABAP Keywords for Parallel Processing
You can implement parallel processing in your applications by using the following function modules and ABAP keywords:
· SPBT_INITIALIZE: Optional function module.
Use to determine the availability of resources for parallel processing.
You can do the following:
¡ check that the parallel processing group that you have specified is correct.
¡ find out how many work processes are available so that you can more efficiently size the packets of data that are to be processed in your data.
· CALL FUNCTION Remotefunction STARTING NEW TASK Taskname DESTINATION IN GROUP:
With this ABAP statement, you are telling the SAP system to process function module calls in parallel. Typically, youll place this keyword in a loop in which you divide up the data that is to be processed into work packets. You can pass the data that is to be processed in the form of an internal table (EXPORT, TABLE arguments). The keyword implements parallel processing by dispatching asynchronous RFC calls to the servers that are available in the RFC server group specified for the processing.
Note that your RFC calls with CALL FUNCTION are processed in work processes of type DIALOG. The DIALOG limit on processing of one dialog step (by default 300 seconds, system profile parameter rdisp/max_wprun_time) applies to these RFC calls. Keep this limit in mind when you divide up data for parallel processing calls.
· SPBT_GET_PP_DESTINATION: Optional function module.
Call immediately after the CALL FUNCTION keyword to get the name of the server on which the parallel processing task will be run.
· SPBT_DO_NOT_USE_SERVER: Optional function module.
Excludes a particular server from further use for processing parallel processing tasks. Use in conjunction with SPBT_GET_PP_DESTINATION if you determine that a particular server is not available for parallel processing (for example, COMMUNICATION FAILURE exception if a server becomes unavailable).
· WAIT: ABAP keyword
WAIT UNTIL
Required if you wish to wait for all of the asynchronous parallel tasks created with CALL FUNCTION to return. This is normally a requirement for orderly background processing. May be used only if the CALL FUNCTION includes the PERFORMING ON RETURN addition.
· RECEIVE: ABAP keyword
RECEIVE RESULTS FROM FUNCTION Remotefunction
Required if you wish to receive the results of the processing of an asynchronous RFC. RECEIVE retrieves IMPORT and TABLE parameters as well as messages and return codes.
Managing Resources in Parallel Processing
You use the following destination additions to perform parallel execution of function modules (asynchronous calls) in the SAP system:
In a predefined group of application servers:
CALL FUNCTION Remotefunction STARTING NEW TASK Taskname
DESTINATION IN GROUP Groupname
In all currently available and active application servers:
CALL FUNCTION Remotefunction STARTING NEW TASK Taskname
DESTINATION IN GROUP DEFAULT
The addition first determines the amount of resources (work processes) currently available (i.e. in all servers or in a group of application servers, comparable with login servers). The resources available for executing asynchronous calls on each application server depends on the current system load.
The applications developer is responsible for the availability of RFC groups in the production system (i.e. the customer's system). For details on how to maintain the RFC groups, see Maintaining Group Destinations For Load Distribution.
After determining the available resources, the asynchronous call is executed in an available application server. If no resources are available at that particular time, the system executes the exception routine RESOURCE_FAILURE (see the addition Exceptions). In the case of an asynchronous function module call, this exception must be handled by the application program.
The process for determining available resources in an RFC group is as follows:
First, the system determines the length of the dispatcher queue for the relevant application server. If it is greater than 10% of the overall length, the server makes no resources available. If it is smaller, the system makes available the current number of free dialog processes minus 2 (as a reserve instance for other purposes, e.g. for logon to the system or administration programs). Thus, one application server must have at least 3 dialog processes if RFC parallel processing is taken into account.
§ At present, only one RFC group per program environment is supported for parallel execution of asynchronous calls. Using both additions (DESTINATION IN GROUP Groupname and DESTINATION IN GROUP DEFAULT) in one program is not allowed.
§ The exception routine RESOURCE_FAILURE is only triggered in connection with asynchronous RFCs with the additions DESTINATION IN GROUP Groupname and DESTINATION IN GROUP DEFAULT.
You are recommended (for performance and other reasons) to use an RFC group with sufficient resources for parallel processing of asynchronous calls
Continue with the following section:
CALL FUNCTION - STARTING NEW TASK
regards
satish
Maybe you are looking for
-
Nvidia GT610 through HDMI I know this issue is one of the more popular ones (at least for me); however, after several hours of research, there is not much to go off of and nearly no information pertaining to this card. A while back, I posted an issue
-
ICloud drive keeps switching itself off on my iPad 2
I have a MBP and an iMac = both on Yosemite and both working with iCloud drive OK. But I cannot get this to work on iPad 2 with IOS 8 - with either Pages or Keynote. It keeps telling me to set up iCloud - which I do as per instructions - but it send
-
Problem z rejestracją adobe photoshop cs6
Proszę o pomoc z rejestracją photoshopa. Dzisiaj zakupiłem photoshopa cs6. Zainstalowałem, następnie założyłem konto na adobe.com. Potem zarejestrowałem produkt. Niestety na początku instalacji program nie mógł połączyc się z internetem. Wybrałem zar
-
I am trying to do an Exception in my BPM and I am looking the following Example in Software Component Version :SAP BASIS 6.40 Name Space : http://sap.com/xi/XI/System/Patterns Name : BpmPatternReqRespTimeOut Could some one tell me, where can I find
-
Ultra 40 Does not power up.
Hi All, Recently I transported my Ultra 40 one place to another, now it wont power up. I get the LED on the motherboard and I can hear the click from the power supply when I push the power cable in. Upon pressing the power button, the fans spin very