HR06 - Ejemplos de Programacion Hr.doc

47
Programación en Modulo HR  Transacciones HR (Pag 2) Programación en HR o Ejemplo HR_INFOTYPE_OPERATION (Pag 5) o Ejemplo de lectura de cluster (Pag 10) o Ejemplo Lectura IT0008 (Pag 12) o Ejemplo lectura de infotipo con funcion HR_READ_INFOTYPE (Pag 15) o Ejemplos Estructura Organizacional (Pag 20) o Como leer cluster de tiempos (Pag 21) o Como leer Acumuladores (Pag 23) Funciones utiles ABAP HR Prestamos (Pag 24)  Tablas e Infotipos en HR (Pag 26) Ejemplos de Performance (Pag 33) Simulacion en driver de nomina (Pag 37) HR NOTAS (Pag 38) HR FAQ (Pag 39) WebSite: http://globalsap.cl/globalwiki/index.php/HR 1

Transcript of HR06 - Ejemplos de Programacion Hr.doc

Page 1: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 1/47

Programación en

Modulo HR•  Transacciones HR (Pag 2)

• Programación en HR

o Ejemplo HR_INFOTYPE_OPERATION (Pag 5)o Ejemplo de lectura de cluster (Pag 10)

o Ejemplo Lectura IT0008 (Pag 12)

o Ejemplo lectura de infotipo con funcion HR_READ_INFOTYPE

(Pag 15)

o Ejemplos Estructura Organizacional (Pag 20)

o Como leer cluster de tiempos (Pag 21)o Como leer Acumuladores (Pag 23)

• Funciones utiles ABAP HR Prestamos (Pag 24)

•  Tablas e Infotipos en HR (Pag 26)

• Ejemplos de Performance (Pag 33)

• Simulacion en driver de nomina (Pag 37)

• HR NOTAS (Pag 38)

• HR FAQ (Pag 39)

WebSite: http://globalsap.cl/globalwiki/index.php/HR

1

Page 2: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 2/47

Transacciones en HRMaster Data 

PA10 Personnel FilePA20 Display HR Master DataPA30 Maintain HR Master DataPA40 Personnel EventsPA41 Change Hiring DataPA42 Fast Data Entry for EventsPRMD Maintain HR Master DataPRMF Travel Expenses: Feature TRVFDPRML Set Country Grouping via PopupPRMM Personnel EventsPRMO Travel Expenses: Feature TRVCOPRMP Travel Expenses: Feature TRVPAPRMS Display HR Master DataPRMT Update MatchcodePSO3 Infotype overviewPSO4 Individual maintenance of infotypes

Time Management 

PA51 Display Time DataPA53 Display Time DataPA61 Maintain Time DataPA62 List Entry of Additional DataPA63 Maintain Time Data

PA64 Calendar EntryPA70 Fast Data EntryPA71 Fast Entry of Time DataPBAB Maintain vacancy assignmentsPT01 Create Work SchedulePT02 Change Work SchedulePT03 Display Work Schedules

Payroll 

PC_PAYRESULT visualizar resultados de nóminaPC00 Run Payroll

PC10 Payroll menu USAPE00 Starts Transactions PE01,PE02,PE03PE01 SchemasPE02 Calculation RulesPE03 FeaturesPE04 Create functions and operationsPE51 HR form editorPRCA Payroll calendarPRCT Current SettingsPRCU Printing Checks USAPRD1 Create DMESM31 Maintain TablesSM12 Locked Secessions

 TSTC Table lookupSPR0 IMGSE16 Data Browser (Table reports)

2

Page 3: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 3/47

PP03 PD TablesPP0M Change Org UnitP013 Maintain PositionsPO03 Maintain Jobs

Benefits 

PA85 Benefits - Call RPLBEN11PA86 Benefits - Call RPLBEN07PA87 Benefits - Call RPLBEN09PA89 COBRA AdministrationPA90 Benefits Enrollment – IndividualPA91 Benefits - FormsPA92 Benefits Tables - MaintainPA93 Benefits Tables - DisplayPA94 Benefits - Access Reporting TreePA95 Benefits IMG - Jump to ViewsPA96 Benefits reporting

PA97 Salary Administration - MatrixPA98 Salary AdministrationPA99 Compensation Admin. - rel.changesPACP HR-CH: Pension fund, interface

General/Reporting 

PM00 Menu for HR ReportsPM01 Dialogs in HR - Create custom infotypesPRF0 Standard FormPSVT Dynamic Tools MenuPAR1 Flexible employee data

PAR2 Employee listH99CWTR0 : Reporte de CCNominasH99_DISPLAY_PAYRESULT : Ver resultados nomina

PD - Organizational Management 

PP0M Change Org UnitPO03 Maintain JobsPO13 Maintain PositionPO10 Maintain Organizational UnitPP01 Maintain Plan Data (menu-guided)PP02 Maintain Plan Data (Open)PP03 Maintain Plan Data (event-guided)PP05 Number RangesPP06 Number Range Maintenance: HRADATAPP07 Tasks/DescriptionsPP69 Choose Text for Organizational UnitPP90 Set Up OrganizationPPO1 Change Cost Center AssignmentPPO2 Display Cost Center AssignmentPPO3 Change Reporting StructurePPO4 Display Reporting StructurePPO5 Change Object Indicators (O/S)PPO6 Change Object Indicators O/SPPOA Display Menu Interface (with dyn.)

PPOC Create Organizational UnitPPOM Maintain Organizational PlanPPOS Display Organizational Plan

3

Page 4: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 4/47

PQ01 Events for Work CenterPQ02 Events for Training ProgramPQ03 Events for JobPQ04 Events for Business Event TypePQ06 Location EventsPQ07 Resource Events

PQ08 Events for External PersonPQ09 Events for Business Event GroupPQ10 Events for Organizational UnitPQ11 Events for QualificationPQ12 Resource Type EventsPQ13 Events for PositionPQ14 Events for TaskPQ15 Events for CompanyPSO5 PD: Administration ToolsPSOA Work Center ReportingPSOC Job ReportingPSOG OrgManagement General ReportingPSOI Tools Integration PA-PD

PSOO Organizational Unit ReportingPSOS Position ReportingPSOT Task Reporting

Recruitment 

PB10 Init.entry of applicant master dataPB20 Display applicant master dataPB30 Maintain applicant master dataPB40 Applicant eventsPB50 Display applicant actionsPB60 Maintain applicant actions

PB80 Evaluate vacanciesPBA0 Evaluate advertisementsPBA1 Applicant indexPBA2 List of applicationsPBA3 Applicant vacancy assignment listPBA4 Receipt of application

4

Page 5: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 5/47

SAP HR HR INFOTYPE OPERATION

Funcion para crear modificar borrar infotipos

REPORT zprueba_vmg3.

DATA: r_p0014 LIKE p0014.DATA: l_bapireturn LIKE bapireturn1.DATA: bapipakey_tab LIKE bapipakey OCCURS 0 WITH HEADER LINE.DATA: s_importe(20) TYPE c.DATA: m_text LIKE l_bapireturn-message_v1.DATA: m_text2 LIKE l_bapireturn-message_v1.DATA: m_len TYPE i.DATA: importe_avo LIKE p0014-betrg.DATA: importe_avo_e LIKE bapicurr-bapicurr.

DATA: importe_avo2 LIKE p0014-betrg.DATA: num_meses(2) TYPE n.DATA: aux_date_begda TYPE d.DATA: aux_date_endda TYPE d.

* Create the IT0014 recordsLOOP AT tb_bonus INTO wa_bonus.* enqueue the employye  CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'  EXPORTING  number = wa_bonus-pernr  IMPORTING  return = l_bapireturn. 

IF l_bapireturn-id NE space.WRITE: / wa_bonus-pernr, 'Enqueue failed'(003).

  PERFORM applog_msg_add USING '1'wa_bonus-pernr

  'E'  '5A'  '198'

wa_bonus-pernr.

CONTINUE.ENDIF.

 IF wa_bonus-fecha_alta > wa_bonus-begda.

* si fecha alta > inicio de IT0014, se asume begda = fecha de alta* empleado  

r_p0014-begda = wa_bonus-fecha_alta.

ELSE.r_p0014-begda = wa_bonus-begda.

ENDIF.

  IF flag_flag <> 'X'.  IF pa_rbp1 = 'X'.

  PERFORM months_between_dates USING so_febon-lowso_febon-high

5

Page 6: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 6/47

  CHANGING num_meses.ELSE.

  IF wa_bonus-fecha_alta > so_febon-low.

  PERFORM months_between_dates USING wa_bonus-fecha_alta

so_febon-high  CHANGING num_meses.ELSE.

  PERFORM months_between_dates USING so_febon-lowso_febon-high

  CHANGING num_meses.ENDIF.

ENDIF. 

IF num_meses = 0.num_meses = 1.

ENDIF.

  CALL FUNCTION 'BAPI_CURRENCY_CONV_TO_EXTERNAL'  EXPORTING  currency = wa_bonus-waers

amount_internal = wa_bonus-betrg  IMPORTING

amount_external = importe_avo_e. 

importe_avo_e = importe_avo_e / num_meses.importe_avo_e = floor( importe_avo_e ).

 CALL FUNCTION 'BAPI_CURRENCY_CONV_TO_INTERNAL'

  EXPORTING  currency = wa_bonus-waers

amount_external = importe_avo_emax_number_of_digits = '17'

  IMPORTINGamount_internal = importe_avo.

 importe_avo2 = wa_bonus-betrg - ( importe_avo * num_meses ).wa_bonus-betrg = importe_avo.

 ENDIF.

 IF importe_avo2 > 0.aux_date_endda = wa_bonus-endda.

  PERFORM add_month_to_date USING wa_bonus-endda  '-'  '1'  CHANGING aux_date_begda.

r_p0014-endda = aux_date_begda.wa_bonus-endda = aux_date_begda.importe_avo2 = importe_avo2 + importe_avo.

ENDIF.

DO.  IF sy-index > 2.

EXIT.ENDIF.

  CHECK wa_bonus-betrg > 0

  OR flag_flag = 'X'  OR NOT pa_infty IS INITIAL.

6

Page 7: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 7/47

  IF flag_flag = 'X'.* tratamiento special

r_p0014-infty = '0014'.r_p0014-pernr = wa_bonus-pernr.r_p0014-subty = wa_bonus-lgart.r_p0014-anzhl = '1'.

r_p0014-zeinh = cod_unidad_flag.r_p0014-endda = wa_bonus-endda.r_p0014-lgart = wa_bonus-lgart.

 ELSEIF NOT pa_infty IS INITIAL.r_p0014-infty = '0014'.r_p0014-pernr = wa_bonus-pernr.r_p0014-subty = pa_lgart.r_p0014-endda = wa_bonus-endda.r_p0014-anzhl = wa_bonus-anzhl.r_p0014-zeinh = wa_bonus-zeinh.r_p0014-betrg = wa_bonus-betrg.r_p0014-waers = wa_bonus-waers.

  ELSE.r_p0014-infty = '0014'.r_p0014-pernr = wa_bonus-pernr.r_p0014-subty = wa_bonus-lgart.r_p0014-endda = wa_bonus-endda.r_p0014-lgart = wa_bonus-lgart.r_p0014-betrg = wa_bonus-betrg.r_p0014-waers = wa_bonus-waers.

 ENDIF.

* create the IT0014 record   CALL FUNCTION 'HR_INFOTYPE_OPERATION'  EXPORTING

infty = r_p0014-infty  number = r_p0014-pernr

subtype = r_p0014-subtyvalidityend = r_p0014-enddavaliditybegin = r_p0014-begdarecord = r_p0014operation = 'INS'nocommit = pa_test

  IMPORTING  return = l_bapireturn  key = bapipakey_tab  EXCEPTIONS  OTHERS = 0. 

IF NOT l_bapireturn IS INITIAL.* error 

WRITE:/ wa_bonus-pernr,  'Error crear IT0014'(004),

l_bapireturn-message+0(120). 

PERFORM applog_msg_add USING '1'wa_bonus-pernrl_bapireturn-typel_bapireturn-idl_bapireturn-number

l_bapireturn-message_v1l_bapireturn-message_v2l_bapireturn-message_v3

7

Page 8: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 8/47

l_bapireturn-message_v4.ELSE.

  WRITE wa_bonus-betrg TO s_importe CURRENCY wa_bonus-waers.

  CONDENSE s_importe NO-GAPS.  CONCATENATE s_importe wa_bonus-waers INTO s_importe SEPARATED BY

