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: 

Using Cluster WPBP of the pyroll Cluster PCL2.

former_member206153
Participant
0 Kudos

Hi All,

How can i pick the average number of Hours from payroll cluster WPBP in payroll results table ,in PCL2 for the latest payroll period for the associate.

Waiting for the reply.

Thanks & Regards,

Bhavika

2 REPLIES 2

Former Member
0 Kudos

Hi

  DATA: w_relid LIKE pcl2-relid,
        w_molga LIKE t500p-molga,
        w_seqnr LIKE pc261-seqnr,
        it_rgdir TYPE STANDARD TABLE OF pc261 WITH HEADER LINE.
DATA: it_result TYPE pay99_result,
        w_wpbp likw it_result-inter-wpbp.

  REFRESH it_rgdir.
  CLEAR   it_rgdir.

  CALL FUNCTION 'CU_READ_RGDIR'
       EXPORTING
            persnr          = pernr-pernr
       IMPORTING
            molga           = w_molga
       TABLES
            in_rgdir        = it_rgdir
       EXCEPTIONS
            no_record_found = 1
            OTHERS          = 2.

  IF sy-subrc EQ 0.
    SELECT SINGLE relid
             FROM t500l
             INTO w_relid
            WHERE molga = w_molga.
  ELSE.
    EXIT.
  ENDIF.

**From it_rgdir, get the required seqnr depending on the payroll period.
      CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'
         EXPORTING
              clusterid                           = w_relid
              employeenumber               = it_0001-pernr
              sequencenumber               = w_seqnr
              read_only_international      = c_x
         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.
      CONTINUE.
    ELSE.
      LOOP AT it_result-inter-wpbp INTO  w_wpbp.

      ENDLOOP.
    ENDIF.

Regards

Navneet

0 Kudos

Hi,

Can you tel me the Field in this structure for Average Number of Hours..

Thanks & Regards,

Bhavika