Application Development 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: 

regarding payroll

Former Member
0 Kudos

when I Run Payroll where I can find the Company Code assigned to that PERNR

1 ACCEPTED SOLUTION

Former Member
0 Kudos

In the payroll results you have C0.

Then the field KBUNN

*Kostenverteilung

DATA: BEGIN OF C0 OCCURS 0.

INCLUDE STRUCTURE PC20A .

DATA: END OF C0 .

13 REPLIES 13

Former Member
0 Kudos

In the payroll results you have C0.

Then the field KBUNN

*Kostenverteilung

DATA: BEGIN OF C0 OCCURS 0.

INCLUDE STRUCTURE PC20A .

DATA: END OF C0 .

Former Member
0 Kudos

Hi pavan,

1. Ur requirement is not fully clear !

2. payroll (program) runs on the concept of

PAYROLL AREA

(and not company code)

3. howevever,

the funcational guy take care that

for each company code, a new payroll

area has been defined.

4. In case u want to find which company code

is assigned to that pernr,

infotype 0001 will help.

ie. table PA0001

regards,

amit m.

0 Kudos

thanks for Ur response

what I need is

I need to display the RGDIR data like payroll period paytype payroll identifier paydate etc.,

along with the company code assigned to that PERNR

I have to sort according to company code further

regards,

PAVAN

0 Kudos

Hi Pavan,

You can find BUKRS in WPBP table after looping at RGDIR.

Regards,

Suresh Datti

0 Kudos

can U plz tell me its structure

I just didn't found there

Regards,

PAVAN.

0 Kudos

Pavan,

Structure is PC205

Suresh

0 Kudos

hello

iam confussed

thanks a lot

REgards,

PAVAN

0 Kudos

Hi,

To verify if the value is inthe Result, Use the Transaction 'pc_payresult'. Enter the pERNr and display the Results. You will see th RGDIR on the next screen. Double click on the Payroll Result you are intetrested and you will see all the Payroll internal tables on the next screen. Double click on WPBP & look for the value under 'CoCd'..It should be on the first line.. The Co Code is actually picked from Matser data ie 0001.. If you have already read 0001 in your Program, you an as well use p0001-bukrs.

Regards,

Suresh Datti

Regards,

Suresh Datti

0 Kudos

Hello Datti,

Thanks once again

can U plz tell ne how to get that after using cu_read_rgdir FM

0 Kudos

what I mean to ask is it is of PC261

and WPBP is of pc205

is there any FM to directly get the data of WPBP for a PERNR

REgards,

PAVAN

0 Kudos

Hi Pavan,

It is quite simple.. After the function call to CU_READ_RGDIR for each pernr, the temp table RGDIR is filled. Loop at RGDIR for the Result in question and inside that loop.. read table WPBP index 1. the next step you will have the Co Code value in WPBP-BUKRS.

Regards,

Suresh Datti

0 Kudos

Hi Suresh ,

Iam sorry to distrub you again

C

in cu_read_rgdir FM

Iam taking the output into IT of type pc261

from there how can I get the data related to pc205

Regards,

PAVAN.

0 Kudos

Hi Pavan,

You can use the following code as a refrence.. But there are so many ways to read the Payroll results.. YOu could use the GET PAYROLL event or function modules like HR_PT_READ_PAYROLL_RESULT etc..


report  zppayresult.
.
data:  t_rgdir          like pc261 occurs 0 with header line.
include: rpcccd09,                      "constants for cluster CD/CU
         rpc2rx00,                      "Definition cluster RX (I)
         rpppxd00,                      "Buffer definition (I)
         rpc2ruu0.                      "US cluster

data: begin of common part buffer.
include: rpppxd10.                      "Buffer definition (II)
data: end  of common part buffer.
tables: pcl1, pcl2.
include rpppxm00.

start-of-selection.
  call function 'CU_READ_RGDIR'
    exporting
      persnr   = '00007519'
    tables
      in_rgdir = t_rgdir.
  if sy-subrc eq 0.
    loop at t_rgdir where seqnr = '00057'.
      rx-key-pernr = '00007519'.
      unpack t_rgdir-seqnr to rx-key-seqno.
*Import data from PCL2
      rp-imp-c2-ru.
      read table wpbp index 1.
      if sy-subrc eq 0.
        write:/ wpbp-bukrs.
      endif.
    endloop.
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  endif.

Regards,

Suresh Datti