space.m_text = 'IT0014 creado con exito.'.m_text2 = 'CCNom: &1 Monto: &2'.

 REPLACE '&1' WITH pa_lgart INTO m_text2.

  REPLACE '&2' WITH s_importe INTO m_text2. 

m_len = strlen( m_text ). 

WRITE:/ wa_bonus-pernr,m_text(m_len),m_text2.

 

PERFORM applog_msg_add USING '4'wa_bonus-pernr  'S'  'ZPPY_INT'  '000'

wa_bonus-pernrm_textm_text2.

ENDIF. 

IF flag_flag = 'X'  OR NOT pa_infty IS INITIAL.

EXIT.ENDIF.

 * asignamos importe 2 para siguiente "vuelta" del Do 

wa_bonus-betrg = importe_avo2.r_p0014-begda = aux_date_begda + 1.wa_bonus-endda = aux_date_endda.

ENDDO.* Use 'BAPI_EMPLOYEE_DEQUEUE' to un-lock the employee before updating   CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'  EXPORTING  number = wa_bonus-pernr  IMPORTING  return = l_bapireturn.ENDLOOP.

Carga Infotipo 0171

DATA: BEGIN OF entry_dates OCCURS 5.  INCLUDE STRUCTURE hida.DATA: END OF entry_dates.

DATA:

lv_barea TYPE p0171-barea,lv_bengr TYPE p0171-bengr,lv_bstat TYPE p0171-bstat,ld_begda TYPE d.

8

Page 9: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 9/47

DATA: ls_p0171 LIKE p0171.DATA: ls_bapireturn LIKE bapireturn1.DATA: lt_bapipakey_tab LIKE bapipakey OCCURS 0 WITH HEADER LINE.

* enqueue the employye

CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'  EXPORTING  number = current_sapno  IMPORTING  return = ls_bapireturn.

IF ls_bapireturn-id NE space.WRITE: / current_sapno, 'Enqueue failed'(003).EXIT.

ENDIF.

ld_begda(4) = data_in-from_date+6(4).ld_begda+4(2) = data_in-from_date+3(2).

ld_begda+6(2) = data_in-from_date(2).

CALL FUNCTION 'HR_ENTRY_DATE'  EXPORTING

persnr = current_sapno  IMPORTING

entrydate = ld_begda  TABLES

entry_dates = entry_dates  EXCEPTIONS

entry_date_not_found = 1pernr_not_assigned = 2.

IF sy-subrc <> 0.  MESSAGE i016(pn) WITH text-028 current_sapno text-026.EXIT.

ENDIF.

PERFORM get_default_values_for_p0171USINGcurrent_sapnold_begda

CHANGINGlv_barealv_bengrlv_bstat.

ls_p0171-infty = '0171'.ls_p0171-pernr = current_sapno.ls_p0171-begda = ld_begda.ls_p0171-endda = '99991231'.ls_p0171-barea = lv_barea.ls_p0171-bengr = lv_bengr.ls_p0171-bstat = lv_bstat.

CALL FUNCTION 'HR_INFOTYPE_OPERATION'  EXPORTING

infty = ls_p0171-infty  number = ls_p0171-pernr

subtype = ls_p0171-subtyvalidityend = ls_p0171-enddavaliditybegin = ls_p0171-begda

9

Page 10: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 10/47

record = ls_p0171operation = 'INS'nocommit = testrun

  IMPORTING  return = ls_bapireturn  key = lt_bapipakey_tab

  EXCEPTIONS  OTHERS = 0.

IF NOT ls_bapireturn IS INITIAL.

WRITE:/ ls_p0171-pernr,  'Error crear IT0171'(004),

ls_bapireturn-message+0(120).ELSE.WRITE:/ ls_p0171-pernr, 'Registro creado con exito'(001).

ENDIF.

CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'

  EXPORTING  number = current_sapno  IMPORTING  return = ls_bapireturn.

10

Page 11: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 11/47

SAP HR ABAP LECTURA CLUSTER

Ejemplo 1 lectura de estructura ARRS

DATA: ld_msg(100).DATA: ld_relid LIKE t500l-relid.DATA: BEGIN OF it_rgdir OCCURS 0.  INCLUDE STRUCTURE pc261.DATA: END OF it_rgdir.DATA: ls_arrrs LIKE pc22z.

CLEAR gt_rgdir[].

CALL FUNCTION 'CA_CU_READ_RGDIR_NEW'  EXPORTING

persnr = pernr-pernr  IMPORTINGmolga = gd_molga

  TABLEScu_ca_rgdir = gt_rgdir

  EXCEPTIONSimport_mismatch_error_cu = 1import_mismatch_error_ca = 2no_read_authority_ca = 3no_read_authority_cu = 4error_reading_cu = 5error_reading_ca = 6no_record_found = 7

  OTHERS = 8.

IF sy-subrc <> 0.  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 INTO ld_msg.p_subrc = 4.EXIT.

ENDIF.

DELETE gt_rgdir WHERE  NOT ( fpend BETWEEN pn-begda AND pn-endda ).

PERFORM read_relid USING gd_molga ld_relid.

LOOP AT gt_rgdir INTO gs_rgdir WHERE srtza = 'A'.

  CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'  EXPORTING

clusterid = ld_relidemployeenumber = pernr-pernrsequencenumber = gs_rgdir-seqnrread_only_international = 'X'

  CHANGINGpayroll_result = gt_result

  EXCEPTIONSillegal_isocode_or_clusterid = 1error_generating_import = 2import_mismatch_error = 3subpool_dir_full = 4no_read_authority = 5

11

Page 12: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 12/47

no_record_found = 6versions_do_not_match = 7

  OTHERS = 8.

  IF sy-subrc <> 0.  IF sy-subrc = 5.

p_subrc = 4.ENDIF.EXIT.

ENDIF.

gt_alv_data-fpper = gs_rgdir-fpper.gt_alv_data-waers = gt_result-inter-versc-waers.

  LOOP AT gt_result-inter-arrrs INTO ls_arrrs.  MOVE-CORRESPONDING ls_arrrs TO gt_alv_data.  APPEND gt_alv_data.ENDLOOP.

ENDLOOP.

12

Page 13: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 13/47

SAP HR ABAP BAPI BASICPAY 

GETDETAIL

Ejemplo de BAPI 'BAPI_BASICPAY_GETDETAIL'para leer el IT0008

Ojo que esta BAPI calcula los conceptos indirectos :-)

DATA: ld_amount_external LIKE bapicurr-bapicurr.DATA: lt_return LIKE TABLE OF bapireturn1 WITH HEADER LINE.

CLEAR gt_bapi_wagetypes[].

CALL FUNCTION 'BAPI_BASICPAY_GETDETAIL'  EXPORTING

employeenumber = p0008-pernrsubtype = p0008-subtyobjectid = p0008-objpslockindicator = p0008-sprpsvaliditybegin = p0008-begdavalidityend = p0008-enddarecordnumber = p0008-seqnr

  IMPORTING

  return = lt_return  TABLES

wagetypes = gt_bapi_wagetypes.

Ejemplo 2, Aca soluciona problema conautorizacion en IT0008

DATA: ld_amount_external LIKE bapicurr-bapicurr.DATA: lt_return LIKE TABLE OF bapireturn1 WITH HEADER LINE.

DATA: lt_p0008 LIKE TABLE OF p0008 WITH HEADER LINE.DATA: ld_number_of_lgart_in_p0008 TYPE i.DATA: fname LIKE pprop-fname.

  FIELD-SYMBOLS <field_value>.DATA: molga LIKE t001p-molga,

* WAGETYPENO LIKE T539S-LGANR,

wagetypeno(2) TYPE n,amount LIKE gt_bapi_wagetypes-amount,

  number LIKE gt_bapi_wagetypes-number,indvaluation LIKE gt_bapi_wagetypes-indvaluat,addtotalamount LIKE gt_bapi_wagetypes-addtotamnt,number_of_lgart_in_p0008 TYPE i VALUE 20,currencyexpstring LIKE sy-msgv1.

  CLEAR gt_bapi_wagetypes[].  CLEAR p_sumbb.  CHECK p0008 IS NOT INITIAL.

13

Page 14: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 14/47

 CALL FUNCTION 'RP_NUMBER_OF_WAGETYPES_0008'

IMPORTING wt_count = ld_number_of_lgart_in_p0008.

REFRESH gt_bapi_wagetypes.* DO 20 TIMES.

DO number_of_lgart_in_p0008 TIMES.CLEAR gt_bapi_wagetypes.

  MOVE sy-index TO wagetypeno. 

CONCATENATE 'P0008-LGA' wagetypeno INTO fname.  ASSIGN (fname) TO <field_value>.  MOVE <field_value> TO gt_bapi_wagetypes-wagetype. 

CONCATENATE 'P0008-IND' wagetypeno INTO fname.  ASSIGN (fname) TO <field_value>.  MOVE <field_value> TO gt_bapi_wagetypes-indvaluat. 

CONCATENATE 'P0008-BET' wagetypeno INTO fname.  ASSIGN (fname) TO <field_value>. 

CALL FUNCTION 'BAPI_CURRENCY_CONV_TO_EXTERNAL'  EXPORTING  currency = p0008-waers

amount_internal = <field_value>  IMPORTING

amount_external = gt_bapi_wagetypes-amount  EXCEPTIONS  OTHERS = 0. 

IF sy-subrc NE 0.

ENDIF.  CONCATENATE 'P0008-ANZ' wagetypeno INTO fname.  ASSIGN (fname) TO <field_value>.  MOVE <field_value> TO gt_bapi_wagetypes-number.  CONCATENATE 'P0008-EIN' wagetypeno INTO fname.  ASSIGN (fname) TO <field_value>.  MOVE <field_value> TO gt_bapi_wagetypes-timeunit.  CONCATENATE 'P0008-OPK' wagetypeno INTO fname.  ASSIGN (fname) TO <field_value>.  MOVE <field_value> TO gt_bapi_wagetypes-operindic.

  PERFORM re512t USING gt_bapi_wagetypes-wagetype  '99'  CHANGING gt_bapi_wagetypes-nameofwagetype.  IF NOT gt_bapi_wagetypes-wagetype IS INITIAL. "no wagetype, no entry 

  APPEND gt_bapi_wagetypes.ENDIF.

ENDDO.

  CALL FUNCTION 'HR_READ_INFOTYPE_AUTHC_DISABLE'  EXCEPTIONS  OTHERS = 1. CALL FUNCTION 'BAPI_BASICPAYEVALUATEWAGETYPES'

  EXPORTING

employeenumber = pernr-pernrstartindvaluation = pn-enddacountrygrouping = '99'

14

Page 15: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 15/47

payscaletype = p0008-trfarpayscalearea = p0008-trfgbpayscalegroup = p0008-trfgrpayscalelevel = p0008-trfstcurrencyimp = p0008-waerscapacityutilization = p0008-bsgrd

hoursworked = p0008-divgv  IMPORTING  return = lt_return  TABLES

wagetypes = gt_bapi_wagetypes  EXCEPTIONS  OTHERS = 0. IF NOT lt_return IS INITIAL.

  IF lt_return-type = 'S'.CLEAR lt_return.

ENDIF.ENDIF.

  LOOP AT gt_bapi_wagetypes WHERE addtotamnt = 'X'.  ADD gt_bapi_wagetypes-amount TO ld_amount_external.ENDLOOP.

 IF p0008-waers IS INITIAL.p0008-waers = 'CLP'.

ENDIF. CALL FUNCTION 'BAPI_CURRENCY_CONV_TO_INTERNAL'

  EXPORTING  currency = p0008-waers

amount_external = ld_amount_externalmax_number_of_digits = 15

 IMPORTINGamount_internal = p_sumbb

15

Page 16: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 16/47

SAP HR ABAP HR READ INFOTYPE

FUNCION HR_READ_INFOTYPE PARA LEER DATOSINFOTIPO

FUNCTION z_rfc_zhrcbbrp051.*"----------------------------------------------------------------------*"*"Interfase local*" IMPORTING*" VALUE(PERNR) TYPE PERNR-PERNR*" VALUE(FPPER) TYPE FPPER*" EXPORTING*" VALUE(E_PERDATA) LIKE ZST_CERT_RENTA STRUCTURE ZST_CERT_RENTA*" VALUE(RETORNO1) LIKE SY-MSGTY*" VALUE(RETORNO2) LIKE T100-TEXT

