Skip to Content
avatar image
Former Member

ABAP HR: Update payroll_result

Hi,

I'm trying update parameter payroll_result with the function 'PYXX_WRITE_PAYROLL_RESULT' and when I debugged my code, sy-subrc is 6 (imcomple_result_imported) then the changes don't result. Maybe ltd_payroll not contain all data needed to update payroll. My question is: what data does ltd_payroll need to update it successfully?

PD: My program change payrolls for random values.

DATA: ltd_rgdir TYPE STANDARD TABLE OF pc261,
        ltd_payroll TYPE pay99_result,
        ls_temp_wrbtr TYPE wrbtr_bi,
        ltd_rt TYPE STANDARD TABLE OF pc207,
        ls_molga TYPE molga,
        ltd_object_list TYPE STANDARD TABLE OF hrpystruc,
        ls_relid TYPE pcl2-relid."relid_pcl.

FIELD-SYMBOLS: <fs_rgdir> TYPE pc261, <fs_rt>TYPE pc207.

CALL FUNCTION 'CU_READ_RGDIR'
   EXPORTING
      persnr                   = pernr-pernr
   TABLES
      in_rgdir                 = ltd_rgdir
   EXCEPTIONS
     no_record_found           = 1
     OTHERS=2.

CALL FUNCTION 'PYXX_GET_RELID_FROM_PERNR'
   EXPORTING
      employee                          = pernr-pernr
   IMPORTING
     relid                             = ls_relid
     molga                             = ls_molga
*   EXCEPTIONS
*     ERROR_READING_INFOTYPE_0001       = 1
*     ERROR_READING_MOLGA               = 2
*     ERROR_READING_RELID               = 3
*     OTHERS                            = 4.

LOOP AT ltd_rgdir ASSIGNING <fs_rgdir>.
   CLEAR:ltd_payroll,ltd_rt[].
   CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'
       EXPORTING
          clusterid                          = ls_relid "'IN'
          employeenumber                     = pernr-pernr
          sequencenumber                     =<fs_rgdir>-seqnr
          read_only_international            ='X'
       CHANGING
          payroll_result                     = ltd_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
         error_reading_archive              = 8
         error_reading_relid                = 9
         OTHERS                            = 10.

    ltd_rt[]= ltd_payroll-inter-rt[].

 LOOP AT ltd_rt ASSIGNING <fs_rt>.
   CALL FUNCTION 'RANDOM_AMOUNT'
     EXPORTING
          rnd_min    ='100'
          rnd_max    ='3000'
          valcurr    ='PEN'
     IMPORTING
          rnd_amount = ls_temp_wrbtr.
   REPLACE ALL OCCURRENCES OF ',' IN ls_temp_wrbtr WITH ''.
   CONDENSE ls_temp_wrbtr.

   IF <fs_rt>-betrg > 0.
     <fs_rt>-betrg = ls_temp_wrbtr.
   ENDIF.
 ENDLOOP.

    ltd_payroll-inter-rt[]= ltd_rt[].

  CALLFUNCTION 'PYXX_RESOLVE_PERSON_STRUCTURE'
     EXPORTING
        molga                         = ls_molga
        get_internat_struct           ='X'TABLES
        object_list                   = ltd_object_list
*     EXCEPTIONS
*       DDICTYPE_DOES_NOT_EXIST       = 1
*       OTHERS                        = 2.

 CALLFUNCTION 'PYXX_WRITE_PAYROLL_RESULT'
    EXPORTING
        clusterid                    = ls_relid
        employeenumber               = pernr-pernr
        sequencenumber               =<fs_rgdir>-seqnr
        payroll_result               = ltd_payroll
*        client                       = sy-mandt
    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.
*       MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALLFUNCTION 'HR_FLUSH_BUFFER_UPDATE_PCLX'
*       EXPORTING
*         TEST                      =
*         CLIENT                    =EXCEPTIONS
          insert_error              =1
          no_update_authority       =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.
ENDLOOP.

Regards

-Andres

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • May 24, 2017 at 05:07 PM

    Hey, looks like you posted twice this issue, could you close this one to focus on ABAP HR 'PYXX_WRITE_PAYROLL_RESULT'

    Best,

    Add comment
    10|10000 characters needed characters exceeded