SAP HCM ABAP CLUSTER

From SapWiki
Revision as of 16:42, 26 March 2020 by WikiSysop (talk | contribs) (Created page with "==Modificar Cluster== *Ejemplo de lectura de cluster con modificacion a tabla BT CLEAR rgdir. REFRESH rgdir. CALL FUNCTION 'CU_READ_RGDIR_NEW' EXPORTING pe...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Modificar Cluster

  • Ejemplo de lectura de cluster con modificacion a tabla BT
 CLEAR   rgdir.
 REFRESH rgdir.
 CALL FUNCTION 'CU_READ_RGDIR_NEW'
   EXPORTING
     persnr                = i_pernr
   TABLES
     in_rgdir              = rgdir
   EXCEPTIONS
     no_record_found       = 1
     import_mismatch_error = 2
     no_read_authority     = 3
     OTHERS                = 4.
  check sy-subrc = 0.
 DELETE rgdir WHERE fpper NE i_fpper.
 DESCRIBE TABLE rgdir LINES sy-tfill.
 check sy-tfill > 0.
  LOOP AT rgdir.
   ld_pernr = i_pernr.
   ld_seqnr = rgdir-seqnr.
   CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'
     EXPORTING
       clusterid                    = 'CL'
       employeenumber               = ld_pernr
       sequencenumber               = ld_seqnr
       read_only_buffer             = ' '
     CHANGING
       payroll_result               = ls_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
       OTHERS                       = 8.
* procesar bt
   loop at  ls_result-inter-bt into gs_bt.
     add i_monto to gs_bt-betrg.
     modify ls_result-inter-bt from gs_bt.
   ENDLOOP.
   check sy-subrc = 0.   
   CALL FUNCTION 'PYXX_WRITE_PAYROLL_RESULT'
     EXPORTING
       clusterid                    = 'CL'
       employeenumber               = ld_pernr
       sequencenumber               = ld_seqnr
       payroll_result               = ls_result
     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.
* error
     EXIT.
   ENDIF.
   CALL FUNCTION 'HR_FLUSH_BUFFER_UPDATE_PCLX'
     EXPORTING
       test                = ' '
     EXCEPTIONS
       insert_error        = 1
       no_update_authority = 2
       OTHERS              = 3.
   IF sy-subrc <> 0.
* error
     EXIT.
   ENDIF.