*" VALUE(RETORNO3) LIKE SY-MSGV1*" TABLES*" WAGETYPES STRUCTURE BAPIP0008P*"----------------------------------------------------------------------DATA ld_subrc LIKE sy-subrc.DATA lt_0001 LIKE TABLE OF p0001 WITH HEADER LINE.DATA lt_0002 LIKE TABLE OF p0002 WITH HEADER LINE.DATA lt_0041 LIKE TABLE OF p0041 WITH HEADER LINE.DATA lt_9003 LIKE TABLE OF p9003 WITH HEADER LINE.DATA lt_9007 LIKE TABLE OF p9007 WITH HEADER LINE.DATA lt_0008 LIKE TABLE OF p0008 WITH HEADER LINE.DATA lt_0014 LIKE TABLE OF p0014 WITH HEADER LINE.DATA ld_fec_con TYPE d.DATA ld_molga LIKE t500p-molga.DATA ld_auxtabix LIKE sy-tabix.DATA: ld_begda TYPE d,

ld_endda TYPE d.* cc nominas de infotipo 0008PERFORM init_lgart_0008.

** cc nominas de infotipo 0014PERFORM init_lgart_0014.

** fecha de certificado* perform spell_fecha using fecha* changing e_perdata-FECer_TXT.e_perdata-pernr = pernr.e_perdata-fecer = sy-datlo.

*CALL FUNCTION 'HR_READ_INFOTYPE_AUTHC_DISABLE'ld_begda = fpper.ld_begda+6(2) = '01'.PERFORM last_day_in_month(sapfp500) USING ld_begda

ld_endda.*----------------------------------------------------------------------** leer datos infotipo 0001*----------------------------------------------------------------------*CALL FUNCTION 'HR_READ_INFOTYPE'

EXPORTING* TCLAS = 'A'

pernr = pernrinfty = '0001'begda = ld_begdaendda = ld_endda

IMPORTINGsubrc = ld_subrc

TABLES

16

Page 17: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 17/47

infty_tab = lt_0001.LOOP AT lt_0001.ENDLOOP.IF sy-subrc = 0.

SELECT SINGLE butxt INTO e_perdata-butxt FROM t001WHERE bukrs = lt_0001-bukrs.

SELECT SINGLE ptext INTO e_perdata-ptext

FROM t501t WHERE sprsl = sy-langu ANDpersg = lt_0001-persg .

IF sy-subrc NE 0.SELECT SINGLE ptext INTO e_perdata-ptext

FROM t501t WHERE sprsl = 'S' ANDpersg = lt_0001-persg .

ENDIF.ELSE.

* sin datosMOVE:

'E' TO retorno1,'SIN DATOS' TO retorno2,

TO retorno3.EXIT.

ENDIF.*----------------------------------------------------------------------** Leer datos Infotipo 0002*----------------------------------------------------------------------*CALL FUNCTION 'HR_READ_INFOTYPE'

EXPORTING* TCLAS = 'A'

pernr = pernrinfty = '0002'begda = ld_begdaendda = ld_endda

IMPORTINGsubrc = ld_subrc

TABLES

infty_tab = lt_0002.LOOP AT lt_0002.ENDLOOP.IF sy-subrc = 0.

* tratamientoSELECT SINGLE atext INTO e_perdata-atext FROM t522t

WHERE sprsl = sy-languAND anred = lt_0002-anred.

IF sy-subrc NE 0.SELECT SINGLE atext INTO e_perdata-atext FROM t522t

WHERE sprsl = 'S'AND anred = lt_0002-anred.

ENDIF.e_perdata-vorna = lt_0002-vorna. "Nombres

e_perdata-nachn = lt_0002-nachn. "1er apellidoe_perdata-name2 = lt_0002-name2. "2do apellidoe_perdata-zzhr_rut = lt_0002-zzhr_rut. "rut

ENDIF.*----------------------------------------------------------------------** Leer datos Infotipo 0041*----------------------------------------------------------------------*CALL FUNCTION 'HR_READ_INFOTYPE'

EXPORTING* TCLAS = 'A'

pernr = pernrinfty = '0041'begda = ld_begdaendda = ld_endda

IMPORTINGsubrc = ld_subrc

TABLESinfty_tab = lt_0041.

17

Page 18: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 18/47

LOOP AT lt_0041.ENDLOOP.IF sy-subrc EQ 0.

* leer fecha de contratacionPERFORM leer_fecha_i0041 USING lt_0041

'02'CHANGING ld_fec_con.

e_perdata-fecon = ld_fec_con.* perform spell_fecha using ld_fec_con* changing e_perdata-FECON_TXT.ENDIF.

*--------------------------------------------------------------------** leer datos afp*--------------------------------------------------------------------*CALL FUNCTION 'HR_READ_INFOTYPE'

EXPORTING* TCLAS = 'A'

pernr = pernrinfty = '9003'begda = ld_begdaendda = ld_endda

IMPORTINGsubrc = ld_subrc

TABLESinfty_tab = lt_9003.

LOOP AT lt_9003.ENDLOOP.IF sy-subrc = 0.

DATA ld_f_pens LIKE z7cl_afp0-f_pens.DATA ld_seg_inval LIKE z7cl_afp0-seg_inval.SELECT SINGLE glosa_afp f_pens seg_inval INTO

(e_perdata-glosa_afp,ld_f_pens, ld_seg_inval)FROM z7cl_afp0

WHERE cod_afp = lt_9003-cod_afp ANDendda >= ld_begda AND

begda <= ld_endda.IF sy-subrc = 0.e_perdata-porafp = ld_f_pens + ld_seg_inval .

ENDIF.ENDIF.

*--------------------------------------------------------------------** leer datos isapre*--------------------------------------------------------------------*CALL FUNCTION 'HR_READ_INFOTYPE'

EXPORTING* TCLAS = 'A'

pernr = pernrinfty = '9007'begda = ld_begda

endda = ld_enddaIMPORTINGsubrc = ld_subrc

TABLESinfty_tab = lt_9007.

LOOP AT lt_9007.ENDLOOP.IF sy-subrc = 0.

SELECT SINGLE molga INTO ld_molgaFROM t500p WHERE persa = lt_0001-werks.

SELECT SINGLE isapre porcentaje INTO(e_perdata-isapre,e_perdata-porisa)

FROM z7cl_isa0WHERE codigo = lt_9007-codigo AND

zplan = lt_9007-zplan ANDmolga = ld_molga AND

hasta >= ld_begda ANDdesde <= ld_endda.

18

Page 19: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 19/47

ENDIF.*--------------------------------------------------------------------** leer datos de infotipo 0008*--------------------------------------------------------------------*CALL FUNCTION 'HR_READ_INFOTYPE'

EXPORTING* TCLAS = 'A'

pernr = pernrinfty = '0008'begda = ld_begdaendda = ld_endda

IMPORTINGsubrc = ld_subrc

TABLESinfty_tab = lt_0008.

LOOP AT lt_0008.ENDLOOP.IF sy-subrc = 0.

PERFORM get_p0008_detail TABLES gt_bapi_wagetypesUSING lt_0008 .

LOOP AT gt_bapi_wagetypes.

IF NOT gt_bapi_wagetypes-wagetype IN ra_lgart_0008.DELETE gt_bapi_wagetypes.

ELSE.IF gt_bapi_wagetypes-amount < 0.

gt_bapi_wagetypes-amount = gt_bapi_wagetypes-amount * -1.MODIFY gt_bapi_wagetypes.

ENDIF.ENDIF.

ENDLOOP.ENDIF.

*----------------------------------------------------------------------** Leer datos Infotipo 0014*----------------------------------------------------------------------*CALL FUNCTION 'HR_READ_INFOTYPE'

EXPORTING* TCLAS = 'A'pernr = pernrinfty = '0014'begda = ld_begdaendda = ld_endda

IMPORTINGsubrc = ld_subrc

TABLESinfty_tab = lt_0014.

LOOP AT lt_0014.ld_auxtabix = sy-tabix.IF NOT lt_0014-lgart IN ra_lgart_0014.DELETE lt_0014 INDEX ld_auxtabix.

ELSE.CLEAR gt_bapi_wagetypes.CALL FUNCTION 'BAPI_CURRENCY_CONV_TO_EXTERNAL'

EXPORTINGcurrency = lt_0014-waersamount_internal = lt_0014-betrg

IMPORTINGamount_external = gt_bapi_wagetypes-amount.

gt_bapi_wagetypes-wagetype = lt_0014-lgart.*gt_bapi_wagetypes-NAMEOFWAGETYPE* Texto CC Nómina

SELECT SINGLE lgtxt INTO gt_bapi_wagetypes-nameofwagetypeFROM t512t

WHERE sprsl = sy-languAND molga = ld_molgaAND lgart = lt_0014-lgart.

APPEND gt_bapi_wagetypes.ENDIF.

19

Page 20: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 20/47

ENDLOOP.LOOP AT gt_bapi_wagetypes.

IF gt_bapi_wagetypes-amount = 0.DELETE gt_bapi_wagetypes.

ELSE.ADD gt_bapi_wagetypes-amount TO e_perdata-total_bruto.

ENDIF.

ENDLOOP.wagetypes[] = gt_bapi_wagetypes[].

ENDFUNCTION.

*&---------------------------------------------------------------------**& Form leer_fecha_i0041*&---------------------------------------------------------------------***----------------------------------------------------------------------** -->P0041 I0041 record* -->id_date class of date* <--date output date*----------------------------------------------------------------------*FORM leer_fecha_i0041 USING p0041 LIKE p0041

value(id_date) TYPE datarCHANGING date.

FIELD-SYMBOLS <f>.DATA cont(2) TYPE n.DATA campo1(11) VALUE 'P0041-DARXX'.DATA campo2(11) VALUE 'P0041-DATXX'.cont = 1.

* search from the fields p0041-darxx one who have a value* of id_date, then the date is the corresponding P0041-datxx fieldDO 12 TIMES.

campo1+9(2) = cont.campo2+9(2) = cont.ASSIGN (campo1) TO <f>.IF <f> = id_date.

ASSIGN (campo2) TO <f>.date = <f>.EXIT.

ENDIF.ADD 1 TO cont.

ENDDO.ENDFORM.

*&---------------------------------------------------------------------**& Form get_p0008_detail*&---------------------------------------------------------------------*FORM get_p0008_detail TABLES gt_bapi_wagetypes STRUCTURE bapip0008p

USING p0008 LIKE p0008.DATA ld_amount_external LIKE bapicurr-bapicurr.

DATA lt_return LIKE TABLE OF bapireturn1 WITH HEADER LINE.CLEAR gt_bapi_wagetypes[].CALL FUNCTION 'BAPI_BASICPAY_GETDETAIL'

EXPORTINGemployeenumber = p0008-pernrsubtype = p0008-subtyobjectid = p0008-objpslockindicator = p0008-sprpsvaliditybegin = p0008-begdavalidityend = p0008-enddarecordnumber = p0008-seqnr

IMPORTINGreturn = lt_return

TABLESwagetypes = gt_bapi_wagetypes.

ENDFORM.

20

Page 21: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 21/47

SAP HR ABAP ORG

Ejemplo 1Obtiene estructura organizacional de "arriba hacia abajo", dado un codigo deorganizacion inicial. Ojo que es recursiva.

REPORT ytes_hr_org. TABLES hrp1001.DATA: BEGIN OF gt_org OCCURS 0,

orgid_sup LIKE hrp1001-objid, "Org superiororgid LIKE hrp1001-objid, "Orgpos TYPE i, "jerarquia dentro de Org.

END OF gt_org.

PARAMETERS p_orgid LIKE hrp1001-objid.

START-OF-SELECTION.PERFORM get_org USING space

p_orgid0.

*&---------------------------------------------------------------------**& Form get_org*&---------------------------------------------------------------------*

FORM get_org USING p_orgid_supp_orgidvalue(p_pos).

DATA: BEGIN OF lt_org OCCURS 0,sobid LIKE hrp1001-sobid,

END OF lt_org.DATA ld_objid LIKE hrp1001-objid.gt_org-orgid_sup = p_orgid_sup.gt_org-orgid = p_orgid.gt_org-pos = p_pos.APPEND gt_org.ADD 1 TO p_pos.SELECT sobid INTO TABLE lt_org FROM hrp1001

WHERE otype = 'O'AND objid = p_orgidAND plvar = '01'AND rsign = 'B'AND relat = '002'AND sclas = 'O'AND istat EQ '1'AND begda LE sy-datumAND endda GE sy-datum.

IF sy-subrc NE 0.EXIT.

ELSE.LOOP AT lt_org.MOVE lt_org-sobid TO ld_objid.PERFORM get_org USING p_orgid

