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

payroll report

Former Member
0 Likes
495

hi experts,

i have requirement to develop a payroll for a specific country as given in the selection screen parameter p_cntr(t500l-molga)

how to create such a report,i had already created payroll reports for international (pay99_result)

thanks in advance

points will be rewarded

hi experts,

i have requirement to develop a payroll for a specific country as given in the selection screen parameter p_cntr(t500l-molga)

how to create such a report,i had already created payroll reports for international (pay99_result)

thanks in advance

points will be rewarded

2 REPLIES 2
Read only

Former Member
0 Likes
463

hi here molga is there use that field for the country specific data..like this..

SELECT persa

name1

FROM t500p

INTO TABLE it_t500p

WHERE molga = c_molga

AND bukrs = c_mastek.

regads,

venkat

Read only

0 Likes
463

my requirement is :'Find out quarterly transport allowance claimed by all employee’s for particular country given in the selection screen'.

this is my report tell me where to put your code

&----


*& Report ZHAI_HR_PAYROLL

*&

&----


*&

*&

&----


REPORT ZHAI_HR_PAYROLL.

tables: pernr.

infotypes: 0000,

0001,

0002,

0003.

types:begin of ty_py,

pernr type p0000-pernr,

massn type massn,"action type

massg type massg,"reason for actions

bukrs type bukrs,"company code

werks type werks,"plant

persk type persk,"employee subgroup

persg type persg,"employee group

plans type plans,"position

stell type stell,"job

sacha type sacha,"payroll adminstrator

nachn type nachn,"last name

vorna type vorna,"vorna

btrtl type btrtl,"sub area

amt type char10,

cumty type char1,

end of ty_py.

data: it_final type table of ty_py,

wa_final type ty_py.

data:it_rgdir type table of pc261,

it_result type pay99_result.

data: wa_crt type pc208.

data: w_molga type molga,

w_seqnr(5) type n,

w_relid(2) type c.

parameter:p_cntr like t500l-molga.

at selection-screen on p_sarea.

perform f_val_sarea.

start-of-selection.

get pernr.

perform f_get_data.

perform f_get_payroll.

end-of-selection.

perform f_dis.

&----


*& Form f_val_sarea

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM f_val_sarea .

data: w_area type btrtl.

select single btrtl from pa0001 into w_area where btrtl eq p_sarea.

if sy-dbcnt eq 0.

message e000(zhnc) with 'incorrect subarea'.

endif.

ENDFORM. " f_val_sarea

&----


*& Form f_get_data

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM f_get_data .

clear wa_final.

rp_provide_from_last p0000 space pn-begda pn-endda.

if pnp-sw-found eq '1'.

wa_final-pernr = p0000-pernr.

wa_final-massn = p0000-massn.

wa_final-massg = p0000-massg.

endif.

rp_provide_from_last p0001 space pn-begda pn-endda.

if pnp-sw-found eq '1'.

wa_final-bukrs = p0001-bukrs.

wa_final-werks = p0001-werks.

wa_final-persk = p0001-persk.

wa_final-persg = p0001-persg.

wa_final-plans = p0001-plans.

wa_final-stell = p0001-stell.

wa_final-sacha = p0001-sacha.

wa_final-btrtl = p0001-btrtl.

rp_provide_from_last p0002 space pn-begda pn-endda.

endif.

if pnp-sw-found eq '1'.

wa_final-nachn = p0002-nachn.

wa_final-vorna = p0002-vorna.

  • append wa_final to it_final.

endif.

ENDFORM. " f_get_data

&----


*& Form f_dis

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM f_dis .

loop at it_result-inter-crt into wa_crt.

if wa_crt-cumty = 'Q' .

WA_FINAL-CUMTY = WA_CRT-CUMTY .

WA_FINAL-AMT = WA_CRT-BETRG .

append wa_final to it_final.

endif.

endloop.

loop at it_final into wa_final.

AT FIRST.

FORMAT COLOR 5.

WRITE: /'FOR SUBAREA',P0001-BTRTL.

ENDAT.

write: / wa_final-pernr,

wa_final-massn,

wa_final-massg,

wa_final-bukrs,

wa_final-werks,

wa_final-persk,

wa_final-persg,

wa_final-plans,

wa_final-stell,

wa_final-sacha,

wa_final-btrtl,

wa_final-nachn,

wa_final-vorna,

wa_final-cumty,

wa_final-amt.

endloop.

ENDFORM. " f_dis

&----


*& Form f_get_payroll

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM f_get_payroll .

CALL FUNCTION 'CU_READ_RGDIR'

EXPORTING

PERSNR = pernr-pernr

  • BUFFER =

  • NO_AUTHORITY_CHECK = ' '

IMPORTING

MOLGA = w_molga

TABLES

IN_RGDIR = it_rgdir

EXCEPTIONS

NO_RECORD_FOUND = 1

OTHERS = 2

.

IF SY-SUBRC = 0.

CALL FUNCTION 'CD_READ_LAST'

EXPORTING

BEGIN_DATE = pn-begda

END_DATE = pn-endda

IMPORTING

OUT_SEQNR = w_seqnr

TABLES

RGDIR = it_rgdir

EXCEPTIONS

NO_RECORD_FOUND = 1

OTHERS = 2.

IF SY-SUBRC = 0.

PERFORM F_GET_RELID.

IF SY-DBCNT NE 0.

*EXTRACT DATA FROM TABLE CLUSTER BY PASSING EMP NO SEQ NO AND CLUSTER TABLE NAME

CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'

EXPORTING

CLUSTERID = W_RELID

EMPLOYEENUMBER = pernr-pernr

SEQUENCENUMBER = W_SEQNR

  • READ_ONLY_BUFFER = ' '

READ_ONLY_INTERNATIONAL = 'X'

  • ARC_GROUP = ' '

  • CHECK_READ_AUTHORITY = 'X'

  • FILTER_CUMULATIONS = 'X'

  • CLIENT =

  • IMPORTING

  • VERSION_NUMBER_PAYVN =

  • VERSION_NUMBER_PCL2 =

CHANGING

PAYROLL_RESULT = IT_RESULT

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

.

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.

ENDIF.

ENDIF.

ENDFORM. " f_get_payroll

&----


*& Form F_GET_RELID

&----


  • text

----


  • -->P_W_RELID text

  • <--P_W_MOLGA text

--2--


FORM F_GET_RELID.

SELECT SINGLE RELID FROM T500L INTO W_RELID WHERE MOLGA EQ w_molga.

ENDFORM. " F_GET_RELID