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

HR ABAP

Former Member
0 Likes
1,520

Hi Experts,

i need to devolop the report for below requirement

This Report will be run monthly after running payroll; this report should be able to generate the flat file for bank transfer data.

Could any body send the code for this

Hi Experts,

i need to devolop the report for below requirement

This Report will be run monthly after running payroll; this report should be able to generate the flat file for bank transfer data.

Could any body send the code for this

10 REPLIES 10
Read only

Former Member
0 Likes
1,466
Read only

0 Likes
1,466

hi bhasker,

thanks for the responce

i am not able to understand that links..

could you send me sample report suitable to my requirement

Read only

0 Likes
1,466

*Internal table for storing the payroll period & sequence no

data: begin of rgdir occurs 100.

include structure pc261.

data: end of rgdir.

*Internal Table for storing payroll results

data: payroll type payin_result.

data: wa_bt like line of payroll-inter-bt .

data: gt_rgdir TYPE hrpy_rgdir OCCURS with header line.

data: begin of it_bt occurs 0,

pernr like pernr-pernr,

bankl like bnka-bankl,

bankn like pc209-bankn,

betrg like pc209-betrg,

end of it_bt.

select pernr from hrpy_rgdir

into table gt_rgdir

where abkrs eq <payroll area>

and ( fpper eq <current pay period> and inper eq <current pay period> ).

LOOP AT gt_rgdir.

clear: payroll.

call function 'PYXX_READ_PAYROLL_RESULT'

exporting

clusterid = 'IN'

employeenumber = it_001-pernr

sequencenumber = rgdir-seqnr

changing

payroll_result = payroll

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.

  • Reading bank payment details

loop at payroll-inter-bt into wa_bt where lgart = '/559'. .

  • Get the Bank Details of the employee

it_bt-pernr = gt_rgdir-pernr.

it_bt-bankl = wa_bt-bankl.

it_bt-bankn = wa_bt-bankn.

it_betrg = wa_bt-betrg.

append it_bt.

ENDLOOP.

LOOP AT it_bt.

write: / it_bt-pernr, 10 it_bt-bankl, 20 it_bt-bankn, 35 it_bt-betrg.

ENDLOOP.

Read only

0 Likes
1,466

hi radha,

thanks for the responce, i need small help from you since i am new to the hr abap.

is that code is suitable for my requirement.

any way i am sending again my requirement,pls put the patience and send me suitable pls.

my requirement:This Report will be run monthly after running payroll; this report should be able to generate the flat file for bank transfer data

Report will be use the logical database PNP to get employee salary data in payroll cluster database.

The user should select payroll area and payroll period and only select all employee under that payroll area

hope i will get the reply from you.

thanks,

venu

Read only

0 Likes
1,466

Hi venu,

As I understand you need to write the report to fetch details using LDB for Payroll. In that case use the following code. You need to enhance your code w.r.t the format of .dax file which you are looking for. Hope this is helpful. Reward if found helpful.

First of all you need to go the attributes section and mention PNP in Logical Database section. Selection Screen Number = 900

Then click the HR report categories TAB.

Select the Payroll Data (Infotypes). Give the report category as PY_DEF.

TABLES: pernr,pyorgscreen, pytimescreen, t549a.

NODES: payroll TYPE pay99_result.

START-OF-SELECTION.

GET pernr.

GET payroll.

*checking for period and actual result

IF payroll-evp-fpper = '200801' AND payroll-evp-srtza = 'A'.

LOOP AT payroll-inter-bt into wa_bt.

gt_bt-pernr = pernr-pernr.

gt_bt-bankl = wa_bt-bankl.

gt_bt-bankn = wa_bt-bankn.

gt_bt-betrg = wa_bt-betrg.

APPEND gt_bt.

ENDLOOP.

ENDIF.

END-OF-SELECTION.

Read only

0 Likes
1,466

Hi Madhav,

sorry for intrupting you again,

i really not able to understand you here, is i need to use these two codes which you have sent me ...

and i not able to .dax file also please provide the explanation.

or else please give me proper final code for all, i can modify to my requirement here.

thanks

Read only

0 Likes
1,466

hi madhu,

if u dont mind could you help me

thanks

Read only

0 Likes
1,466

hi radha,

if you dont mind , i not yet get the solution for this.

could you kindly send me suitable code for my requirement.

thanks in advance.

Read only

0 Likes
1,466

Hi Venu,

Both the codes are valid ones. There are multiple ways to access the Payroll Cluster. The first code is accessing the payroll cluster using Function Modules. But after I have seen your requirement which speaks about the usage of LDB to retrieve the payroll data, I have given another simplest code which retrieves the payroll data using _GET_ statements. It is upto you to mould these code into the requirement which you are looking for. Dax file is nothing but a notepad file. Difference is that you save notepad file with the extension .dax instead of .txt. First of all you should understand the format of the dax file your client is looking for. Then accordingly use the internal table (it_bt) which has been populated in the code to create another internal table as required and then download that internal table directly.

Ex: ABN AMRO BANK: BANKL = 1014, BANKN = 123456, PERNR = 123, BETRG = 45000.

Your final file should be like this:

DATA: Begin of it_final OCCURS 0,

text(1000) TYPE C,

END OF it_final.

Loop at it_bt.

CONCATENATE it_bt-pernr it_bt-bankl it_bt-bankn it_bt-betrg into it_final-text SEPARATED BY '|'.

APPEND it_final.

ENDLOOP.

Download this internal table using GUI_DOWNLOAD FM to the local drive. If you open the file you ill see one record as follows:

123|1014|123456|45000

I hope this completely answers your query.

Read only

0 Likes
1,466

Hi radha,

thanks for ur reply and for consider my problem.sorry for intrupting like this but i am new to abap hr.

provide me final code.... by understanding the below detiles and earlier requirement which i was posted

functional guy given this selection screen detiles.

User Selection Screen:

• User Parameter : Payment date

Payment Date is not mandatory to fill in. but if it is blank it will write the original payment date of payroll result table.

• User Parameter: Tax Exchange Rate.

Tax Exchange Rate can be filled by the user. This Rate will be use only if the currency <> IDR and Salary Amount (WT /559) should be divided by this Tax Rate.

• User Parameter: Path of Text File to be downloaded In PC.

User can select the path of this flat file and chose the windows directory.

User can change the name of flat file.