ld_objidp_pos.

ENDLOOP.ENDIF.

ENDFORM. "get_org

21

Page 22: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 22/47

SAP HR ABAP CLUSTER TIEMPO

Ejemplo 1

• OJO usar base de datos PNP

 TABLES: pernr.INFOTYPES : 0001,

0002,0007,0008,2001.

*&---------------------------------------------------------------------** time managment related

*&---------------------------------------------------------------------* TABLES: pcl1,pcl2.

INCLUDE rpppxd00. "data for PCL1/2 buffer*include rpppxm00. "standard routines for buffering the data inmacrosdata: begin of common part buffer.INCLUDE rpppxd10.DATA: END OF COMMON PART.INCLUDE rpc2b200.

START-OF-SELECTION.

GET pernr.PERFORM read_time.

END-OF-SELECTION.INCLUDE rpppxm00.

*&---------------------------------------------------------------------**& Form read_time*&---------------------------------------------------------------------** text*----------------------------------------------------------------------*FORM read_time.b2-key-pernr = pernr-pernr. "Personnel numberb2-key-pabrp = pn-begda+4(2). "payroll periodb2-key-pabrj = pn-begda(4). "payroll yearb2-key-cltyp = '1'. "originalrp-imp-c2-b2.IF sy-subrc = 0.

* theorically bonus by time conceptLOOP AT zl WHERE lgart IN rt_lgart_bono

AND lgart IN so_lgart.ADD zl-anzhl TO gs_rec-ntubo.

ENDLOOP.LOOP AT so_lgart.LOOP AT zl WHERE lgart = so_lgart-low.gs_rec-cctpo = zl-lgart.ADD 1 TO gs_rec-nutpo.

ENDLOOP.ENDLOOP.

ENDIF.ENDFORM. "read_time

Ejemplo 2

22

Page 23: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 23/47

usar funcion 'HR_TIME_RESULTS_IN_INTERVAL' ejemplo

CALL FUNCTION 'HR_TIME_RESULTS_IN_INTERVAL'EXPORTING

int_pernr = work_pernrint_begda = levp-fpbeg

int_endda = in_period_endTABLESint_time_results = time_results

EXCEPTIONSwrong_cluster_version = 1no_read_authority = 2cluster_archived = 3technical_error = 4OTHERS = 5.

REFRESH complete_zl.REFRESH summary_zl.LOOP AT time_results INTO time_result.APPEND LINES OF time_result-zl TO complete_zl.APPEND LINES OF time_result-qtacc TO qtacctab.

APPEND LINES OF time_result-psp TO psptab.APPEND LINES OF time_result-qttrans TO qttranstab.* Build up a ZL table that is based on the date and wagetype* Everything else is cleared. This will achieve a hour total* on a day by day basis per wagetype.

LOOP AT time_result-zl INTO zl.CLEAR zl-beguz.CLEAR zl-enduz.CLEAR zl-alznr.CLEAR zl-c1znr.CLEAR zl-abznr.CLEAR zl-iftyp.CLEAR zl-prznr.COLLECT zl INTO summary_zl.

ENDLOOP.ENDLOOP.

23

Page 24: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 24/47

SAP HR ABAP LEER ACUMULADORESDATA:

char96(96), "char-feld fuer 96 char 0/1hexin(12) TYPE x, "hex feld fuer 96 bit 0/1x128 TYPE x VALUE '80',hex TYPE x, hextm TYPE x,ps TYPE p, pc TYPE p.

DATA: pack TYPE p,pack1 TYPE p,pack2 TYPE p.DATA gd_num TYPE i.DATA gd_res(1) TYPE c.gd_num = '85'. "acummulates in /185PERFORM get_kumul USING gd_num

gs_t512w-lgartgs_t512w-kumul

CHANGING gd_res.IF gd_res EQ 'X'.* acumula => do somethingENDIF.

*---------------------------------------------------------------------** FORM HEXINCHAR **---------------------------------------------------------------------*FORM hexinchar USING anzahl. "und Feld HEXIN.IF NOT hexin IS INITIAL.

* maximale Laenge HEXINPUT ist 12 = L'HEXIN bzw. L'CHAR96/8 s. a. MAXdo anzahl timesvarying hex from hexin(1) next hexin+1(1) range hexin."UC XMSSHIFT char96 BY 8 PLACES.ps = 0. "set sumpc = 10000000. "set charhextm = x128. "set hex

DO 8 TIMES.IF hex O hextm. ps = ps + pc. ENDIF.hextm = hextm / 2. pc = pc / 10.

ENDDO.UNPACK ps TO char96+88(8).

ENDDO.ps = ( 12 - anzahl ) * 8. "MAX = 12, maximale Laenge HEXINPUTSHIFT char96 BY ps PLACES. "linksbuendig nach CHAR96

ENDIF.ENDFORM. "END OF HEXINCHAR*---------------------------------------------------------------------** FORM GET_KUMUL **---------------------------------------------------------------------*FORM get_kumul USING gc_num TYPE i

gc_lgart TYPE lgartp_kumul

CHANGING gc_acum TYPE c.DATA gc_kumula LIKE char96.CLEAR: char96, hexin.CLEAR gc_acum.hexin = p_kumul.PERFORM hexinchar USING 12.gc_kumula = char96.IF gc_kumula IS NOT INITIAL.

pack = gc_num - 1. "vklas-kl - 1.SHIFT gc_kumula BY pack PLACES.IF gc_kumula(1) EQ '1'.gc_acum = 'X'.

ELSE.gc_acum = space.ENDIF.

ENDIF.

24

Page 25: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 25/47

ENDFORM. "get_kumul

25

Page 26: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 26/47

SAP HR PRESTAMOS ABAP

FUNCIONES UTILES MODULO PRESTAMOScl_hrpa_loan_computations=>compute_estimated_end_of_loancl_hrpa_loan_computations=>read_payments_for_loan_idcl_hrpa_loan_computations=>compute_repayment_plan

EJEMPLO

*&---------------------------------------------------------------------**& Report Y_TEST_LOAN*&*&---------------------------------------------------------------------**&*&*&---------------------------------------------------------------------*REPORT y_test_loan.

 TABLES pernr.INFOTYPES: 0045.DATA instance TYPE REF TO cl_hrpa_loan_computations.DATA gd_pclo_id TYPE pclo_id.DATA gd_estimated_end_of_loan TYPE d.DATA data_ref TYPE REF TO data.DATA gd_message_handler TYPE REF TO if_hrpa_message_handler.DATA gt_pagos TYPE pclo_payments_tab.DATA gt_p0078_tab TYPE p0078_tab.DATA: gt_pclo_repay_tab TYPE pclo_repay_tab,

gt_pclo_loan_changes_tab TYPE pclo_loan_changes_tab.* create dummy message handlerDATA dummy_handler TYPE REF TO cl_hrpa_dummy_message_handler.CREATE OBJECT dummy_handler.message_handler = dummy_handler.

START-OF-SELECTION.

GET pernr.PROVIDE * FROM p0045 BETWEEN pn-begda AND pn-endda.

CALL METHOD cl_hrpa_loan_computations=>get_loan_id_from_p0045

EXPORTINGp0045 = p0045

RECEIVINGloan_id = gd_pclo_id.

* CALCULO DE FECHA FINAL PRESTAMOtry.

CALL METHOD cl_hrpa_loan_computations=>compute_estimated_end_of_loanEXPORTING

tclas = 'A'loan_id = gd_pclo_idmessage_handler = dummy_handler

RECEIVINGestimated_end_of_loan = gd_estimated_end_of_loan.

endtry.

* PAGOS DE PRESTAMOtry.CALL METHOD cl_hrpa_loan_computations=>read_payments_for_loan_id

26

Page 27: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 27/47

EXPORTINGtclas = 'A'loan_id = gd_pclo_id

* ZAHLA = '*'* SPRPS = '*'* BEGDA = LOW_DATE* ENDDA = HIGH_DATE

* NO_AUTH_CHECK = FALSEIMPORTINGpayments_tab = gt_pagos

* DATA_EXISTS =* MISSING_AUTH =

.catch cx_hrpa_violated_assertion .endtry.

try.CALL METHOD cl_hrpa_loan_computations=>read_p0078_for_loan_idEXPORTING

tclas = 'A'loan_id = gd_pclo_id

* ZAHLA = '*'* SPRPS = '*'* BEGDA = LOW_DATE* ENDDA = HIGH_DATE* NO_AUTH_CHECK = FALSE

IMPORTINGp0078_tab = gt_p0078_tab

* DATA_EXISTS =* MISSING_AUTH =

.catch cx_hrpa_violated_assertion .endtry.

* GENERAR PLAN DE AMORTIZACIONtry.

CALL METHOD cl_hrpa_loan_computations=>compute_repayment_planEXPORTINGtclas = 'A'loan_id = gd_pclo_id

* NEW_CURRENCY =message_handler = dummy_handler

IMPORTINGrepayment_plan = gt_pclo_repay_tabloan_changes = gt_pclo_loan_changes_tab

* IS_OK =.

catch cx_hrpa_violated_assertion .endtry.

ENDPROVIDE.

END-OF-SELECTION.

27

Page 28: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 28/47

SAP HR TABLAS INFOTIPOSCATSCO Cross-Application Time Sheet (CATS)- Transfer

to CO

CATSDB CATS- Database Table for Time Sheet

CATSHR Cross-Application Time Sheet (CATS)- Transfer

to HR

CATSMM Cross-Application Time Sheet (CATS)- Transfer

to MM

CATSPM Cross-Application Time Sheet (CATS)- Transfer

to PM/CS

CATSPS Cross-Application Time Sheet (CATS)- Transfer

to PS

CSKS Cost Center Master Data

CSKT Cost Center Texts

PCL1 HR Cluster 1

PCL2 HR Cluster 2

 T001P Personnel Area/Subarea

 T001T Company code-dependent texts

 T500L Personnel Country Grouping

 T500P Personnel Areas

 T502T Marital Status Designators

 T503 Employee Group/Subgroup

 T503T Employee Subgroup Names T508A Work Schedule Rules

 T510 Pay Scale Groups

 T510A Pay Scale Types

 T510F Assign Pay Scale --- Currency

 T510W Pay Scale - Period Parameter Assignment

 T511 Wage Types

 T512T Wage Type Texts

 T512W Wage Type Valuation

 T512Z Permissibility of Wage Types per Infotype

 T527X Organizational Units

 T528T Position Texts

 T529T Personnel Action Texts

 T529U Status Values

 T530 Reasons for Actions

 T530T Reason for Action Texts

 T549A Payroll Accounting Areas

 T549Q Payroll Periods

 T550A Daily Work Schedule

 T550S Daily Work Schedule Texts

 T551S Period Work Schedule Texts

 T552A Monthly Work Schedule T554C Absence Valuation

 T554S Attendance and Absence Types

 T554T Attendance and Absence Texts

 T558B Payroll Account Transfer- Payroll Periods

 T569V Control Records

 T5K8C Transfer ext. payroll results into Canadian

specific tables

 T74FA Benefit insurance plan

 T74FC Benefits Insurance Coverage Rule

HRP1000 Infotype 1000 DB Table (Objects)

HRP1001 Infotype 1001 DB Table (Relationships)

HRP1002 Infotype 1002 DB Table

HRP1003 Infotype 1003 DB Table

HRP1004 Infotype 1004 DB table

HRP1005 DB Table for Infotype 1005 (Planned

Compensation)

HRP1006 Infotype 1006 DB table

HRP1007 Infotype 1007 DB Table

HRP1008 Infotype 1008 DB Table

HRP1009 Infotype 1009 DB table

HRP1010 Infotype 1010 DB table

HRP1011 Infotype 1011 DB Table

HRP1013 Infotype 1013 DB Table

HRP1014 Infotype 1014 DB TableHRP1015 Infotype 1015 DB table

HRP1016 Infotype 1016 DB Table

HRP1017 Infotype 1016 DB Table

HRP1018 DB Table for Infotype 1018 Cost Distribution

HRP1019 DB Table for Infotype 1019 Required Positions

HRP1020 Infotype 1020 DB table

HRP1021 INFOTYPE 1021 DB TABLE

HRP1023 Infotype 1023 DB table

HRP1024 INFOTYPE 1024 DB TABLE

HRP1025 INFOTYPE 1025 DB TABLE

HRP1026 Infotype 1026 DB table

HRP1027 Infotype 1027 DB table

HRP1028 Infotype 1028 DB Table

HRP1029 Infotype 1029 DB table

HRP1030 Infotype 1030 DB table

HRP1031 Infotype 1031 DB table

HRP1032 Infotype 1032 DB Table

HRP1033 DB table for infotype 1033

HRP1034 Infotype 1034 DB table

HRP1035 Infotype 1035 DB Table

HRP1036 Infotype 1036 DB tableHRP1037 Infotype 1037 DB Table

HRP1038 Infotype 1038 DB table

28

Page 29: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 29/47

HRP1039 Database Table for Infotype 1039

HRP1040 Database Table for Infotype 1040

HRP1041 DB Table for Infotype 1041

HRP1042 Infotype 1042 DB Table

HRP1043 DB Table for Infotype 1043

HRP1044 DB Table for Infotype 1044HRP1045 DB Table for Infotype 1045

HRP1046 Database Table for Infotype 1046

HRP1047 DB Table for Infotype 1047

HRP1048 DB Table for Infotype 1048

HRP1049 Database Tables for Infotype 1049

HRP1050 DB Table for Infotype 1050 (Job Evaluation

Results)

HRP1051 DB Table for Infotype 1051 (Survey Results)

HRP1060 DB Table for Infotype 1060

HRP1061 DB Table for Infotype 1061

HRP1062 DB Table for Infotype 1062

HRP1063 DB Table for Infotype 1063

HRP1201 Infotype 1201 DB Table

HRP1205 Infotype 1205 DB Table

HRP1206 Infotype 1206 DB Table

HRP1208 Infotype 1208 DB Table

HRP1209 Infotype 1209 DB Table

HRP1210 Infotype 1210 DB Table

HRP1211 Infotype 1211 DB Table

HRP1212 Infotype 1212 DB Table

HRP1213 Infotype 1213 DB Table

HRP1214 Infotype 1214 DB Table

HRP1215 Infotype 1215 DB Table

HRP1216 Infotype 1216 DB Table

HRP1217 Infotype 1217 DB Table

HRP1218 DB Table for Infotype 1218

HRP1220 DB Table for Infotype 1220 Activity Profile

HRP1221 DB Table for Infotype 1221 Excluded Activities

HRP1222 Infotype 1222- General attribute maintenance

HRP1230 DB Table for Infotype 1230

HRP1240 DB Table for Infotype 1240

HRP1250 DB table for infotype 1250HRP1251 DB table for infotype 1251

HRP1252 DB table for infotype 1252

HRP1253 DB table for infotype 1253

HRP1254 DB Table for Infotype 1254

HRP1260 DB Table for Infotype 1260

HRP1270 DB Table for Info Type 1270

HRP1403 DB table for infotype 1403

HRP1404 DB table for infotype 1404

HRP1500 DB Table for Infotype 1500

HRP1501 DB Table for Infotype 1501

HRP1502 DB Table for Infotype 1502

HRP1503 DB Table for Infotype 1503

HRP1504 DB Table for Infotype 1504

HRP1505 DB Table for Infotype 1505

HRP1506 DB Table for Infotype 1506

HRP1507 DB Table for Infotype 1507

HRP1518 DB Table for Infotype 1518

HRP1519 DB Table for Infotype 1519

HRP1520 DB Table for Infotype 1520HRP1600 Database Table for Infotype 1600

HRP1601 Database Table for Infotype 1601

HRPAD21 Additional data PAD21

HRPAD22 Additional data PAD22

HRPAD23 Additional data PAD23

HRPAD25 Additional data PAD25

HRPAD27 Additional data PAD27

HRPAD31 Additional data PAD31

HRPAD34 Additional Data for Relationship 'has attended'

HRPAD44 PAD44 Additional Data

HRPAD47 PAD47 Additional Data

HRPAD48 Additional Data PAD48

HRPAD50 Additional Data PAD50

HRPAD51 Additional data PAD51

HRPAD53 Additional Data PAD53

HRPAD63 PAD63 Additional Data

HRPAD77 Additional data for PAD77

HRPADBLIST Additional Data Databases

HRPADD2 Additional Data PADD2

HRPADD3 Additional Data PADD3

HRPADIC Additional Data PADD2

HRPADNLIST Additional Data Number List

HRPADNN General Additional Data Table

HRPADP1 Additional Data PADP1

HRPADP2 Additional Data PADP2

HRPADPM Additional Data PADPM

HRPADTI PADTI Additional Data

HRPADUZ PADUZ Additional Data- Requirements

Assignment of Persons

HRPADXN Additional Data PADXN

HRPS_T012K For Decoupled Access to T012K (House

Bank and Account)HRPVAC List of vacant positions

HRPXXXX DB Table for Infotype XXXX

HRPYYYY DB Table for Infotype YYYY

PA2001 HR Time Record- Infotype 2001 (Absences)

PA2001_UGR Generated Table for View PA2001_UGR

PA2002 HR Time Record- Infotype 2002 (Attendances)

PA2002_UGR Generated Table for View PA2002_UGR

PA2003 HR Time Record- Infotype 2003 (Substitutions)

PA2004 HR Time Record- Infotype 2004 (Availability)

PA2005 HR Time Record- Infotype 2005 (Overtime)

PA2006 HR Time Record- Infotype 2006 (Absence

Quotas)

PA2006_UGR Generated Table for View PA2006_UGR

29

Page 30: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 30/47

PA2007 HR Time Record- Infotype 2007 (Attendance

Quotas)

PA2007_UGR Generated Table for View PA2007_UGR

PA2010 HR Time Record- Infotype 2010 (Employee

Remuneration Info.)

PA2012 HR Time Record- Infotype 2012 (Time TransferSpecifications)

PA2013 HR Time Record- Infotype 2013 (Quota

Corrections)

PA2500 HR Master Record for Infotype 2500

PA2501 HR Master Record for Infotype 2501

PA2502 HR Master Record for Infotype 2502

PA0000 HR Master Record- Infotype 0000 (Actions)

PA0001 HR Master Record- Infotype 0001 (Org.

Assignment)

PA0002 HR Master Record- Infotype 0002 (Personal

Data)

PA0003 HR Master Record- Infotype 0003 (Payroll

Status)

PA0004 HR Master Record- Infotype 0004 (Challenge)

PA0005 HR Master Record- Infotype 0005 (Leave

Entitlement)

PA0006 HR Master Record- Infotype 0006 (Addresses)

PA0007 HR Master Record- Infotype 0007 (Planned

Working Time)

PA0008 HR Master Record- Infotype 0008 (Basic Pay)

PA0009 HR Master Record- Infotype 0009 (Bank Details)

PA0010 HR Master Record- Infotype 0010 (Capital

Formation)

PA0011 HR Master Record- Infotype 0011 (Ext.Bank

 Transfers)

PA0012 HR Master Record- Infotype 0012 (Fiscal Data -

Germany)

PA0013 Infotype Social Insurance - Germany

PA0014 HR Master Record- Infotype 0014 (Recur.

Payments/Deds.)

PA0015 HR Master Record- Infotype 0015 (Additional

Payments)PA0016 HR Master Record- Infotype 0016 (Contract

Elements)

PA0017 HR master record- Infotype 0017 (Travel

Privileges)

PA0019 HR Master Record- Infotype 0019 (Monitoring of 

Dates)

PA0020 HR Master Record- Infotype 0020 (DUEVO)

PA0021 HR Master Record- Infotype 0021 (Family)

PA0022 HR Master Record- Infotype 0022 (Education)

PA0023 HR Master Record- Infotype 0023

(Other/Previous Employers)

PA0024 HR Master Record- Infotype 0024

(Qualifications)

PA0025 HR Master Record- Infotype 0025 (Appraisals)

PA0026 HR Master Record- Infotype 0026 (Company

Insurance)

PA0027 HR Master Record- Infotype 0027 (Cost

Distribution)

PA0028 HR Master Record- Infotype 0028 (Int. MedicalService)

PA0029 HR Master Record- Infotype 0029 (Workers'

Compensation)

PA0030 HR Master Record- Infotype 0030 (Powers of 

Attorney)

PA0031 HR Master Record- Infotype 0031 (Reference

Pers.Nos.)

PA0032 HR Master Record- Infotype 0032 (Internal Data)

PA0033 International Infotype 0033- Statistics

Exceptions

PA0034 HR Master Record- Infotype 0034 (Corporate

Functions)

PA0035 HR Master Record- Infotype 0035 (Comp.Instr.)

PA0036 HR Master Record- Infotype 0036 (Social

Insurance CH)

PA0037 HR Master Record- Infotype 0037 (Insurance)

PA0038 HR Master Record- Infotype 0038 (Fiscal Data

CH)

PA0039 HR Master Record- Infotype 0039 (Add. Org.

Assignment CH)

PA0040 HR Master Record- Infotype 0040 (Objects on

Loan)

PA0041 HR Master Record- Infotype 0041 (Date

Specifications)

PA0042 HR Master Record- Infotype 0042 (Fiscal Data -

Austria)

PA0043 HR Master Record- Infotype 0043 (Family

Allowance - A)

PA0044 HR Master Record- Infotype 0044 (Social

Insurance - A)

PA0045 HR Master Record- Infotype 0045 (Company

Loans)PA0046 HR Master Record- Infotype 0046 (Company

Pension Fund CH)

PA0048 HR Master Record- Infotype 0048 (Residence

Status - CH)

PA0049 HR Master Record- Infotype 0049 (Red.Hrs./Bad

Weather)

PA0050 HR Master Record- Infotype 0050 (Time

Recording)

PA0051 HR Master Record- Infotype 0051 (ASB/SPI Data)

PA0052 HR Master Record- Infotype 0052 (Wage

Maintenance)

PA0053 HR Master Record- Infotype 0053 (Company

Pension)

30

Page 31: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 31/47

PA0054 HR Master Record- Infotype 0054 (Works Council

Pay)

PA0055 HR Master Record- Infotype 0055 (Previous

Employer - A)

PA0056 HR Master Record- Infotype 0056 (Sick

Certificates-A)PA0057 HR Master Record- Infotype 0057 (Membership

Fees)

PA0058 HR Master Record- Infotype 0058 (Commuter

Rate - Austria)

PA0059 HR Master Record- Infotype 0059 (Social

Insurances - NL)

PA0060 HR Master Record- Infotype 0060 (Fiscal Data -

NL)

PA0061 HR Master Record- Infotype 0061 (Social

Insurance - ES)

PA0062 HR master record- Infotype 0062 Fiscal data

(ES)

PA0063 HR Master Record- Infotype 0063 (Social Fund -

NL)

PA0064 HR Master Record- Infotype 0064 (Social

Insurance - F)

PA0065 HR Master Record- Infotype 0065 (Tax - GB)

PA0066 HR Master data infotype 0066 - Canadian

garnishment- order

PA0067 HR master data infotype 0067 - Canadian

garnishment- debt

PA0068 HR master data infotype 0068 - Canadian

garnishment- adjust

PA0069 HR Master Record- Infotype 0069 (Nat.

Insurance - GB)

PA0070 HR Master Record- Infotype 0070 (Court Orders -

GB)

PA0071 HR Master Record- Infotype 0071 (Pension

Funds - GB)

PA0072 HR Master Record- Infotype 0072 (Fiscal Data -

DK)

PA0073 HR Master Record- Infotype 0073 (PrivatePensions - DK)

PA0074 HR Master Record- Infotype 0074 (Leave

Processing - DK)

PA0075 HR Master Record- Infotype 0075 (ATP Pension -

DK)

PA0076 HR Master Record- Infotype 0076 (Workers

Compensation NA)

PA0077 HR Master Record- Infotype 0077 (Additional

Personal Data)

PA0078 HR Master Record- Infotype 0078 (Loan

Payments)

PA0079 Infotype SI Additional Insurance - D

PA0080 HR Master Record- Infotype 0080 (Maternity

Protection)

PA0081 HR Master Record- Infotype 0081 (Military

Service)

PA0082 HR Master Record- Infotype 0082 (Additional

Absence Data)PA0083 HR Master Record- Infotype 0083 (Leave

Compensation)

PA0084 HR Master Record- Infotype 0084 (Sickness Pay

Control - GB)

PA0085 HR Master Record- Infotype 0085 (Work

Incapacity Periods GB)

PA0086 HR Master Record- Infotype 0086 (SSP/SMP

Exclusions GB)

PA0087 HR Master Record- Infotype 0087 (WFTC/DPTC

GB)

PA0088 HR Master Record- Infotype 0088 (SMP Record -

GB)

PA0090 HR Master Record- Infotype 0090 (Additional

Income)

PA0092 HR master record- Infotype 0092 Seniority (ES)

PA0093 HR Master Record- Infotype 0093 (Previous

Employers - D)

PA0094 HR Master Record- Infotype 0094 (Residence

Status - NA)

PA0095 HR Master Record- Infotype 0095 (Tax Canada)

PA0096 HR Master Record- Infotype 0096 (Tax - USA)

PA0098 HR Master Record- Infotype 0098 (Profit Sharing

- F)

PA0100 HR Master Record- Infotype 0100 (SI B)

PA0101 HR Master Record- Infotype 0101 (Tax B)

PA0102 HR Master Record- Infotype 0102 (Grievances

NA)

PA0103 HR Master Record- Infotype 0103 (Bond

Purchases NA)

PA0104 HR Master Record- Infotype 0104 (Bond

Denominations NA)

PA0105 HR Master Record- Infotype 0105(Communications)

PA0106 HR Master Record- Infotype 0106 (Related

Persons NA)

PA0107 HR Master Record- Infotype 0107 (Work

Schedule B)

PA0108 HR Master Record- Infotype 0108 (Personal Data

B)

PA0109 HR Master Record- Infotype 0109 (Contract

Elements B)

PA0110 HR Master Record- Infotype 0110 (Pensions NL)

PA0111 HR Master Record- Infotype 0111

(Garnishment/Cession - D)

31

Page 32: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 32/47

PA0112 HR Master Record- Infotype 0112 (Garnishment

Claim - D)

PA0113 HR Master Record- Infotype 0113 (Garnish.

Interest - D)

PA0114 HR Master Record- Infotype 0114 (Garnishment

Amount D)PA0115 HR Master Record- Infotype 0115 (Garnishment

Wages D )

PA0116 HR Master Record- Infotype 0116 (Garn.

 Transfer D)

PA0117 HR Master Record- Infotype 0117 (Garn.

Compensation D)

PA0118 HR Master Record- Infotype 0118 (Child

Allowance D)

PA0119 HR Master Record- Infotype 0119 (Annual

Income CA D)

PA0120 HR Master Record- Infotype 0120 (Pension Fund

 Trans. CH)

PA0121 HR Master Record- Infotype 0121 (RefPerNo

Priority)

PA0122 HR Master Record- Infotype 0122 (Child

Allowance Bonus D)

PA0125 HR Master Record- Infotype 0125 (Garnishment

B)

PA0126 Infotype- Supplementary Pension Germany

PA0127 HR Master Record- Infotype 0127 (Commuter

 Traffic NL)

PA0128 HR Master Record- Infotype 0128 (Notifications)

PA0129 HR Master Record- Infotype 0129 (Text Number

Assign.)

PA0130 HR Master Record- Infotpye 0130 (Checking

Procedures)

PA0131 HR Master Record- Infotype 0131

(Garnishment/Cession A)

PA0132 HR Master Record- Infotype 0132 (Garnishment

Claim A)

PA0133 HR Master Record- Infotype 0133 (Garn. Interest

A)PA0134 HR Master Record- Infotype 0134 (Garnishment

Amount A)

PA0135 HR Master Record- Infotype 0135 (Spec. Garn.

Cond. A)

PA0136 HR Master Record- Infotype 0136 (Garn.

 Transfer A)

PA0137 HR Master Record- Infotype 0137 (Garn.

Compensation A)

PA0138 HR Master Record- Infotype 0138

(Family/Ref.Pers B)

PA0139 HR Master Record- Infotype 0139 (Employees

Appl.No)

PA0140 HR Master Record- Infotype 0140 (SI Basic Data

 JP)

PA0141 HR Master Record- Infotype 0141 (SI Premium

Data JP)

PA0142 HR Master Record- Infotype 0142 (Residence

 Tax JP)PA0143 HR Master Record- Infotype 0143 (Life Insurance

 JP)

PA0144 HR Master Record- Infotype 0144 (Property

Accum. JP)

PA0145 HR Master Record- Infotype 0145 (Personnel Tax

Status JP)

PA0146 HR Master Record- Infotype 0146 (Y.E.A. Data

 JP)

PA0147 HR Master Record- Infotype 0147

PA0148 HR Master Record- Infotype 0148 (Family JP)

PA0149 HR Master Record Infotype 0149 (Tax Data

South Africa)

PA0150 HR Master Record Infotype 0150 (Social

Insurance SA)

PA0151 HR Master Record Infotype 0151 (Ext.Insurance

South Africa)

PA0154 HR master record, infotype 0154 (social security

data)

PA0155 HR master record, infotype 0155

(Suppl.admin.data)

PA0156 HR master data, infotype 0156 (Tax deduction)

PA0157 HR master record, infotype 0157 (User

admin.data)

PA0158 HR mater record, infotype 0158 (Amounts paid

by 3rd party)

PA0159 HR master record, infotype 0159 (Seniority)

PA0160 HR master record, infotype 0160 (Family

allowance)

PA0161 HR Master Record- Infotype 0161 (Limits IRS)

PA0162 HR Master Record- Infotype 0162 (Ins. Y.E.T.A

Data JP)

PA0165 HR Master Record- Infotype 0165 (LimitsDeductions)

PA0167 HR Master Record- Infotype 0167 (Health Plans)

PA0168 HR Master Record- Infotype 0168 (Insurance

Plans)

PA0169 HR Master Record- Infotype 0169 (Savings Plan)

PA0170 HR Master Record- Infotype 0170 (Flexible

Spending Accounts)

PA0171 HR Master Record- Infotype 0171 (Gen. Benefits

Information)

PA0172 HR Master Record- Infotype 0172 (FSA Claims)

PA0173 Tax card information

PA0177 HR Master Record- Infotype 0177 (Reg. Country

of Birth NL)

32

Page 33: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 33/47

PA0179 HR Master Record- Infotype 0179 (Tax SG)

PA0180 Alternative Address Data (Thailand)

PA0181 HR Master Record- Infotype 0181 [Add. Funds]

(SG)

PA0182 HR Master Record- Infotype 0182 [Alternative

Names] (SG)PA0183 HR Master Record- Infotype 0183 [Awards] (SG)

PA0184 HR Master Record- Infotype 0184 [Resume text]

(SG)

PA0185 HR Master Record- Infotype 0185 [Identification]

(SG)

PA0186 HR Master Record- Infotype 0186 [Social

Insurance] (SG)

PA0187 Additional family data

PA0188 Tax (Australia)

PA0189 HR Master Record- Infotype 0189 (Construction

Pay- Funds)

PA0190 HR Master Data Record Infotype 0190

(BuildingTradePrevERDat)

PA0191 HR Master Record Infotype 0191

(BuildingTradeReimbursExpens)

PA0192 Personnel Master Record Infotype 0192

(BuildingTrade Attrib)

PA0194 HR Master Record Infotype 0194 (Garnishment

Document)

PA0195 HR Master Record Infotype 0195 (Garnishment

Order)

PA0196 HR Master Record-Infotype 0196 (Employee

Provident Fund MY)

PA0197 HR Master Record-Infotype 0197 (SOCSO

Contributions MY)

PA0198 Sheduled Tax Deductuion Malaysia

PA0199 Tax deduction CP38 / Additional amt / Bonus -

Malaysia

PA0200 HR Master Record, Infotype 0200 (Garnishments

DK)

PA0201 Personnel master record infotype 0201 (basic

pension amnts)PA0202 HR master data infotype 0202 (Entitlements)

PA0203 HR master record infotype 0203

(Pension/Reserve Status)

PA0204 HR Master Record, Infotype 0204 (DA/DS

Statistics DK)

PA0205 HR Master Record- Infotype 0205

PA0206 HR Master Record- Infotype 0206, SI Finland

PA0207 HR Master Record- Infotype 0207 (Residence

 Tax Area)

PA0208 HR Master Record- Infotype 0208 (Work Tax

Area - USA)

PA0209 HR Master Record- Infotype 0209

(Unemployment Insurance USA)

PA0210 HR Master Record- Infotype 0210 (W4 USA)

PA0211 HR Master Record- Infotype 0211 (COBRA

Beneficiaries)

PA0212 HR Master Record- Infotpye 0212 (COBRA Health

Plan)

PA0213 Additional family information - MalaysiaPA0214 HR Master Record Infotype 0214

PA0215 Building Trade Transaction Data

PA0216 Garnishment Adjustment

PA0217 HR Master Record Infotype 0217 (INSEE code)

PA0218 HR Master Record- Infotype 0218 (Pensioner

Fund No. - F)

PA0219 HR Master Record- Infotype 0219 (External

Organizations)

PA0220 Superannuation (Australia)

PA0221 HR Master Record- Infotype 0221 (Manual

Checks)

PA0222 HR Master Record for Infotype 0222 (Company

Cars GB)

PA0224 Tax information - infotype 0224 - Canada

PA0225 HR Master Record for Infotype 0225 (Company

Cars GB 2)

PA0227 Tax file number (Australia)

PA0228 HR Master Record- Infotype 0228

PA0230 HR Master Record- Infotype 0230 / View 0008

(PSG)

PA0231 HR Master Record- Infotype 0231 / View 0001

(PSG)

PA0232 Personal-master record infotype 0232 (Child

Allowance) (D)

PA0233 HR Master Record Infotype 0233 ('Bilan Social'

FR)

PA0234 HR Master Record Infotype 0234 (Add. Withh.

Inform. - USA)

PA0235 HR Master Record- Infotype 0235 (Other Taxes -

USA)

PA0236 HR Master Record- Infotype 0236 (Credit Plans)

PA0237 HR Master Record- Infotype 0237 / View for0052 (PSG)

PA0241 Indonesian Tax Data

PA0242 JAMSOSTEK Details, Indonesia

PA0261 Leave Accrual Australia

PA0263 HR Master Record for Infotype 0263

PA0264 HR Master Record- Infotype 0264/view for

Infotype 0021

PA0265 HR Master Record- Infotype 0265 / Special

Regulations (PSG)

PA0266 HR Master Record- Infotype 0266 / View 0027

(PSG)

PA0267 HR Master Record- Infotype 0267 (One time

Payment off-cycle)

33

Page 34: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 34/47

PA0268 HR Master Record Infortype view 0045 and 0268

(Loan JPN)

PA0269 HR Master Record- Infotype 0269 (ADP

Information USA)

PA0270 HR Master Data Record- Infotype 0270 (COBRA

Payments)PA0271 HR master data infotype 0271 (Public Sector

statistics)

PA0272 HR Master Record Infotype 0272 (Garnishment

FR)

PA0273 HR Master Record- Infotype 0273 (Tax - SE)

PA0274 HR Master Record- Infotype 0274 (Insurance -

SE)

PA0275 HR Master Record- Infotype 0275 (Garnishment -

SE)

PA0276 HR Master Record- Infotype 0276 (OPIS - SE)

PA0277 HR Master Record- Infotype 0277 (Exceptions -

SE)

PA0278 HR Master Record- Infotype 0278 (Basic Data PF

[CH])

PA0279 HR Master Record- Infotype 0279 (Individual

Values PF [CH])

PA0280 HR Master Record Infotype 0280/View for 0016

PA0281 HR Master Record Infotype 0281/View for 0045

PA0283 HR Master Record for Infotype 0283 (Archiving)

PA0288 HR CH- HR Master Record Infotype 0021 (Suppl.

Switzerland)

PA0302 HR Master Record- Infotype 0302 (Additional

Actions)

PA0303 HR Master Record- Infotype 303 (reductn

tax/soc.ins.contrNL)

PA0304 Basic pay - additional information

PA0305 HR master record, infotype 0305 (previous

employer)

PA0306 HR master record, infotype 0306 (Family data)

PA0309 IRD Number Infotype NZ

PA0310 Superannuation NZ

PA0311 Leave Adjustments - NZPA0312 Leave History Adjustments NZ

PA0313 Employee Taxation Detail Infotype NZ

PA0314 I0314- Days for Vacation Bonus and Sal. Deducs

(DK/N)

PA0315 CATS- Sender Information

PA0317 HR Master Record- Infotype 0317 (special

arrangements)

PA0318 HR Master Record- Infotype Family data for

Indonesia (0318)

PA0319 Indonesia Private Insurances

PA0320 Official housing

PA0321 Employee accommodations

PA0322 HR Master Data Record Infotype 0322 (Pensions

and Rel. Ben.)

PA0323 HR Master Record Infotype 0323 (Pension Plan)

PA0326 HR Master Record IT 0326 (Imputation to

Pension Payments)

PA0329 HR master record infotype 0329 ( Sideline Job)PA0330 Infotype 0330 (Non-monetary remuneration)

PA0331 HR Master Record- Infotype 0331 (Tax - PT)

PA0332 HR Master Record- Infotype 0332 (Social

Security - PT)

PA0333 HR Master Record- Infotype 0333 (Disability - P)

PA0334 HR Master Record- Infotype 0334

PA0335 HR Master Data- Infotype 0335 (view of infotype

21 - PT)

PA0336 HR Master Data- Infotype 0336 (view of infotype

2 - PT)

PA0337 HR Master Record- Infotype 0337 (Prof.

Classifications - PT)

PA0338 HR Master record- Infotype 0338 (Absence pay.

clearing - PT)

PA0341 HR - master record infotype 341 (DUEVO start)

PA0342 HR Master Record- Infotype 0342 (HK Extension

to I0002)

PA0344 HR Master Record- Infotype 0344 (Familiy

members HK)

PA0345 HR Master Record- Infotype 0345 (Hong Kong

 Tax)

PA0346 HR Master Record- Infotype 0346 (Contribution

plan)

PA0347 HR Master Record- Infotype 0347 (Entitlement

plan)

PA0348 HR Master Record- Infotype 0348 (HK Appraisal

and bonus)

PA0349 HR Master Record- Infotype 0349 (Eligibility

grouping)

PA0351 HR Master Record- Infotype 0351 (Country

Information)

PA0352 NHI for Family member (TW)PA0353 Income Tax Taiwan

PA0354 Labor Insurance Taiwan

PA0355 National Health Insurance Taiwan

PA0356 Employment Stabilization Fund (TW)

PA0357 Saving Plan (TW)

PA0358 Employee Welfare Fund (TW)

PA0359 HR Master Record - Infotype 0359 (PRSI Ireland)

PA0360 HR Master Record - Infotype 0360 (PRSI Ireland)

PA0361 HR Master Record - Infotype 0361 (Pensions

Admin. - IE)

PA0362 HR Master Record- Infotype Membership for

Indonesia (0362)

PA0363 Previous employment period

34

Page 35: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 35/47

PA0364 Infotype Tax TH

PA0365 Social Security TH

PA0366 Provident Fund THAILAND

PA0367 HR Master Record- Infotype 0367 (SI Notification

Suppl. A)

PA0368 RehabilitantsPA0369 Master data- Infotype 0369 (IMSS data)

PA0370 Master data- Infotype 0370 (INFONAVIT credit

data)

PA0371 Master Data- Infotype 0371 (Tax on previous

employment)

PA0372 Master data- Infotype 0372 (Integrated daily

wage)

PA0373 HR loan repayment plan JP (for P0268)

PA0374 Infortype 0374- General Eligibility

PA0375 HR Master Data Record- Infotype 0375 (Add.

Benefits Inform.)

PA0376 HR Master Data Record- Infotype 0376 (Medical

Benefits Info)

PA0377 HR Master Record- Infotype 0377 (Miscellaneous

Plans)

PA0378 HR Master Data Record- Infotype 0378 (Benefit

Adj. Reason)

PA0379 HR Master Record- Infotype 0379 (Stock

Purchase Plans)

PA0380 HR Master Data Record Infotype 0380 (Comp.

Adjustment)

PA0381 HR Master Record Infotype 0381 (Comp. Plan

Eligibility)

PA0382 HR Master Data Record Infotype 0382 (Stock)

PA0383 HR Master Data Record Infotype 0383

(Compensation Package)

PA0384 HR Master Data Record Infotype 0384

PA0386 HR Master Record- Infotype 0386 (VHI Scheme)

PA0387 HR Master Record - Infotype 0387 (Starter's

Details)

PA0388 HR Master Record- Infotype 0388 (Union JP)

PA0389 Income Tax- General indicatorsPA0390 Income Tax- Deductions

PA0391 Income Tax- Information on other employers

PA0392 Social Security- General data

PA0393 Family data- Calendar year schooling assistance

PA0394 Family data- Additional information

PA0395 HR Master Record- Infotype 0395 (External

Org.Assignment)

PA0396 HR Master Record- Infotype 0396 (Expatriate

Attributes)

PA0397 Infotype 0021 Family

PA0398 Infotype 0016 - Corporation and contract

agreements

PA0399 HRMS-VE- Table for Income Tax Infotype

(IT0399)

PA0400 HRMS-VE- Table for SSO Infotype (IT0400)

PA0401 HRMS-VE- Table for Benefits Infotype (IT401)

PA0402 HR Master Data Infotype 0402

PA0403 HR Master Record for Infotype 0403PA0404 HR Master Record- Infotype 0404 (Military

Service Taiwan)

PA0405 HR Master Record- Infotype 0405 (Absence

Event)

PA0406 HR-PSG- Infotype 0406 (Pension information)

PA0407 HR master record, infotype 0407 (Abs.addit.inf.)

PA0408 HR Master Record- Infotype 0408 (CBS NL)

PA0409 HR Master Record- Infotype 0409 (External

Agencies NL)

PA0410 Infotype 0410 - Transportation ticket

PA0411 Taxation Philippines - infotype

PA0412 HR Master Record- Infotype 0412 [View to

I0021] (SG)

PA0415 HR Master Record- Infotype 0415

PA0416 Time Quota Compensation Infotype- Database

 Table

PA0419 HR Master record- Manual tax reporting

information - Norway

PA0421 HR master record, infotype 0421

(spec.remuner.)

PA0422 SSS Philippines infotype

PA0423 HR Master Record- Infotype 0423

PA0424 Industrial Accident / Maternity / Sickness

Statement (FR)

PA0425 Data Entry of Per Diem Sick Pay Summary

PA0426 Garnishment

PA0427 Debts by garnishment

PA0428 Beneficiary data (Additional information)

PA0433 HR Master Record Infotype 0433/View for 0009

PA0434 HR Master Record Infotype 0434/View for 0011

(GB Version)

PA0435 HR Master Record for Infotype 0435PA0436 HR Master Record for Infotype 0436

PA0437 Multiple employment (BR)

PA0438 HR Master Record- Infotype 0438

PA0439 HR Master Record for Infotype 0439 (Data

 Transfer)

PA0440 HR Master Record- Infotype 0440 (Receipts)

PA0442 HR Master Record- Infotype 0442

PA0447 US Federal Tax MTD

PA0448 US Federal Tax QTD

PA0449 HR Master Record- Infotype 0449

PA0450 HR Master Record- Infotype 0450

PA0451 HR Master Record- Infotype 0451

PA0452 HR Master Record- Infotype 0452

35

Page 36: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 36/47

PA0453 HR Master Record- Infotype 0453

PA0454 HR Master Record- Infotype 0454

PA0455 HR Master Record- Infotype 0455

PA0456 HR Master Record- Infotype 0456

PA0457 HR Master Record- Infotype 0457

PA0458 HR Master Record for Infotype 0458PA0459 HR Master Record for Infotype 0459

PA0460 HR Master Record for Infotype 0460

PA0467 Personnel master data Infotype 0467 (SI

addit.notif. pl.c.A)

PA0468 HR master record for infotype 0468

PA0469 HR master record for infotype 0469

PA0470 HR master record infotype 0470 (travel profiles)

PA0471 HR master record infotype 0471 (flight

preferences)

PA0472 HR master record infotype 0472 (hotel

preferences)

PA0473 HR master record infotype 0473 (rental car

preferences)

PA0474 HR master record infotype 0474 (train

preferences)

PA0475 HR master record infotype 0475 (customer

programs)

PA0476 Personnel Master Record for Infotype 0476

(Garnishments)

PA0477 Personnel Master Record Infotype 0477- Debt

(Garnishments)

PA0478 Personnel Master Record Infotype 0478-

Adjustment (Garnish)

PA0480 HR master record for infotype 0480

PA0482 HRMS-VE- Additional Data from Family/N. of Kin

Inftp(IT0021)

PA0483 Infotype 0483 - Data entry by CAAF - Italy only

PA0486 HR-SG-PS- Master Data (National Service)

PA0487 HR-SG-PS- Security / medical Clearance

PA0488 HR-SG-PS- Leave scheme

PA0489 HR-SG-PS- Voluntary Service / ECA

PA0490 HR-PS-SG- Employee Suggestion SchemePA0491 HR Master Record- Infotype 491

PA0493 HR-SG-PS- Extension of infotype 0022

PA0494 HR-PS-SG- Employee Suggestion Scheme -

Evaluation Results

PA0495 HR-PS-SG- Pensions Scheme

PA0502 Letter of appointment

PA0503 Pensioner's Definition

PA0504 Pensioner's Advantage B

PA0505 HR Master Record- Infotype 0505

PA0506 Tip Indicators

PA0510 HR Master Record- Infotype 0510 (Tax-sheltered

annuity)

PA0511 Infotype Cost-of-Living Allowance/Office (0511)

PA0512 Personnel Master Record Infotype 0512

PA0521 HR Master Record- Infotype 0521

(Semiretirement D)

PA0525 Child Care

PA0526 HR Master Data Record Infotype 0526PA0527 HR Master Data Record Infotype 0527

PA0546 HR-SG- Master Record- Infotype 0546

[Termination Data)

PA0547 BIK Infotype for Malaysia

PA0548 Infotype 0548 - Suppl.social security funds - Italy

only

PA0551 Termination of contract- General data

PA0552 HR Master Data Record for Infotype 0552

PA0553 HR Master Data Record for Infotype 0553

PA0554 HR Master Record- Infotype 0554

PA0559 HR Master Record- Infotype 0559 (Commuting

allowance Info.)

PA0560 HR Master Record- Infotype 0560

PA0561 Data for tax

PA0565 HR Master Record- Infotype 0565 (Retirement

Plan Val. Res.)

PA0566 HR Master Record- Infotype 0566

PA0569 HR Master Record- Infotype 0569

PA0570 HR Master Record- Infotype 0570

PA0571 HR Master Record- Infotype 0571

PA0572 HR Master Record- Infotype 0572

PA0578 HR Master Record- Infotype 0578

PA0579 HR Master Record Infotype 0579 (Ext. Salary

Elements)

PA0592 HR Master Data Record Infotype 0592 (Foreign

Public Sector)

PA0593 Rehabilitants

PA0595 HR Master Data Record for Infotype 0595

PA0596 PhilHealth Philippines Infotype

PA0602 HR Master Record- Infotype 0602 (Retirement

Plan Cumulation)

PA0611 HR Master Record- Infotype 0611PA0612 HR Master Record- Infotype 0612

PA0625 Infotype 0002 - Race/complexion

PA0628 HR Master Record for Infotype 0628

PA0629 HR Master Record for Infotype 0629

PA0630 HR Master Record for Infotype 0630

PA0631 HR Master Record for Infotype 0631

PA0634 Philippines Previous Employer Information Info-

type

PA0645 Contract termination- General data

PA0900 HR Master Record- Infotype 0900 (Sales Data)

PA0901 HR Master Record- Infotype 0901 (Purchasing

Data)

36

Page 37: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 37/47

37

Page 38: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 38/47

SAP HR ABAP PERFORMANCE

Ejemplo lectura tablas HRP1001 y HRP1000

• En vez de utilizar select * from HRP1001, etc., usar funcion'RH_READ_INFTY_1001' , ejemplo

CALL FUNCTION 'RH_READ_INFTY_1001'EXPORTING

plvar = cc_plvarotype = 'O'objid = i_orgidistat = '1'subty = 'B002'begda = pn-begda

endda = pn-enddaTABLESi1001 = gtb_1001

EXCEPTIONSnothing_found = 1wrong_condition = 2wrong_parameters = 3OTHERS = 4.

LOOP AT gtb_1001 WHERE sclas = 'O'.ltb_org-sobid = gtb_1001-sobid.APPEND ltb_org.

ENDLOOP.IF sy-subrc NE 0.ENDIF.

• PARA HRP1000 usar 'RH_READ_INFTY_1000'

*---------------------------------------------------------------------** FORM is_tech **---------------------------------------------------------------------** ........ **---------------------------------------------------------------------** --> I_POS ** --> I_ORG *

* --> O_TECH **---------------------------------------------------------------------*FORM is_tech USING i_pos

i_orgCHANGING o_tech.

CLEAR o_tech.CALL FUNCTION 'RH_READ_INFTY_1001'

EXPORTINGplvar = cc_plvarotype = 'S'objid = i_posistat = '1'subty = 'B007'begda = p0001-begda

endda = p0001-enddaTABLES

i1001 = gtb_1001EXCEPTIONS

38

Page 39: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 39/47

nothing_found = 1wrong_condition = 2wrong_parameters = 3OTHERS = 4.

LOOP AT gtb_1001 TRANSPORTING NO FIELDSWHERE sclas = '1S'.

ENDLOOP.

IF sy-subrc = 0.CALL FUNCTION 'RH_READ_INFTY_1000'

EXPORTINGplvar = cc_plvarotype = '1S'objid = gtb_1001-objidistat = '1'begda = gtb_1001-begdaendda = gtb_1001-endda

TABLESi1000 = gtb_1000

EXCEPTIONSnothing_found = 1wrong_condition = 2

wrong_parameters = 3OTHERS = 4.

IF sy-subrc = 0.LOOP AT gtb_1000 WHERE langu = sy-langu.ENDLOOP.IF sy-subrc NE 0.LOOP AT gtb_1000.ENDLOOP.

ENDIF.IF gtb_1000-short = 'PT US TECHNI'.o_tech = 'T'.

ELSEIF gtb_1000-short = 'PT US NON-TE'.o_tech = 'N'.

ELSE.

o_tech = space.ENDIF.ENDIF.

ENDIF.ENDFORM. "read_p1051

EJEMPLO HR_READ_INFOTYPE

• si tenemos el siguiente reporte HR

INFOTYPES: 0001,0008,

2001.

START-OF-SELECTION.

GET pernr.* basic pay datarp_provide_from_last p0008 space pn-begda pn-endda.

CHECK p0008-trfar IN so_trfar .CHECK p0008-trfgb IN so_trfgb .CHECK p0008-trfgr IN so_trfgr .CHECK p0008-trfst IN so_trfst .LOOP AT p2001.

PERFORM do_something.ENDLOOP.

END-OF-SELECTION.

39

Page 40: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 40/47

• es mas optimo de la siguiente forma

INFOTYPES: 0001,0008,2001 MODE n.

START-OF-SELECTION.

GET pernr.* Basic Pay Datarp_provide_from_last p0008 space pn-begda pn-endda.CHECK p0008-trfar IN so_trfar .CHECK p0008-trfgb IN so_trfgb .CHECK p0008-trfgr IN so_trfgr .CHECK p0008-trfst IN so_trfst .PERFORM leer_2001.LOOP AT p2001.

PERFORM do_something.ENDLOOP.

END-OF-SELECTION.

*---------------------------------------------------------------------** FORM leer_2001 **---------------------------------------------------------------------** ........ **---------------------------------------------------------------------*FORM leer_2001.CLEAR p2001.REFRESH p2001.CALL FUNCTION 'HR_READ_INFOTYPE'

EXPORTING* TCLAS = 'A'

pernr = pernr-pernrinfty = '2001'

TABLESinfty_tab = p2001

EXCEPTIONSinfty_not_found = 1OTHERS = 2

.IF sy-subrc <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.ENDIF.

ENDFORM.

40

Page 41: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 41/47

SAP HR DRIVER SIMULACION

Simular existencia de Infotipos en drivernomina RPCALCX0

* Tables for intermediate memory mngmt. TYPES: BEGIN OF hroct_iprel,

pernr LIKE p0001-pernr,infty LIKE p0001-infty,idata LIKE prelp OCCURS 0,

END OF hroct_iprel.

DATA: BEGIN OF mem_id_iprel, "Memory ID for infotypespernr LIKE p0001-pernr,

value(5) VALUE 'IPREL',END OF mem_id_iprel.

DATA: obj_iprel TYPE REF TO cl_hrpay99_fill_infotypes.* objects for infotype simulationDATA: send_it TYPE REF TO cl_hrpay99_send_infotypes,

iprel TYPE hrpay99_iprel_table.*............*............*............IF p_flag = 'X'.* read & send infotype 0014 to memory for the process of simulation* of the payroll driver RPCALCX0PERFORM fill_iperl_i0014.

ELSE. "M19CLEAR retro_date. "M19ENDIF.IF NOT obj_iprel IS INITIAL.* create object for infotype simulationCREATE OBJECT send_it.

* fill iprel from importing parameteriprel = obj_iprel->get_iprel( ).

* fill send_it from table iprelCALL METHOD send_it->set_iprel( iprel ).

* send infotype object to memoryCALL METHOD send_it->send_all.

ENDIF.*...

*...*...SUBMIT rpcalcx0

USING SELECTION-SET variant_calc* using selection-sets of program 'HARCALC0'* using selection-sets of program 'RPCALCX0'

USING SELECTION-SETS OF PROGRAM 'ZPPY_INT_RPCALCX0'WITH pnppernr eq fired_employees_line-pernrWITH pnpxabkr eq fired_employees_line-abkrsWITH pnpabkrs eq fired_employees_line-abkrsWITH pnptimr9 eq spaceWITH pnptimra eq 'X'

* WITH pnppabrp EQ fired_employees_line-pabrp "M29* WITH pnppabrj EQ fired_employees_line-pabrj "M29

WITH pnppabrp eq gd_pabrp "M29WITH pnppabrj eq gd_pabrj "M29WITH payty eq fired_employees_line-payty

41

Page 42: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 42/47

* WITH bondt EQ fired_employees_line-bondt "M29* WITH ocrsn EQ fired_employees_line-ocrsn "M29

WITH bondt eq gd_bondt "M29WITH ocrsn eq gd_ocrsn "M29

* with test_on eq ' 'WITH tst_on eq 'X'WITH prt_prot eq 'X'

WITH sw_spool eq space " Print to spool* with edt_vari eq variant_cedt " Show payslip

WITH edt_vari eq variant_cedt " Show payslipWITH ecalled eq 'X'WITH set_nib eq 'X'WITH set_odc eq 'X'WITH upd_ps eq spaceWITH exp_buff eq 'X'WITH imp_buff eq space

* with brk_on eq ' '* with brk_sc eq ' '* with brk_off eq 'X'

WITH plgmemky eq memo_keyWITH rueck-ab = retro_date "M19

EXPORTING LIST TO MEMORY AND RETURN.

*---------------------------------------------------------------------** FORM fill_iperl_i0014 **---------------------------------------------------------------------** ........ **---------------------------------------------------------------------*FORM fill_iperl_i0014.DATA: BEGIN OF help_i0014 OCCURS 5.

INCLUDE STRUCTURE p0014.DATA: END OF help_i0014.

* fill iprel with all infotypesCLEAR iprel.

* refresh iprel.IF p9902-zzbasetri > 0.***************************************** RP-READ-INFOTYPE ****************************************** PARAMETERS: ** PERNR REQUESTED PERSONALNUMBER** INFTY REQUESTED INFOTYPNUMBER ** INFTY-TABLE OUTPUT-TABLE LIKE PNNNN** BEGDA REQUESTED INTERVAL-BEGIN** ENDDA REQUESTED INTERVAL-END ****************************************** read all the 0014 records for put in memory

PERFORM read-infotype(sapdbpnp)

TABLES help_i0014USING p9902-pernr '0014' '18000101' '99991231'.* distribution of the p9902-zzbasetri ammount in IT0014 records

PERFORM create_i0014 TABLES help_i0014USING p9902

p9902-zzbasetrip9902-waers.

* Put the IT0014 records in internal object for send it* to memory

CALL METHOD obj_iprel->insert( help_i0014[] ).

ENDIF.ENDFORM. "fill_iperl_i0014• ojo en driver rpcalcx0 los infotipos simulados se procesan eninclude rpchrt09get pernr.IF ecalled = 'X'. "XAIAHRK001447* read infotypes from memory (for infotype simulation)

42

Page 43: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 43/47

PERFORM get_iprel USING pernr-pernr. "XAIAHRK001447

43

Page 44: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 44/47

HR NOTAS

DUMP CX_HRPA_INVALID_PARAMETERSi se topan con este dump(>= 4.7), aca va nota ad-hoc

Solution consists in calling the subroutine DO_NOTHING in order to initialize the old masterdata framework. To apply this note manually, follow the instructions listed in the nextsection.

Ejemplo,

*--- load-of-program -------------------------------------------------*

* The load-of-program event is useful for the time of transition* from the old to the new master data frame work.LOAD-OF-PROGRAM.* to initialise the old master data frameworkPERFORM do_nothing(sapfp50p). "

INITIALIZATION.* select only active employeesrp-sel-ein-aus-init.

Weird!!!, pero me paso un par de veces.

Obtenido de"http://globalsap.cl/globalwiki/index.php/CX_HRPA_INVALID_PARAMETER_DUMP"

44

Page 45: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 45/47

SAP HR FAQ*1) como leer el molga de un empleado

CALL FUNCTION 'HR_COUNTRYGROUPING_GET'EXPORTING

pernr = gd_pernrbegda = datumendda = datum

IMPORTINGmolga = gd_molga

EXCEPTIONSnot_found = 1OTHERS = 2.

*2) detalle compañia ( campo bukrs )

CALL FUNCTION 'FI_COMPANYCODE_GETDETAIL'EXPORTING

bukrs_int = pnpbukrs-lowauthority_check = space

IMPORTINGt001_int = comp_det

TABLESt001z_int = appendix

EXCEPTIONSbukrs_not_found = 1no_authority_display_bukrs = 2OTHERS = 3.

*3) nombres de mes ( util en formularios )

CALL FUNCTION 'MONTH_NAMES_GET'* EXPORTING* LANGUAGE = SY-LANGU* IMPORTING* RETURN_CODE =TABLES

month_names = namesEXCEPTIONSmonth_names_not_found = 1OTHERS = 2.

*4) sumar / restar meses a fecha

CALL FUNCTION 'HR_BR_ADD_MONTH_TO_DATE'

EXPORTINGdmm_datin = first_daydmm_count = '1'dmm_oper = '-'dmm_pos = ' '

IMPORTINGdmm_daout = aux_date.

*5) ultimo dia del mes

CALL FUNCTION 'LAST_DAY_OF_MONTHS'EXPORTING

day_in = pnpbegdaIMPORTING

last_day_of_month = pnpenddaEXCEPTIONSday_in_no_date = 1OTHERS = 2.

45

Page 46: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 46/47

*6) leer horario de trabajo de empleado

wa_pernr-pernr = p_pernr.APPEND wa_pernr TO tb_pernr.CALL FUNCTION 'HR_PERSON_READ_WORK_SCHEDULE'EXPORTING

begin_date = p_begdaend_date = p_endda

* GROUPING_DWS =* GROUPING_ATTENDENCE =* GROUPING_SUBSTITUTE =* READ_FROM_DATABASE = ' 'TABLES

pernr_tab = tb_pernrpsp = tb_psp

day_psp = tb_day_pspEXCEPTIONSerror_in_build_psp = 1OTHERS = 2

.

*7) leer caracteristica ( feature ) hr , transaccion pe03

DATA pben0 LIKE zben0.DATA l_back(5).* fill feature structureCLEAR pben0.pben0-barea = p_barea.pben0-bplan = p_bplan.pben0-depcv = 'DEP0'. "DummyCLEAR p_val.* get value of from feature (PE03 transaction)CALL FUNCTION 'HR_FEATURE_BACKFIELD'

EXPORTINGfeature = 'ZBEN0'

struc_content = pben0IMPORTINGback = l_back

EXCEPTIONSdummy = 1error_operation = 2no_backvalue = 3feature_not_generated = 4invalid_sign_in_funid = 5field_in_report_tab_in_pe03 = 6OTHERS = 7.

IF sy-subrc NE 0.p_val = space.

ELSE.

IF l_back <> space.p_val = 'X'.ELSE.

p_val = space.ENDIF.

ENDIF.

*8) verificar nif ( rut )

CALL FUNCTION 'TAX_NUMBER_CHECK'EXPORTING

country = p_land1tax_code_1 = p_stcd1.

*9) leer clase de fecha de infotipo p0041

FORM get_fecha USING p0041 LIKE p0041p_dar LIKE p0041-dar01

46

Page 47: HR06 - Ejemplos de Programacion Hr.doc

7/16/2019 HR06 - Ejemplos de Programacion Hr.doc

http://slidepdf.com/reader/full/hr06-ejemplos-de-programacion-hrdoc 47/47

CHANGING p_fecha.DATA ld_dat LIKE p0041-dat01.DATA ld_dar LIKE p0041-dar01.CLEAR p_fecha.DO 12 TIMES VARYING ld_dat FROM p0041-dat01 NEXT p0041-dat02

VARYING ld_dar FROM p0041-dar01 NEXT p0041-dar02.IF ld_dar = p_dar.

p_fecha = ld_dat.ENDIF.

ENDDO.ENDFORM.