ABAP developer specialised in SAP payroll on ECP. I like integrations that explain themselves: agreed mappings, logs people can act on, and code that can be tested.
Desarrollador ABAP especializado en nómina SAP sobre ECP. Me gustan las integraciones que se explican solas: mapeos acordados, logs con los que se puede actuar y código que se puede probar.
ExperienceExperienciaECP go-liveArranque de ECPEducationFormación
In short
Technical side of payroll on Employee Central Payroll: the replication from Employee Central, custom infotypes, payroll reports built on the payroll cluster, and outbound interfaces to banks and third-party systems.
I joined my current team in the middle of an ECP go-live, migrating the custom code from the client's previous SAP HCM system. Since then I have worked on evolutive development and support, from a BAdI in the replication to a SEPA transfer file.
Where my code lives
Employee CentralEmployee master dataDatos maestros del empleado
EC
Point-to-point replicationReplicación point-to-pointCompound Employee API · BAdIs
SAP Integration SuiteiFlows · SFTP adapteriFlows · adaptador SFTP
CPI
Third partiesTercerosTime & attendance, health & safety, banksControl horario, prevención, bancos
SOAP · SFTP · SEPA
First project: an ECP go-live
The client was moving its payroll from SAP HCM on-premise to Employee Central Payroll, and every custom development had to reach the new system with no transport route between the two. I moved the transport requests by hand: data files and cofiles through AL11, then the import queue.
About 3,000 import errors appeared, many of them chained. Instead of fixing them one by one, I grouped them by root cause: each root cause fixed cleared hundreds of errors at once, and the custom code was running for go-live.
Lesson
In a migration, import order is everything. The “Migrating to ECP in six steps” note in Docs is how I would plan the whole project today.
Experience
From 2027 · SAP ABAP Developer (HCM / ECP) · DioklesNext role, starting in 2027.
2025 – today · SAP ABAP Developer (HCM / ECP) · MinsaitDevelopment and support on Employee Central Payroll: EC → ECP replication, custom infotypes, payroll reporting and integrations through SAP Integration Suite.
2023 – 2025 · SAP ABAP Developer · NTT DataDevelopment and support on ABAP for several modules.
Education · Web app developmentSAP - Positioning the autonomous enterprise certification.
En resumen
Parte técnica de la nómina en Employee Central Payroll: la replicación desde Employee Central, infotipos a medida, informes de nómina sobre el clúster de resultados e interfaces de salida hacia bancos y sistemas de terceros.
Me incorporé a mi equipo actual en pleno arranque de un ECP, migrando el código a medida del sistema SAP HCM anterior. Desde entonces trabajo en evolutivos y soporte, desde una BAdI de la replicación hasta un fichero de transferencias SEPA.
Dónde vive mi código
Employee CentralEmployee master dataDatos maestros del empleado
EC
Point-to-point replicationReplicación point-to-pointCompound Employee API · BAdIs
SAP Integration SuiteiFlows · SFTP adapteriFlows · adaptador SFTP
CPI
Third partiesTercerosTime & attendance, health & safety, banksControl horario, prevención, bancos
SOAP · SFTP · SEPA
Primer proyecto: un arranque de ECP
El cliente estaba pasando su nómina de SAP HCM on-premise a Employee Central Payroll, y todos los desarrollos a medida tenían que llegar al sistema nuevo sin ruta de transporte entre los dos. Moví las órdenes de transporte a mano: ficheros data y cofiles por AL11 y después la cola de importación.
Aparecieron unos 3.000 errores de importación, muchos de ellos en cadena. En lugar de corregirlos uno a uno, los agrupé por causa raíz: cada causa raíz corregida eliminaba cientos de errores de golpe, y el código a medida funcionaba para el arranque.
Lección
En una migración, el orden de importación lo es todo. La nota «Migrar a ECP en seis pasos», en Documentación, es cómo plantearía hoy el proyecto completo.
Experiencia
Desde 2027 · Desarrollador SAP ABAP (HCM / ECP) · DioklesPróxima etapa, a partir de 2027.
2025 – hoy · Desarrollador SAP ABAP (HCM / ECP) · MinsaitDesarrollo y soporte sobre Employee Central Payroll: replicación EC → ECP, infotipos a medida, informes de nómina e integraciones con SAP Integration Suite.
2023 – 2025 · Desarrollador SAP ABAP · NTT DataDesarrollo ABAP en diferentes módulos.
Formación · Desarrollo de aplicaciones WebCertificación SAP - Positioning the autonomous enterprise.
Tech stackStack técnico
Object-oriented ABAP with modern syntax, SAP payroll from the inside, the EC → ECP replication and SAP Integration Suite when third parties are involved.
ABAP orientado a objetos con sintaxis moderna, la nómina SAP por dentro, la replicación EC → ECP y SAP Integration Suite cuando hay terceros de por medio.
ALV with CL_SALV_TABLE and the application log (BAL)
RFC function modules and BAPIs
Dynamic method calls, RTTS and ABAP Unit
SAP payroll (HCM)
Custom infotypes with PM01
HR_INFOTYPE_OPERATION and the decoupled infotype framework
Payroll cluster: RGDIR, RT, retro, splits and garnishments
Payment Medium Workbench and DMEE (SEPA)
Spanish payroll: AFI file and salary register
SuccessFactors and ECP
EC → ECP point-to-point replication
Business Integration Builder: field mapping and BAdIs
Compound Employee API
Payroll Control Center
Data Replication Monitor
Integration and operations
SAP Integration Suite (CPI) and SFTP
SOAP consumer proxies and SOAMANAGER
SRT_UTIL and the CPI message monitor
IDoc and ALE (HRMD_A)
Transports, SPDD and SPAU
ABAP
ABAP OO y sintaxis 7.40+
BAdIs, enhancement spots y BAdIs clásicas
ALV con CL_SALV_TABLE y log de aplicación (BAL)
Módulos de funciones RFC y BAPIs
Llamadas dinámicas a métodos, RTTS y ABAP Unit
Nómina SAP (HCM)
Infotipos a medida con PM01
HR_INFOTYPE_OPERATION y el framework desacoplado de infotipos
Clúster de nómina: RGDIR, RT, retroactividad, particiones y embargos
Payment Medium Workbench y DMEE (SEPA)
Nómina española: fichero AFI y registro retributivo
SuccessFactors y ECP
Replicación point-to-point EC → ECP
Business Integration Builder: mapeo de campos y BAdIs
Compound Employee API
Payroll Control Center
Data Replication Monitor
Integración y operación
SAP Integration Suite (CPI) y SFTP
Proxies consumidores SOAP y SOAMANAGER
SRT_UTIL y el monitor de mensajes de CPI
IDoc y ALE (HRMD_A)
Transportes, SPDD y SPAU
How I workCómo trabajo
Six rules I apply to every interface, from the first mapping to support in production.
Seis reglas que aplico en cada interfaz, desde el primer mapeo hasta el soporte en productivo.
Clean ABAPTestingPruebasOwnershipResponsabilidad
Agree the mapping first. A field-by-field mapping signed off by the functional team prevents half of the replication errors.
The standard is the source of truth. If a custom payroll report has to match the wage type reporter, I validate against it before anyone else does.
Test with many employees, not one. What works in PA30 can fail in a mass run. Static state, overlaps and splits only show up with volume.
Control is as important as automation. Sensitive data such as salaries goes through validation, a test mode and all-or-nothing saves.
Logs people can act on. Every message carries the personnel number, the infotype and what to fix.
AI as a pair programmer, with judgment. It makes me faster; every line is still reviewed, tested and owned by me.
Primero, el mapeo. Un mapeo campo a campo validado con el equipo funcional evita la mitad de los errores de replicación.
El estándar manda. Si un informe de nómina a medida tiene que cuadrar con el reporter de conceptos, lo valido contra él antes de que lo haga nadie.
Pruebo con muchos empleados, no con uno. Lo que funciona en PA30 puede fallar en un proceso masivo. El estado estático, los solapes y las particiones solo aparecen con volumen.
El control importa tanto como la automatización. Los datos sensibles, como el salario, pasan por validación, modo test y grabaciones de todo o nada.
Logs con los que se puede actuar. Cada mensaje lleva el número de personal, el infotipo y qué hay que corregir.
La IA como compañero de programación, con criterio. Me hace más rápido; cada línea la reviso, la pruebo y la firmo yo.
ProjectsProyectos
Work on Employee Central PayrollTrabajo sobre Employee Central Payroll
Real projects, described without client names. Open a card for the story (context, what I did, the result) and the ABAP that makes it work, with notes on the lines that matter.
Proyectos reales, contados sin nombres de clientes. Abre una tarjeta para ver la historia (contexto, qué hice y resultado) y el ABAP que lo hace funcionar, con notas en las líneas que importan.
ABAP
A custom infotype fed by the EC → ECP replicationUn infotipo a medida alimentado por la replicación EC → ECP
Seven organisational fields from SuccessFactors land in a custom infotype during the replication itself, in the same unit of work as the standard infotypes, with errors in the replication log.
Siete campos organizativos de SuccessFactors llegan a un infotipo a medida durante la propia replicación, en la misma unidad de trabajo que los infotipos estándar y con los errores en el log de replicación.
PM01Replication BAdIBAdI de replicaciónInfotype frameworkFramework de infotipos
Context
The business needed seven organisational attributes that live in Employee Central (general management, division, department, area, sub-area, group and pay scale) inside ECP, to use them in payroll reporting. The specification was a short email.
What I did
Created infotype 9001 with PM01: structure, own data elements and screens. I proposed the time constraint and wrote down the open decisions (field lengths, empty values, how SuccessFactors writes) for the functional team.
Put the logic in the common replication BAdI (HRSFEC_B_CE_PROCESS_EMPLOYEE, method PROCESS_EMPLOYEE_COMMON_ADDIN), split into one private method per infotype, so an early RETURN in one cannot cut the other.
Wrote the infotype through the replication's own infotype framework (IF_HRPA_MASTERDATA_BL): no staging table, no extra job and no COMMIT of my own. Errors reach the employee's replication log through the BIB message handler.
Made it idempotent: replicating the same employee twice creates nothing, and a future-dated change in EC delimits the current record.
Applied the cut-off date (1 January) in code for this infotype only, because the BIB transfer start date is global and would also affect payroll infotypes.
Read the pay grade generically from the compensation value list, so it keeps working if SAP adds it as its own component.
Made the fields read-only in PA30: SuccessFactors is the master, SAP receives.
Negocio necesitaba en ECP siete atributos organizativos que viven en Employee Central (dirección general, dirección, departamento, área, subárea, grupo y escala) para explotarlos en informes de nómina. La especificación era un correo de pocas líneas.
Qué hice
Creé el infotipo 9001 con PM01: estructura, elementos de datos propios y pantallas. Propuse la restricción temporal y dejé por escrito las decisiones abiertas (longitudes, valores vacíos, cómo escribe SuccessFactors) para el equipo funcional.
Puse la lógica en la BAdI común de la replicación (HRSFEC_B_CE_PROCESS_EMPLOYEE, método PROCESS_EMPLOYEE_COMMON_ADDIN), separada en un método privado por infotipo, para que un RETURN temprano en uno no corte el otro.
Grabé el infotipo a través del propio framework de infotipos de la replicación (IF_HRPA_MASTERDATA_BL): sin tabla intermedia, sin job adicional y sin COMMIT propio. Los errores llegan al log de replicación del empleado mediante el message handler del BIB.
Lo hice idempotente: replicar dos veces el mismo empleado no crea nada, y un cambio con fecha futura en EC delimita el registro vigente.
Apliqué la fecha de corte (1 de enero) en código y solo para este infotipo, porque la fecha de inicio de transferencia del BIB es global y afectaría también a los infotipos de nómina.
Leí el pay grade de forma genérica desde la lista de valores de compensación, para que siga funcionando si SAP lo añade como componente propio.
Dejé los campos en solo lectura en PA30: SuccessFactors manda, SAP recibe.
Recorrido
Employee CentralCompound Employee APIBAdI común de replicaciónIF_HRPA_MASTERDATA_BLInfotipo 9001Informe de plantilla
The code that mattersEl código que importa
Simplified, anonymised excerptExtracto simplificado y anonimizado
The method the common replication BAdI calls for infotype 9001. Everything that makes it safe to run on every replication is here: the cut-off for this infotype only, a generic pay grade, idempotency and no commit of its own. The insert itself is in Docs, under “Writing an infotype inside the replication”.
El método al que llama la BAdI común de la replicación para el infotipo 9001. Aquí está todo lo que permite ejecutarlo en cada replicación sin miedo: la fecha de corte solo para este infotipo, el pay grade genérico, la idempotencia y ningún commit propio. La inserción en sí está en Documentación, en «Grabar un infotipo dentro de la replicación».
ZCL_HR_EC_REPL_COMMON → PROCESS_IT9001
METHOD process_it9001.
" Called by the common replication BAdI once per employee.
" One private method per infotype: an early RETURN here never skips IT0008.
" EC job information already mapped to the seven IT9001 fields, oldest first
DATA(lt_new) = map_job_info( it_job_info ).
" Cut-off for this infotype only: the BIB transfer start date is global
" and would also hold back the payroll infotypes
DELETE lt_new WHERE endda < mv_cutoff.
LOOP AT lt_new ASSIGNING FIELD-SYMBOL(<ls_new>) WHERE begda < mv_cutoff.
<ls_new>-begda = mv_cutoff.
ENDLOOP.
" Pay grade read by name from the compensation value list
READ TABLE it_comp_values INTO DATA(ls_grade) WITH KEY name = mc_pay_grade.
IF sy-subrc = 0.
LOOP AT lt_new ASSIGNING <ls_new>.
<ls_new>-pay_grade = ls_grade-value.
ENDLOOP.
ELSE.
warn_no_pay_grade( io_message_handler ). " in the log, not silently empty
ENDIF.
DATA(lt_current) = read_pa9001( iv_pernr ).
LOOP AT lt_new INTO DATA(ls_new).
" Replicating the same employee twice writes nothing
IF is_unchanged( is_new = ls_new it_current = lt_current ).
CONTINUE.
ENDIF.
" Through the BIB's own infotype framework (IF_HRPA_MASTERDATA_BL):
" time constraint 1 delimits the current record
IF insert_9001( is_record = ls_new io_messages = io_message_handler ) = abap_false.
RETURN. " the error is already in the employee's replication log
ENDIF.
ENDLOOP.
" No COMMIT WORK: the BIB commits per employee, standard and custom infotypes together
ENDMETHOD.
Cut-off in code, for IT9001 only. The BIB transfer start date would have applied it to every infotype, payroll ones included.Fecha de corte en código y solo para el IT9001. La fecha de inicio de transferencia del BIB la habría aplicado a todos los infotipos, también a los de nómina.
The pay grade is looked up by name, not by position: if a later SAP release ships it as its own field, the mapping does not break. If EC sends none, a warning goes to the replication log instead of an empty field nobody notices.El pay grade se busca por nombre, no por posición: si una release posterior de SAP lo trae como campo propio, el mapeo no se rompe. Si EC no lo envía, queda un aviso en el log de replicación en lugar de un campo vacío que nadie ve.
Idempotent by design: the replication can run as often as it needs to.Idempotente por diseño: la replicación puede ejecutarse tantas veces como haga falta.
No staging table and no job: the record is written in the same unit of work as the standard infotypes, and a failure shows up in the employee’s replication log.Sin tabla intermedia ni job: el registro se graba en la misma unidad de trabajo que los infotipos estándar y, si falla, el error aparece en el log de replicación del empleado.
One commit per employee, and it belongs to the BIB. A COMMIT here would split the unit of work.Un commit por empleado, y es del BIB. Un COMMIT aquí partiría la unidad de trabajo.
Result
The data reaches ECP with every replication run, errors appear in the replication log like any standard error, and the headcount report reads the new fields through its mapping table without new code.
Lesson
Transport the whole class. Once, a method travelled without its declaration: in the target system the BAdI class had a syntax error, and a broken replication BAdI stops the replication for every employee, not just one infotype.
Resultado
Los datos llegan a ECP en cada ejecución de la replicación, los errores aparecen en el log de replicación como cualquier error estándar y el informe de plantilla lee los campos nuevos desde su tabla de mapeo, sin código nuevo.
Lección
Transporta la clase entera. Una vez viajó un método sin su declaración: en el sistema destino la clase de la BAdI quedó con un error de sintaxis, y una BAdI de replicación rota para la replicación de todos los empleados, no solo de un infotipo.
ABAP
Salary from EC to infotype 0008, under controlDel salario en EC al infotipo 0008, bajo control
Pay components from Employee Central staged by the replication, compared with IT0008 and saved only after review, employee by employee.
Componentes salariales de Employee Central preparados por la replicación, comparados con el IT0008 y grabados solo después de revisarlos, empleado a empleado.
IT0008BAdIHR_INFOTYPE_OPERATIONALV
Context
The client manages salaries in Employee Central. Infotype 0008 is what actually pays people, so data coming from EC should not land there blindly.
What I did
In the replication BAdI, took the latest job and compensation information and prepared the data in a staging table: twelve pay components, 12 or 14 payments depending on the employment type, monthly salary and working time from the FTE.
Segmented the validity dates so records never overlap or leave gaps, including when a new salary starts in the middle of an existing record or before all of them.
Built a report that derives the collective agreement data (feature TARIF), compares with the current IT0008 and proposes what to create or change, in an ALV with traffic lights and a test mode.
On save, each employee is locked, updated and committed or rolled back as a whole.
Kept the logic in its own method of the common BAdI class: the IT0008-specific BAdI never ran, because that infotype is not in the BIB field mapping.
El cliente gestiona los salarios en Employee Central. El infotipo 0008 es el que paga a la gente, así que lo que viene de EC no debería entrar ahí a ciegas.
Qué hice
En la BAdI de replicación tomé la última información de puesto y de compensación y preparé los datos en una tabla intermedia: doce componentes salariales, 12 o 14 pagas según el tipo de empleo, salario mensual y jornada a partir del FTE.
Segmenté las fechas de validez para que los registros nunca se solapen ni dejen huecos, también cuando un salario nuevo empieza a mitad de un registro existente o antes que todos.
Creé un informe que deriva los datos de convenio (característica TARIF), compara con el IT0008 vigente y propone qué crear o modificar, en un ALV con semáforos y modo test.
Al grabar, cada empleado se bloquea, se actualiza y se confirma o se deshace entero.
Dejé la lógica en su propio método de la clase de la BAdI común: la BAdI específica del IT0008 nunca se ejecutaba, porque ese infotipo no está en el mapeo de campos del BIB.
Recorrido
Compensación en ECBAdI de replicaciónTabla intermediaInforme de comparaciónIT0008
The code that mattersEl código que importa
Simplified, anonymised excerptExtracto simplificado y anonimizado
Two halves of the same control: the replication only stages the salary, and a report decides what reaches infotype 0008, one employee at a time. The third tab is how I would cover the date cut with ABAP Unit.
Dos mitades del mismo control: la replicación solo prepara el salario, y un informe decide qué llega al infotipo 0008, empleado a empleado. La tercera pestaña es cómo cubriría el corte de fechas con ABAP Unit.
ZCL_HR_EC_REPL_COMMON → STAGE_IT0008
METHOD stage_it0008.
" Latest EC compensation → one staging row per start date
DATA(ls_stage) = VALUE zhr_it0008_stage(
pernr = iv_pernr
begda = is_comp-start_date
endda = '99991231'
" 12 or 14 payments depending on the employment type, working time from the FTE
npay = SWITCH #( is_job-employment_type WHEN '02' THEN 14 ELSE 12 )
bsgrd = is_job-fte * 100 ).
" Twelve EC pay components, each to its own slot
LOOP AT it_pay_components INTO DATA(ls_pc).
CASE condense( to_upper( ls_pc-pay_component ) ).
WHEN 'BASE_SALARY'. ls_stage-amt01 = ls_pc-amount.
WHEN 'SENIORITY'. ls_stage-amt02 = ls_pc-amount.
WHEN 'AGREEMENT_PLUS'. ls_stage-amt03 = ls_pc-amount.
" … twelve components in total
ENDCASE.
ENDLOOP.
ls_stage-monthly = is_comp-annual_salary / ls_stage-npay.
" Validity cut: records never overlap and never leave a gap.
" The new record ends the day before the next one starts, if there is one
SELECT MIN( begda ) FROM zhr_it0008_stage
WHERE pernr = @iv_pernr AND begda > @ls_stage-begda
INTO @DATA(lv_next_start).
IF lv_next_start IS NOT INITIAL.
ls_stage-endda = lv_next_start - 1.
ENDIF.
" The record it starts inside, if any, ends the day before
DATA(lv_day_before) = CONV endda( ls_stage-begda - 1 ).
UPDATE zhr_it0008_stage SET endda = @lv_day_before
WHERE pernr = @iv_pernr AND begda < @ls_stage-begda AND endda >= @ls_stage-begda.
MODIFY zhr_it0008_stage FROM @ls_stage. " same start date: newer data wins
" Staging only: nothing reaches IT0008 until the report saves it
ENDMETHOD.
ZHR_IT0008_FROM_EC → SAVE_EMPLOYEE
METHOD save_employee.
DATA ls_return TYPE bapireturn1.
DATA lv_operation TYPE pspar-actio.
" Lock first: nobody edits this employee while the report writes
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING number = is_emp-pernr
IMPORTING return = ls_return.
IF ls_return-type = 'E'.
rs_result = VALUE #( pernr = is_emp-pernr light = icon_red_light text = ls_return-message ).
RETURN.
ENDIF.
LOOP AT is_emp-proposals INTO DATA(ls_prop).
" A new salary on top of the current one: COP copies and delimits it
lv_operation = COND #( WHEN ls_prop-action = 'NEW' THEN 'INS' ELSE 'COP' ).
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING infty = '0008'
number = ls_prop-p0008-pernr
subtype = ls_prop-p0008-subty
validitybegin = ls_prop-p0008-begda
validityend = ls_prop-p0008-endda
record = ls_prop-p0008
operation = lv_operation
nocommit = abap_true
IMPORTING return = ls_return.
IF ls_return-type CA 'EA'.
EXIT.
ENDIF.
ENDLOOP.
" The employee is saved whole, or not at all
IF ls_return-type CA 'EA'.
ROLLBACK WORK.
CALL FUNCTION 'HR_PSBUFFER_INITIALIZE'.
ELSE.
COMMIT WORK AND WAIT.
ENDIF.
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE' EXPORTING number = is_emp-pernr.
rs_result = VALUE #( pernr = is_emp-pernr
light = COND #( WHEN ls_return-type CA 'EA' THEN icon_red_light ELSE icon_green_light )
text = ls_return-message ).
ENDMETHOD.
ZCL_HR_EC_REPL_COMMON → test class LTC_VALIDITY_CUT
CLASS ltc_validity_cut DEFINITION DEFERRED.
CLASS zcl_hr_ec_repl_common DEFINITION LOCAL FRIENDS ltc_validity_cut.
CLASS ltc_validity_cut DEFINITION FINAL FOR TESTING
DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
TYPES: BEGIN OF ty_period,
begda TYPE begda,
endda TYPE endda,
END OF ty_period,
tt_periods TYPE STANDARD TABLE OF ty_period WITH EMPTY KEY.
CONSTANTS mc_pernr TYPE pernr_d VALUE '00001234'.
CLASS-DATA go_env TYPE REF TO if_osql_test_environment.
CLASS-METHODS class_setup.
CLASS-METHODS class_teardown.
METHODS setup.
METHODS same_start_newer_wins FOR TESTING.
METHODS mid_record_closes_open FOR TESTING.
METHODS before_all_no_overlap FOR TESTING.
METHODS given IMPORTING it_periods TYPE tt_periods.
METHODS stage IMPORTING iv_begda TYPE begda.
METHODS expect IMPORTING it_periods TYPE tt_periods.
ENDCLASS.
CLASS ltc_validity_cut IMPLEMENTATION.
METHOD class_setup.
" The staging table is replaced by a test double: no real data is touched
go_env = cl_osql_test_environment=>create(
i_dependency_list = VALUE #( ( 'ZHR_IT0008_STAGE' ) ) ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
go_env->clear_doubles( ).
ENDMETHOD.
METHOD same_start_newer_wins.
given( VALUE #( ( begda = '20250101' endda = '20251231' )
( begda = '20260101' endda = '99991231' ) ) ).
stage( '20250101' ).
expect( VALUE #( ( begda = '20250101' endda = '20251231' )
( begda = '20260101' endda = '99991231' ) ) ).
ENDMETHOD.
METHOD mid_record_closes_open.
given( VALUE #( ( begda = '20250101' endda = '99991231' ) ) ).
stage( '20250701' ).
expect( VALUE #( ( begda = '20250101' endda = '20250630' )
( begda = '20250701' endda = '99991231' ) ) ).
ENDMETHOD.
METHOD before_all_no_overlap.
given( VALUE #( ( begda = '20250701' endda = '99991231' ) ) ).
stage( '20250101' ).
expect( VALUE #( ( begda = '20250101' endda = '20250630' )
( begda = '20250701' endda = '99991231' ) ) ).
ENDMETHOD.
METHOD given.
DATA lt_rows TYPE STANDARD TABLE OF zhr_it0008_stage WITH EMPTY KEY.
lt_rows = VALUE #( FOR p IN it_periods
( pernr = mc_pernr begda = p-begda endda = p-endda ) ).
go_env->insert_test_data( lt_rows ).
ENDMETHOD.
METHOD stage.
" Only the start date matters for the cut
NEW zcl_hr_ec_repl_common( )->stage_it0008(
iv_pernr = mc_pernr
is_comp = VALUE #( start_date = iv_begda annual_salary = 28000 )
is_job = VALUE #( employment_type = '01' fte = 1 )
it_pay_components = VALUE #( ) ).
ENDMETHOD.
METHOD expect.
DATA lt_actual TYPE tt_periods.
SELECT begda, endda FROM zhr_it0008_stage
WHERE pernr = @mc_pernr
ORDER BY begda
INTO TABLE @lt_actual.
cl_abap_unit_assert=>assert_equals( act = lt_actual exp = it_periods ).
ENDMETHOD.
ENDCLASS.
Payments and working time come from the job information, not from the compensation.Las pagas y la jornada salen de la información del puesto, no de la de compensación.
Pay components arrive as text from EC: normalised before mapping, so stray spaces or lower case still match.Los componentes salariales llegan de EC como texto: se normalizan antes de mapear, así que un espacio de más o una minúscula siguen encajando.
A record never runs past the next one: it ends the day before the next start date. A salary dated before all the others ends where the first one begins.Un registro nunca invade el siguiente: termina el día antes de su fecha de inicio. Un salario con fecha anterior a todos termina donde empieza el primero.
A salary that starts mid-record closes the open record the day before: no overlaps, no gaps.Un salario que empieza a mitad de un registro cierra el registro abierto el día anterior: sin solapes ni huecos.
Same start date: the latest replication wins, and no duplicate row is created.Misma fecha de inicio: gana la última replicación y no se crea una fila duplicada.
No COMMIT here either: the staging rows are saved with the rest of the replication.Aquí tampoco hay COMMIT: las filas intermedias se graban con el resto de la replicación.
Lock first, the same way PA30 does.Primero el bloqueo, igual que hace PA30.
COP copies the current record and delimits it, exactly like creating a new salary in PA30.COP copia el registro vigente y lo delimita, igual que crear un salario nuevo en PA30.
NOCOMMIT plus one decision at the end: every record of the employee is saved, or none is.NOCOMMIT y una sola decisión al final: se graban todos los registros del empleado o ninguno.
After a rollback, the infotype buffer is reset, so the next employee never sees records that were never saved.Tras un rollback se vacía el buffer de infotipos, para que el siguiente empleado nunca vea registros que no llegaron a grabarse.
The OSQL test environment swaps the staging table for a double, so the test runs on any system without touching real data.El entorno de test de Open SQL cambia la tabla intermedia por un doble, así que el test se ejecuta en cualquier sistema sin tocar datos reales.
Same start date with a later record: the replaced record keeps ending the day before the next one.Misma fecha de inicio con un registro posterior: el registro sustituido sigue terminando el día antes del siguiente.
The edge case: a salary dated before all the others ends where the first one begins, instead of running to 31.12.9999 on top of it.El caso límite: un salario con fecha anterior a todos termina donde empieza el primero, en lugar de llegar hasta el 31.12.9999 por encima de él.
Result
Salary changes from Employee Central reach payroll validated, reviewed and traceable.
Next step
Read the current IT0008 records for all selected employees in one go, instead of one employee at a time inside the loop.
Lesson
In payroll, control is as important as automation.
Resultado
Los cambios de salario de Employee Central llegan a nómina validados, revisados y con trazabilidad.
Siguiente paso
Leer los IT0008 vigentes de todos los empleados seleccionados de una vez, en lugar de empleado a empleado dentro del bucle.
Lección
En nómina, el control importa tanto como la automatización.
ABAP
ECP → health & safety systemECP → sistema de prevención de riesgos
Two web-service interfaces that keep the client’s occupational health system in sync: master data, sick leaves and work accidents, sending only what changed.
Dos interfaces por servicio web que mantienen sincronizado el sistema de prevención del cliente: datos maestros, bajas y accidentes de trabajo, enviando solo lo que cambia.
The health and safety department needed workers, companies, work centres, sick leaves and work accidents in its own system, without loading them by hand.
Interface 1 · Master data in three steps
Workers: personal data, ID document and its type, address, email, social security data, contract type and occupation code. A change of document type is detected by comparing with the IT0002 history.
Companies and work centres: tax ID, social security account and address; work centres from the personnel areas.
Periods: history of company, position, category (IT0014 mapped through a custom table) and shift (work schedule from IT0007).
Interface 2 · Temporary disability
Work accidents from IT2001, with a unique code built from the ID document and the start date.
Sick leaves with the contingency type mapped through a custom table.
Relapses linked to the original leave through the IT2001 link fields.
Leave ↔ accident: a leave that starts within an accident of the same employee is linked to it.
The technical core
Delta load by infotype change date against the last run, with the initial load prepared separately. Each step keeps its own control date.
The control date only moves forward after a successful call, so a failure is retried on the next run.
SAP codes translated to the receiver’s codes with mapping tables. Open-ended dates (31.12.9999) are sent empty, as the receiver expects.
Flow
Infotypes 0000–2001Control tableDelta selection and mappingSOAP proxySAP Integration SuiteHealth & safety system
Contexto
El departamento de prevención necesitaba tener en su sistema los trabajadores, empresas, centros de trabajo, bajas y accidentes, sin cargarlos a mano.
Interfaz 1 · Datos maestros en tres pasos
Trabajadores: datos personales, documento de identidad y su tipo, dirección, email, datos de Seguridad Social, tipo de contrato y código de ocupación. Detecta el cambio de tipo de documento comparando con el historial del IT0002.
Empresas y centros: CIF, código de cuenta de cotización y dirección; centros de trabajo a partir de las divisiones de personal.
Periodos: historia de empresa, posición, categoría (IT0014 mapeada con una tabla a medida) y turno (plan de horario del IT0007).
Interfaz 2 · Incapacidad temporal
Accidentes de trabajo desde el IT2001, con un código único formado por el documento de identidad y la fecha de inicio.
Bajas con el tipo de contingencia mapeado con una tabla a medida.
Recaídas enlazadas con la baja original a través de los campos de vínculo del IT2001.
Baja ↔ accidente: una baja que empieza dentro de un accidente del mismo empleado se asocia a él.
El núcleo técnico
Carga delta por fecha de modificación del infotipo frente a la última ejecución, con la carga inicial preparada aparte. Cada paso tiene su propia fecha de control.
La fecha de control solo avanza tras una llamada correcta, así que un fallo se reintenta en la siguiente ejecución.
Códigos SAP traducidos a los del receptor con tablas de mapeo. Las fechas abiertas (31.12.9999) se envían vacías, como espera el receptor.
Recorrido
Infotipos 0000–2001Tabla de controlSelección delta y mapeoProxy SOAPSAP Integration SuiteSistema de prevención
The code that mattersEl código que importa
Simplified, anonymised excerptExtracto simplificado y anonimizado
The sick-leave step of the second interface: delta selection, code mapping, the leave ↔ accident link and a control date that only moves when the call succeeds.
El paso de bajas de la segunda interfaz: selección delta, mapeo de códigos, el enlace baja ↔ accidente y una fecha de control que solo avanza si la llamada va bien.
Z_HR_OHS_SEND_WORK_LEAVES (function module)
FUNCTION z_hr_ohs_send_work_leaves.
CONSTANTS lc_work_accident TYPE subty VALUE '1300'.
DATA ls_request TYPE zohs_work_leaves_request.
" Delta: only absences changed since the last successful run
SELECT SINGLE last_run FROM zhr_ohs_control
WHERE process = 'WORK_LEAVES'
INTO @DATA(lv_last_run).
SELECT * FROM pa2001
WHERE aedtm >= @lv_last_run
INTO TABLE @DATA(lt_pa2001).
" lt_accidents comes from the accident step (code = ID document + start date),
" declared SORTED ... WITH NON-UNIQUE KEY pernr
LOOP AT lt_pa2001 INTO DATA(ls_pa2001).
SELECT SINGLE perid FROM pa0002
WHERE pernr = @ls_pa2001-pernr AND begda <= @ls_pa2001-begda AND endda >= @ls_pa2001-begda
INTO @DATA(lv_id).
DATA(ls_leave) = VALUE zohs_work_leave(
worker_id = lv_id
start_date = |{ ls_pa2001-begda DATE = ISO }|
" Open-ended dates travel empty, as the receiver expects
end_date = COND #( WHEN ls_pa2001-endda <> '99991231'
THEN |{ ls_pa2001-endda DATE = ISO }| ) ).
" Contingency type: subtypes the receiver knows travel as they are, the rest as OTHER
IF ls_pa2001-subty = lc_work_accident.
ls_leave-contingency_type = '-'. " agreed placeholder, never empty
ELSE.
SELECT SINGLE subty FROM zhr_ohs_cont_types
WHERE subty = @ls_pa2001-subty
INTO @ls_leave-contingency_type.
IF sy-subrc <> 0.
ls_leave-contingency_type = 'OTHER'.
ENDIF.
ENDIF.
" A leave that starts inside an accident of the same employee belongs to it
LOOP AT lt_accidents INTO DATA(ls_acc)
WHERE pernr = ls_pa2001-pernr
AND begda <= ls_pa2001-begda AND endda >= ls_pa2001-begda.
ls_leave-accident_code = ls_acc-code.
EXIT.
ENDLOOP.
APPEND ls_leave TO ls_request-work_leaves.
ENDLOOP.
" Synchronous call: when it returns, the receiver has the data
DATA ls_response TYPE zohs_work_leaves_response.
TRY.
NEW zco_ohs_work_leaves( logical_port_name = 'ZOHS_WORK_LEAVES' )->send(
EXPORTING output = ls_request
IMPORTING input = ls_response ).
" The control date only moves after a successful call
UPDATE zhr_ohs_control SET last_run = @sy-datum WHERE process = 'WORK_LEAVES'.
CATCH cx_ai_system_fault cx_ai_application_fault INTO DATA(lx_fault).
ev_error = lx_fault->get_text( ). " date untouched: the next run retries
ENDTRY.
ENDFUNCTION.
Delta by the infotype’s change date against the last successful run, whatever the dates of the absence: a leave closed yesterday or one starting next month travels too. The initial load is the same code run from an old date.Delta por la fecha de modificación del infotipo frente a la última ejecución correcta, sean cuales sean las fechas del absentismo: una baja cerrada ayer o una que empieza el mes que viene también viajan. La carga inicial es el mismo código lanzado desde una fecha antigua.
Open-ended dates (31.12.9999) are sent empty, as the receiver expects.Las fechas abiertas (31.12.9999) se envían vacías, como espera el receptor.
Unknown absence types travel as OTHER, so a new type in SAP never breaks the message.Los tipos de absentismo desconocidos viajan como OTHER, así que un tipo nuevo en SAP nunca rompe el mensaje.
The empty value that wasn’t: with this field empty for accidents, not a single sick leave reached the receiver. A placeholder agreed with them fixed it.El vacío que no lo era: con este campo vacío en los accidentes no llegaba ni una baja al receptor. Lo arregló un valor de relleno pactado con ellos.
One employee can have several accidents, so the link table needs a non-unique key.Un empleado puede tener varios accidentes, así que la tabla del enlace necesita una clave no única.
A synchronous proxy: request and response in the same call, and business errors from the receiver arrive as cx_ai_application_fault.Un proxy síncrono: petición y respuesta en la misma llamada, y los errores de negocio del receptor llegan como cx_ai_application_fault.
If the call fails, the control date stays where it was and the next run sends the same changes again.Si la llamada falla, la fecha de control no se mueve y la siguiente ejecución vuelve a enviar los mismos cambios.
Result
One initial load, then only changes, without losing or duplicating records.
Next step
Move the function modules into a class and read in bulk instead of inside loops. And catch deleted absences, which a change-date delta cannot see, with a change log written on save, like the one in the SFTP interfaces.
Lesson
Empty values are part of the contract. The WSDL said the contingency type was optional; in practice, an empty one made a whole block of records disappear in the receiver. Agree on empty values with the people on the other side, not with the WSDL.
Resultado
Una carga inicial y después solo cambios, sin perder ni duplicar registros.
Siguiente paso
Pasar los módulos de funciones a una clase y leer en bloque en lugar de dentro de bucles. Y detectar los absentismos borrados, que un delta por fecha de modificación no puede ver, con un log de cambios escrito al grabar, como el de las interfaces SFTP.
Lección
Los valores vacíos son parte del contrato. El WSDL decía que el tipo de contingencia era opcional; en la práctica, uno vacío hacía desaparecer un bloque entero de registros en el receptor. Los vacíos se pactan con quien está al otro lado, no con el WSDL.
ABAP
Unattended interfaces to SFTP through SAP Integration SuiteInterfaces desatendidas al SFTP con SAP Integration Suite
Payroll files for a time-and-attendance provider, and every absence change for the client’s own system, sent every day through SAP Integration Suite. Nobody touches anything, and every record can be traced to the file it travelled in.
Ficheros de nómina para un proveedor de control horario y cada cambio de absentismo para el sistema del propio cliente, enviados cada día con SAP Integration Suite. Nadie toca nada, y cada registro se puede rastrear hasta el fichero en el que viajó.
IT2001 saveGrabación IT2001→BAdI + log tableBAdI + tabla de log→Daily jobJob diario→SOAP proxy · Base64Proxy SOAP · Base64→iFlow→SFTP
CPISOAP proxyProxy SOAPHRPAD00INFTYBase64SLG1
Context
Two needs, one pattern. A time-and-attendance provider abroad needed payroll files for two sites, per environment, on its SFTP server. And the client’s own system needed every absence change from ECP without anyone exporting it by hand.
Interface 1 · Files for a provider
A service class reads the files from the application server (AL11), encodes them in Base64 and calls the consumer proxy generated from the iFlow’s WSDL, with its logical port in SOAMANAGER.
A configuration table per process, file and environment, so a new site is a table entry, not a code change.
SAP Integration Suite writes the file to the right SFTP folder and keeps a backup. ABAP deletes the original only after a successful call.
Every read, send and move is logged in SLG1, and an email goes out when something fails.
Interface 2 · Absences, change by change
A BAdI on infotype saves (HRPAD00INFTY, IN_UPDATE) turns every IT2001 change into one clean operation for the receiver: insert, change or delete, delimitations included.
A new start date on a record already sent becomes a delete of the old key plus an insert of the new one.
While a record is still pending, changes are consolidated into it: the receiver never gets duplicates or intermediate steps.
A daily job builds the CSV from the pending records, keeps a copy on the server, sends it and marks each record as sent with its file name and time stamp. A resend mode rebuilds any file from the log.
Flow
IT2001 save / AL11BAdI + log tableJobConsumer proxyiFlowSFTP
Contexto
Dos necesidades, un mismo patrón. Un proveedor de control horario en el extranjero necesitaba en su SFTP ficheros de nómina de dos centros, por entorno. Y el sistema del propio cliente necesitaba cada cambio de absentismo de ECP sin que nadie lo exportara a mano.
Interfaz 1 · Ficheros para un proveedor
Una clase de servicio lee los ficheros del servidor de aplicación (AL11), los codifica en Base64 y llama al proxy consumidor generado desde el WSDL del iFlow, con su puerto lógico en SOAMANAGER.
Una tabla de configuración por proceso, fichero y entorno, para que un centro nuevo sea una entrada en la tabla y no un cambio de código.
SAP Integration Suite escribe el fichero en la carpeta del SFTP que corresponde y guarda una copia de seguridad. ABAP solo borra el original tras una llamada correcta.
Cada lectura, envío y movimiento queda en SLG1, y sale un correo cuando algo falla.
Interfaz 2 · Absentismos, cambio a cambio
Una BAdI de grabación de infotipos (HRPAD00INFTY, IN_UPDATE) convierte cada cambio del IT2001 en una operación limpia para el receptor: alta, modificación o borrado, delimitaciones incluidas.
Una fecha de inicio nueva en un registro ya enviado se convierte en el borrado de la clave antigua más el alta de la nueva.
Mientras un registro sigue pendiente, los cambios se consolidan en él: el receptor nunca recibe duplicados ni pasos intermedios.
Un job diario genera el CSV con los registros pendientes, guarda una copia en el servidor, lo envía y marca cada registro como enviado con su nombre de fichero y su marca de tiempo. Un modo de reenvío reconstruye cualquier fichero desde el log.
Recorrido
Grabación IT2001 / AL11BAdI + tabla de logJobProxy consumidoriFlowSFTP
The code that mattersEl código que importa
Simplified, anonymised excerptExtracto simplificado y anonimizado
Three pieces: the BAdI that turns every absence change into one clean operation, the job that sends the pending ones as a file, and the generic service that hands any file to the SFTP through SAP Integration Suite.
Tres piezas: la BAdI que convierte cada cambio de absentismo en una operación limpia, el job que envía los pendientes como fichero y el servicio genérico que entrega cualquier fichero al SFTP a través de SAP Integration Suite.
ZCL_IM_HR_ABSENCE_CAPTURE → IN_UPDATE / QUEUE
METHOD if_ex_hrpad00infty~in_update.
" Runs in the update task, inside the save: plain DB writes, no COMMIT
CHECK new_image-infty = '2001' OR old_image-infty = '2001'.
DATA ls_old TYPE p2001.
DATA ls_new TYPE p2001.
cl_hr_pnnnn_type_cast=>prelp_to_pnnnn( EXPORTING prelp = old_image IMPORTING pnnnn = ls_old ).
cl_hr_pnnnn_type_cast=>prelp_to_pnnnn( EXPORTING prelp = new_image IMPORTING pnnnn = ls_new ).
" What did the user do, seen from the receiver?
DATA(lv_op) = COND zhr_abs_op( WHEN ls_old IS INITIAL THEN 'INS'
WHEN ls_new IS INITIAL THEN 'DEL'
ELSE 'MOD' ).
" A new start date is a new key for the receiver
IF lv_op = 'MOD' AND ls_new-begda <> ls_old-begda.
queue( is_abs = ls_old iv_op = 'DEL' ).
queue( is_abs = ls_new iv_op = 'INS' ).
ELSE.
queue( is_abs = COND #( WHEN lv_op = 'DEL' THEN ls_old ELSE ls_new ) iv_op = lv_op ).
ENDIF.
ENDMETHOD.
METHOD queue.
DATA(ls_row) = VALUE zhr_abs_log(
docnr = is_abs-docnr pernr = is_abs-pernr awart = is_abs-awart
begda = is_abs-begda endda = is_abs-endda
hours = COND #( WHEN is_abs-alldf = abap_true THEN 0 ELSE is_abs-stdaz )
operation = iv_op status = 'N' ).
" Still pending? Consolidate instead of queueing another step
SELECT SINGLE * FROM zhr_abs_log
WHERE docnr = @is_abs-docnr AND begda = @is_abs-begda AND status = 'N'
INTO @DATA(ls_pending).
IF sy-subrc <> 0.
ls_row-log_id = cl_system_uuid=>create_uuid_x16_static( ).
INSERT zhr_abs_log FROM @ls_row.
RETURN.
ENDIF.
IF ls_pending-operation = 'INS' AND iv_op = 'DEL'.
DELETE zhr_abs_log FROM @ls_pending. " never sent: never existed for them
RETURN.
ENDIF.
" The receiver never saw the insert, so a later change is still an insert
ls_row-operation = COND #( WHEN ls_pending-operation = 'INS' THEN 'INS' ELSE iv_op ).
ls_row-log_id = ls_pending-log_id.
UPDATE zhr_abs_log FROM @ls_row.
ENDMETHOD.
ZHR_ABSENCE_EXPORT → LCL_EXPORT->RUN
METHOD run.
" Normal run: everything pending. Resend: the rows of one file already sent
IF p_resend = abap_true.
SELECT * FROM zhr_abs_log WHERE status = 'S' AND file_name = @p_file
INTO TABLE @DATA(lt_send).
ELSE.
SELECT * FROM zhr_abs_log WHERE status = 'N' INTO TABLE @lt_send.
ENDIF.
CHECK lt_send IS NOT INITIAL.
DATA(lv_nl) = cl_abap_char_utilities=>cr_lf.
DATA(lv_csv) = REDUCE string(
INIT csv = |DOCNR;PERNR;TYPE;BEGDA;ENDDA;HOURS;OPERATION{ lv_nl }|
FOR r IN lt_send
NEXT csv = csv && |{ r-docnr };{ r-pernr };{ r-awart };{ r-begda };{ r-endda };{ r-hours };{ r-operation }{ lv_nl }| ).
" One file per day, with a name the receiver can predict
DATA(lv_file) = COND string( WHEN p_resend = abap_true THEN p_file
ELSE |ABS_{ sy-datum }.csv| ).
save_copy_on_server( iv_name = lv_file iv_content = lv_csv ). " OPEN DATASET
" Encode the bytes, not the characters: the file arrives identical
DATA(lv_base64) = cl_http_utility=>encode_x_base64( cl_abap_codepage=>convert_to( lv_csv ) ).
TRY.
NEW zco_absence_file_out( logical_port_name = 'ZCPI_ABSENCES' )->send_absfile(
output = VALUE #( line = VALUE #( file_name = lv_file
file_base64 = lv_base64 ) ) ).
" Mark exactly the rows of this file, by their own key
GET TIME STAMP FIELD DATA(lv_now).
LOOP AT lt_send INTO DATA(ls_row).
UPDATE zhr_abs_log SET status = 'S', file_name = @lv_file, sent_at = @lv_now
WHERE log_id = @ls_row-log_id.
ENDLOOP.
COMMIT WORK. " the outbound message and the marks, together
log( iv_type = 'S' iv_text = |{ lines( lt_send ) } records sent in { lv_file }| ).
CATCH cx_ai_system_fault INTO DATA(lx_fault).
ROLLBACK WORK.
log( iv_type = 'E' iv_text = lx_fault->get_text( ) ).
ENDTRY.
ENDMETHOD.
ZCL_HR_SFTP_SENDER → SEND_FILE
METHOD send_file.
" Where does this file go? One row per process, file and environment
SELECT SINGLE * FROM zhr_sftp_config
WHERE process = @iv_process AND file_id = @iv_file_id AND sysid = @sy-sysid
INTO @DATA(ls_cfg).
IF sy-subrc <> 0.
add_message( iv_type = 'E' iv_text = |No SFTP configuration for { iv_process }/{ iv_file_id } in { sy-sysid }| ).
RETURN.
ENDIF.
DATA(lv_path) = |{ ls_cfg-source_dir }/{ iv_file_name }|.
DATA(lv_xfile) = read_binary( lv_path ). " OPEN DATASET ... IN BINARY MODE
TRY.
NEW zco_sftp_file_out( logical_port_name = ls_cfg-logical_port )->send_file(
output = VALUE #( file = VALUE #(
name = iv_file_name
folder = ls_cfg-target_dir
content = cl_http_utility=>encode_x_base64( lv_xfile ) ) ) ).
COMMIT WORK.
" Only after a successful hand-over; the iFlow keeps its own backup copy
DELETE DATASET lv_path.
add_message( iv_type = 'S' iv_text = |{ iv_file_name } sent to { ls_cfg-target_dir }| ).
CATCH cx_ai_system_fault cx_ai_application_fault INTO DATA(lx_fault).
" SLG1 for support, an email for the business
add_message( iv_type = 'E' iv_text = lx_fault->get_text( ) ).
send_alert( iv_subject = |SFTP transfer failed: { iv_file_name }|
iv_body = lx_fault->get_text( ) ).
ENDTRY.
save_log( ). " BAL_DB_SAVE, visible in SLG1
ENDMETHOD.
IN_UPDATE runs in the update task, as part of the infotype save: plain database writes and no COMMIT.IN_UPDATE se ejecuta en la tarea de actualización, dentro de la grabación del infotipo: escrituras directas en base de datos y ningún COMMIT.
What the user did, translated into what the receiver understands.Lo que hizo el usuario, traducido a lo que entiende el receptor.
The receiver identifies an absence by its start date, so a moved start date is a delete plus an insert.El receptor identifica un absentismo por su fecha de inicio, así que mover la fecha de inicio es un borrado más un alta.
Consolidation: while a record is pending, every change updates the same row.Consolidación: mientras un registro está pendiente, cada cambio actualiza la misma fila.
An insert deleted before it leaves never travels at all.Un alta que se borra antes de salir no llega a viajar.
Resend mode: any file already sent can be rebuilt from the log in minutes. One file per run, with a parameter and not a range, so rows from two files never end up in one.Modo reenvío: cualquier fichero ya enviado se reconstruye desde el log en minutos. Un fichero por ejecución, con un parámetro y no un rango, para que nunca acaben filas de dos ficheros en uno.
One file per day with a predictable name, agreed with the receiver.Un fichero al día con un nombre predecible, pactado con el receptor.
Base64 of the xstring, not of the string: line endings and special characters arrive exactly as they left. The WSDL declares this field as a plain string and the iFlow decodes it; with base64Binary, the proxy would take the xstring and encode it itself.Base64 del xstring, no del string: los saltos de línea y los caracteres especiales llegan tal como salieron. El WSDL declara este campo como string y el iFlow lo decodifica; con base64Binary, el proxy recibiría el xstring y lo codificaría él.
Rows are marked by their own key. Marking by document number overwrote which file each earlier change had travelled in.Las filas se marcan por su propia clave. Marcarlas por número de documento machacaba en qué fichero había viajado cada cambio anterior.
A one-way proxy call is only sent on COMMIT WORK, in the same unit of work as the “sent” marks: both happen, or neither does.Una llamada a un proxy one-way solo sale con el COMMIT WORK, en la misma unidad de trabajo que las marcas de «enviado»: o pasan las dos cosas o ninguna.
If the proxy fails, nothing is marked and the rows travel in the next run. The error goes to SLG1.Si el proxy falla, no se marca nada y las filas viajan en la siguiente ejecución. El error queda en SLG1.
Where each file goes is configuration: a new site or environment is a table entry, not a transport.A dónde va cada fichero es configuración: un centro o un entorno nuevo es una entrada en la tabla, no un transporte.
The target folder travels with the file, so one iFlow serves every site.La carpeta destino viaja con el fichero, así que un solo iFlow sirve para todos los centros.
The original is deleted only after a successful hand-over.El original solo se borra después de una entrega correcta.
Errors go to SLG1 for support and by email to the business.Los errores van a SLG1 para soporte y por correo a negocio.
Result
Both flows run every day without anyone touching them, and every record can be traced to the file it travelled in.
Lessons
With a one-way service, “OK” in SAP only means the message reached SAP Integration Suite. The real check is the CPI message monitor and SRT_UTIL.
Encode the xstring directly (cl_http_utility=>encode_x_base64) so the file arrives byte for byte, line endings included.
Next step
Mark records as sent only when the receiver confirms, not when the proxy call succeeds. And move the BAdI logic into its own class, so the BAdI only calls it and the logic can be unit-tested.
Resultado
Los dos flujos se ejecutan cada día sin que nadie los toque, y cada registro se puede rastrear hasta el fichero en el que viajó.
Lecciones
Con un servicio one-way, el «OK» de SAP solo significa que el mensaje llegó a SAP Integration Suite. La comprobación real está en el monitor de mensajes de CPI y en SRT_UTIL.
Codifica directamente el xstring (cl_http_utility=>encode_x_base64) para que el fichero llegue idéntico byte a byte, saltos de línea incluidos.
Siguiente paso
Marcar los registros como enviados solo cuando el receptor confirme, no cuando la llamada al proxy vaya bien. Y sacar la lógica de la BAdI a una clase propia, para que la BAdI solo llame y la lógica se pueda probar con tests unitarios.
ABAP
Salary register: a report driven by a mapping tableRegistro retributivo: un informe dirigido por una tabla de mapeo
Every column of the legal salary register is a row in a table: an infotype field, wage types from the payroll cluster or a routine called by name. I adopted the framework for a new client and added two data origins to its engine.
Cada columna del registro retributivo es una fila de una tabla: un campo de infotipo, conceptos del clúster de nómina o una rutina llamada por su nombre. Adapté el framework a un cliente nuevo y añadí dos orígenes de datos a su motor.
Mapping tableTabla de mapeo→EngineMotor→INF · CLS · RUT · ICC · CRU→One row per contract situationUna fila por situación contractual→ALV · CSV
Metadata-drivenDirigido por metadatosDynamic callsLlamadas dinámicasRTTSPayroll clusterClúster de nómina
Context
Spanish companies must keep a salary register by gender and job group, in the format of the official tool published by the Ministry of Labour. Our team already had a metadata-driven extraction framework, used for a pay-gap report at another client. I adopted it for a new client’s register and extended its engine where it fell short.
How the framework works
A mapping table defines each report. One row per output column, keyed by country, report type and order, with validity dates. Several report types share the same engine.
Each column has an origin. INF reads an infotype field; CLS adds up wage types from the payroll cluster, by wage type or processing class, with sign and optional annualisation; RUT calls a routine by name; SYS gives the start and end of each segment.
Routines are methods. An employee class with about eighty methods that share one signature, so any of them can feed any column. A routine receives the values of the columns it depends on.
Split fields cut the period (contract key, personnel area…): one output row per contractual situation.
Dynamic output: the table is built at runtime from the mapping (RTTS) and shown in an ALV, with CSV export.
What I did
Parametrised the client’s register: every input column of the official tool’s data sheet mapped to an origin, with hidden helper columns for the dependencies.
Added four client-specific routines (working pattern, pay scale, salary level and job value) without touching the engine.
Extended the engine with two origins. ICC: amounts from infotypes 0008 and 0014, broken down by wage type through the same annual salary calculator that PA30 uses. CRU: wage types from the payroll results, handed to a routine that does the maths.
Business rules on IT0014: records that end before 31 December or start after 1 January projected over the months of payroll actually calculated, and consecutive records merged when only the amount changes.
Periods cut by the personnel actions in IT0000.
Contexto
Las empresas españolas deben llevar un registro retributivo por sexo y grupo profesional, con el formato de la herramienta oficial del Ministerio de Trabajo. Nuestro equipo ya tenía un framework de extracción dirigido por metadatos, usado para un informe de brecha salarial en otro cliente. Lo adapté al registro de un cliente nuevo y amplié su motor donde se quedaba corto.
Cómo funciona el framework
Una tabla de mapeo define cada informe. Una fila por columna de salida, con clave por país, tipo de informe y orden, y con fechas de validez. Varios tipos de informe comparten el mismo motor.
Cada columna tiene un origen. INF lee un campo de infotipo; CLS suma conceptos del clúster de nómina, por concepto o por clase de tratamiento, con signo y anualización opcional; RUT llama a una rutina por su nombre; SYS da el inicio y el fin de cada tramo.
Las rutinas son métodos. Una clase de empleado con unos ochenta métodos que comparten firma, así que cualquiera puede alimentar cualquier columna. Cada rutina recibe los valores de las columnas de las que depende.
Los campos de partición cortan el periodo (clave de contrato, división de personal…): una fila de salida por situación contractual.
Salida dinámica: la tabla se construye en tiempo de ejecución a partir del mapeo (RTTS) y se muestra en un ALV, con exportación a CSV.
Qué hice
Parametricé el registro del cliente: cada columna de entrada de la hoja de datos de la herramienta oficial, asociada a un origen, con columnas auxiliares ocultas para las dependencias.
Añadí cuatro rutinas propias del cliente (horario, escala, nivel retributivo y valoración del puesto) sin tocar el motor.
Amplié el motor con dos orígenes. ICC: importes de los infotipos 0008 y 0014 desglosados por concepto, con la misma calculadora de salario anual que usa PA30. CRU: conceptos de los resultados de nómina, entregados a una rutina que hace el cálculo.
Reglas de negocio del IT0014: los registros que terminan antes del 31 de diciembre o empiezan después del 1 de enero se proyectan sobre los meses de nómina realmente calculados, y los registros consecutivos se unen cuando solo cambia el importe.
Periodos cortados por las medidas del IT0000.
The code that mattersEl código que importa
Simplified, anonymised excerptExtracto simplificado y anonimizado
The mapping table is the report. The engine walks it column by column, and the routines are methods called by name. Below: a few rows of the table, the CRU origin I added to the engine, and one of the routines it calls.
La tabla de mapeo es el informe. El motor la recorre columna a columna, y las rutinas son métodos llamados por su nombre. Abajo: unas filas de la tabla, el origen CRU que añadí al motor y una de las rutinas a las que llama.
ZHR_REGISTER_MAP (SM30) · report type RR
OrderOrden
ColumnColumna
OriginOrigen
SourceFuente
Wage type / classConcepto / clase
SplitParte
Depends onDepende de
RoutineRutina
010
EmployeeEmpleado
INF
P0000-PERNR
019
_gender (helper)_sexo (auxiliar)
INF
P0002-GESCH
020
GenderSexo
RUT
019
GENDER_TEXT
100
Situation startInicio de la situación
SYS
segment startinicio del tramo
120
% working time% de jornada
RUT
WORKING_TIME_PCT
150
Contract keyClave de contrato
INF
P0061-PESOC
✓
219
_pay scale group (helper)_grupo de convenio (auxiliar)
INF
P0008-TRFGR
220
Job groupGrupo profesional
RUT
219
MAP_JOB_GROUP
290
Base salarySalario base
CLS
RT-BETRG
base salary wage typesconceptos de salario base
330
Variable pay, adjustedVariable, ajustado
CRU
RT-BETRG
class 30 = 1clase 30 = 1
120-130
PCT_IT14_IT15
ZHR_SALARY_REGISTER → FILL_ITABLE (excerpt)
" One output column per mapping row, in ORDER sequence. The engine does not
" know what a column means: the table says where its value comes from.
LOOP AT gt_mapping INTO DATA(ls_map).
CLEAR lv_value.
CASE ls_map-origin.
WHEN c_origin_inf. " infotype field, e.g. P0002-GBDAT
PERFORM read_infotype_field USING ls_map fini ffin CHANGING lv_value.
WHEN c_origin_rut. " routine of the employee class, by name
PERFORM read_dependencies USING ls_map-depends_on CHANGING lt_dep.
TRY.
CALL METHOD lo_employee->(ls_map-routine)
EXPORTING fini = fini ffin = ffin dep = lt_dep
IMPORTING value = lv_value.
CATCH cx_sy_dyn_call_error.
CLEAR lv_value. " one empty column, not a dump
ENDTRY.
WHEN c_origin_cru. " cluster + routine: the origin I added
CLEAR lt_wagetypes.
" gt_results: current results only (srtza = 'A'), so a recalculated month counts once
LOOP AT gt_results ASSIGNING FIELD-SYMBOL(<ls_result>).
LOOP AT <ls_result>-inter-rt INTO DATA(ls_rt).
IF ls_map-lgart IS NOT INITIAL.
CHECK ls_rt-lgart = ls_map-lgart.
ELSE. " or by processing class value
CALL FUNCTION 'HR_99S_GET_PROC_CLASS_VALUE'
EXPORTING p_molga = ls_map-molga
p_lgart = ls_rt-lgart
p_proc_class = ls_map-prcls
p_keydate = ffin
IMPORTING p_value = lv_class_value
p_return_code = lv_rc.
CHECK lv_rc = 0 AND lv_class_value = ls_map-prclv.
ENDIF.
ls_wagetype = VALUE #( lgart = ls_rt-lgart
betrg = COND #( WHEN ls_map-sign = '-' THEN 0 - ls_rt-betrg
ELSE ls_rt-betrg ) ).
COLLECT ls_wagetype INTO lt_wagetypes.
ENDLOOP.
ENDLOOP.
PERFORM read_dependencies USING ls_map-depends_on CHANGING lt_dep.
TRY.
CALL METHOD lo_employee->(ls_map-routine)
EXPORTING fini = fini ffin = ffin
dep = lt_dep
wagetypes = lt_wagetypes
months = lt_months " months with regular payroll
IMPORTING value = lv_value.
CATCH cx_sy_dyn_call_error.
CLEAR lv_value.
ENDTRY.
" ... CLS, ICC and SYS follow the same pattern
ENDCASE.
" The output row was created at runtime from this same table (RTTS):
" one component per column, named C + its ORDER (C010, C020…)
DATA(lv_column) = |C{ ls_map-orden }|.
ASSIGN COMPONENT lv_column OF STRUCTURE <ls_row> TO FIELD-SYMBOL(<lv_cell>).
IF sy-subrc = 0.
TRY.
<lv_cell> = lv_value.
CATCH cx_sy_conversion_no_number cx_sy_conversion_overflow.
CLEAR <lv_cell>.
ENDTRY.
ENDIF.
ENDLOOP.
ZCL_HR_REGISTER_EMPLOYEE → PCT_IT14_IT15
METHOD pct_it14_it15.
" Same signature as every other routine, plus the wage types and the months.
" dep[ 1 ] = % applied to every wage type
" dep[ 2 ] = extra % for the wage types the employee has in IT0014 / IT0015
DATA lv_pct_all TYPE decfloat34.
DATA lv_pct_itx TYPE decfloat34.
IF lines( dep ) >= 2.
lv_pct_all = dep[ 1 ]-valor.
lv_pct_itx = dep[ 2 ]-valor.
ENDIF.
" Which of these wage types come from IT0014 / IT0015 in the period?
SELECT lgart FROM pa0014
WHERE pernr = @mv_pernr AND begda <= @ffin AND endda >= @fini
INTO TABLE @DATA(lt_itx).
SELECT lgart FROM pa0015
WHERE pernr = @mv_pernr AND begda BETWEEN @fini AND @ffin
APPENDING TABLE @lt_itx.
DATA lv_sum_itx TYPE decfloat34.
DATA lv_sum_rest TYPE decfloat34.
LOOP AT wagetypes INTO DATA(ls_wt).
IF line_exists( lt_itx[ lgart = ls_wt-lgart ] ).
lv_sum_itx = lv_sum_itx + ls_wt-betrg.
ELSE.
lv_sum_rest = lv_sum_rest + ls_wt-betrg.
ENDIF.
ENDLOOP.
" Both sums get the first %, the IT0014/IT0015 amounts also the second
value = lv_sum_rest * lv_pct_all / 100
+ lv_sum_itx * lv_pct_all / 100 * lv_pct_itx / 100.
ENDMETHOD.
Rows starting with _ are helper columns: hidden in the output, but other columns depend on them.Las filas que empiezan por _ son columnas auxiliares: ocultas en la salida, pero otras columnas dependen de ellas.
Split marks the fields that cut the period: one output row per contractual situation.Parte marca los campos que cortan el periodo: una fila de salida por situación contractual.
Each row has validity dates, so the report can follow a change in the law without a transport.Cada fila tiene fechas de validez, así que el informe puede seguir un cambio legal sin transporte.
RUT: the routine is a method name stored in the table. About eighty methods share one signature, so any of them fits any column.RUT: la rutina es un nombre de método guardado en la tabla. Unos ochenta métodos comparten firma, así que cualquiera encaja en cualquier columna.
A wrong routine name empties one column instead of dumping the whole report.Un nombre de rutina erróneo deja vacía una columna en lugar de hacer un dump de todo el informe.
CRU, the new origin: wage types from the payroll results, maths in a routine.CRU, el origen nuevo: conceptos de los resultados de nómina, cálculo en una rutina.
Wage types chosen by number or by processing class value, so a new wage type with the right class is picked up without touching the table.Conceptos elegidos por número o por valor de clase de tratamiento, así que un concepto nuevo con la clase correcta entra sin tocar la tabla.
The routine receives the wage types, the months with payroll calculated and the values of the columns it depends on.La rutina recibe los conceptos, los meses con nómina calculada y los valores de las columnas de las que depende.
The output structure is built at runtime from the same table (RTTS), one component per column. Its name is C plus the order, because a component name cannot start with a digit.La estructura de salida se construye en tiempo de ejecución a partir de la misma tabla (RTTS), un componente por columna. Se llama C más el orden, porque el nombre de un componente no puede empezar por un número.
Dependencies arrive in the order written in the table (“120-130”): the routine never reads the output row itself.Las dependencias llegan en el orden escrito en la tabla («120-130»): la rutina nunca lee la fila de salida por su cuenta.
Which of the cluster’s wage types are recurring or additional payments in IT0014 / IT0015?¿Cuáles de los conceptos del clúster son devengos periódicos o pagos adicionales del IT0014 / IT0015?
The rule agreed with the functional team, in one place.La regla acordada con el equipo funcional, en un solo sitio.
Result
The client runs one report for its annual register, and the framework grows by adding rows and routines, not by rewriting the engine.
Next step
The engine still lives in FORM routines around the class: move it into a class of its own, with a unit test per origin.
Lesson
What works in dialog does not necessarily work in mass. The annual salary calculator kept static state between employees: invisible in PA30, wrong from the second employee in a report. Before touching a class shared with PA30 and payroll, I checked its where-used list and compared the report with PA30 for several employees in a row.
Resultado
El cliente ejecuta un solo informe para su registro anual, y el framework crece añadiendo filas y rutinas, no reescribiendo el motor.
Siguiente paso
El motor sigue viviendo en FORMs alrededor de la clase: pasarlo a una clase propia, con un test unitario por origen.
Lección
Lo que funciona en diálogo no tiene por qué funcionar en masivo. La calculadora de salario anual guardaba estado estático entre empleados: invisible en PA30, incorrecto a partir del segundo empleado en un informe. Antes de tocar una clase compartida con PA30 y con la nómina, revisé su lista de utilización y comparé el informe con PA30 para varios empleados seguidos.
ABAP
Garnishments: what payroll really withheld, period by periodEmbargos: lo que la nómina retuvo de verdad, periodo a periodo
For every court order: the debt, what payroll has withheld and what is pending, read from the payroll results, with the month-by-month detail one click away.
Para cada embargo: la deuda, lo que la nómina ha retenido y lo que queda pendiente, leído de los resultados de nómina, con el detalle mes a mes a un clic.
IT0887Payroll clusterClúster de nóminaSALV
Context
For every garnishment, payroll needs to know how much is left. The infotype holds the debt; what was really withheld lives in the payroll results, period by period. Starting from a garnishment report our team already had, I adapted it to a new client and built what it was missing.
What I did
One line per garnishment: employee, organisation, type, garnishment ID, issuing body, validity, total debt, withheld so far and pending.
Per-period detail behind a checkbox: year, period, amount withheld, accumulated amount and pending after each period.
Payroll results read from the start of the garnishment to its end or the cut-off date, archived periods included, counting each amount once.
Two drill-downs: the garnishment ID opens its month-by-month detail in a popup, and the personnel number jumps to the record in PA30.
Reviewed everything that belonged to the previous client: a hard-coded payroll area (now read from IT0001), a province derived from an organisational code convention, and subtype texts typed in the code.
Wrote the technical design, so the client knew what the report does and how.
Contexto
Para cada embargo, nómina necesita saber cuánto queda. El infotipo guarda la deuda; lo que se ha retenido de verdad vive en los resultados de nómina, periodo a periodo. Partiendo de un informe de embargos que ya tenía el equipo, lo adapté a un cliente nuevo y construí lo que le faltaba.
Qué hice
Una línea por embargo: empleado, organización, tipo, identificador del embargo, organismo emisor, vigencia, deuda total, retenido hasta la fecha y pendiente.
Detalle por periodo detrás de una casilla: año, periodo, importe retenido, acumulado y pendiente tras cada periodo.
Resultados de nómina leídos desde el inicio del embargo hasta su fin o la fecha de corte, periodos archivados incluidos, contando cada importe una sola vez.
Dos navegaciones: el identificador del embargo abre su detalle mes a mes en una ventana, y el número de personal salta al registro en PA30.
Revisé todo lo que venía del cliente anterior: un área de nómina fija en el código (ahora se lee del IT0001), una provincia deducida de una convención de códigos organizativos y textos de subtipo escritos en el código.
Redacté el diseño técnico, para que el cliente supiera qué hace el informe y cómo.
The code that mattersEl código que importa
Simplified, anonymised excerptExtracto simplificado y anonimizado
Where the numbers come from: the garnishment lines of every payroll result, matched to the case and counted once per period. And the two drill-downs that make the report useful.
De dónde salen los números: las líneas de embargo de cada resultado de nómina, emparejadas con el caso y contadas una vez por periodo. Y las dos navegaciones que hacen útil el informe.
ZHR_GARNISHMENTS → BUILD_OUTPUT
METHOD build_output.
DATA lt_results TYPE STANDARD TABLE OF payes_result WITH EMPTY KEY.
DATA lv_withheld TYPE pc28p-gmamt.
LOOP AT gt_p0887 INTO DATA(ls_case).
" From the start of the garnishment to its end or the cut-off date
DATA(lv_to) = COND d( WHEN ls_case-endda < p_cutoff THEN ls_case-endda ELSE p_cutoff ).
" Payroll periods from the employee's own payroll area (IT0001)
DATA(lv_abkrs) = get_payroll_area( iv_pernr = ls_case-pernr iv_date = lv_to ).
DATA(ls_from) = get_period( iv_date = ls_case-begda iv_abkrs = lv_abkrs ).
DATA(ls_until) = get_period( iv_date = lv_to iv_abkrs = lv_abkrs ).
CLEAR: lt_results, lv_withheld.
CALL FUNCTION 'HR_GET_PAYROLL_RESULTS'
EXPORTING pernr = ls_case-pernr
pabrj = ls_from-year
pabrp = ls_from-period
pabrj_end = ls_until-year
pabrp_end = ls_until-period
actual = 'A'
waers = ls_case-waers
arch_too = abap_true
TABLES result_tab = lt_results
EXCEPTIONS no_results = 1
OTHERS = 2.
LOOP AT lt_results INTO DATA(ls_result).
LOOP AT ls_result-nat-garnt INTO DATA(ls_garn) WHERE gmcid = ls_case-gmcid.
" Each amount once: only the line that belongs to this result's period.
" Monthly payroll: the period is the line's start month (YYYYMM)
CHECK ls_garn-begda(6) = ls_result-evp-inper.
lv_withheld = lv_withheld + ls_garn-gmamt.
IF p_detail = abap_true.
APPEND VALUE #( pernr = ls_case-pernr
gmcid = ls_case-gmcid
year = ls_result-evp-inper(4)
period = ls_result-evp-inper+4(2)
withheld = ls_garn-gmamt
total = lv_withheld
pending = ls_case-gmdeb - lv_withheld ) TO gt_detail.
ENDIF.
ENDLOOP.
ENDLOOP.
APPEND VALUE #( BASE CORRESPONDING #( ls_case )
withheld = lv_withheld
pending = ls_case-gmdeb - lv_withheld
locked = xsdbool( ls_case-sprps = abap_true ) ) TO gt_out.
ENDLOOP.
ENDMETHOD.
LCL_EVENTS → ON_LINK_CLICK
METHOD on_link_click. " CL_SALV_EVENTS_TABLE, event LINK_CLICK
DATA(ls_out) = gt_out[ row ].
CASE column.
WHEN 'GMCID'. " the garnishment, month by month
DATA(lt_detail) = FILTER #( gt_detail USING KEY by_case
WHERE pernr = ls_out-pernr AND gmcid = ls_out-gmcid ).
TRY.
cl_salv_table=>factory( IMPORTING r_salv_table = DATA(lo_popup)
CHANGING t_table = lt_detail ).
lo_popup->set_screen_popup( start_column = 10 end_column = 110
start_line = 3 end_line = 20 ).
lo_popup->display( ).
CATCH cx_salv_msg.
MESSAGE 'The detail could not be displayed' TYPE 'S' DISPLAY LIKE 'E'.
ENDTRY.
WHEN 'PERNR'. " straight to the garnishment record
SET PARAMETER ID 'PER' FIELD ls_out-pernr.
SET PARAMETER ID 'ITP' FIELD '0887'.
SET PARAMETER ID 'SUB' FIELD ls_out-subty.
CALL TRANSACTION 'PA30' WITH AUTHORITY-CHECK AND SKIP FIRST SCREEN.
ENDCASE.
ENDMETHOD.
Up to the end of the garnishment or the cut-off date, whichever comes first.Hasta el fin del embargo o la fecha de corte, lo que llegue antes.
The payroll area comes from IT0001. The report I started from had it hard-coded.El área de nómina sale del IT0001. El informe del que partí la tenía fija en el código.
Archived periods count too, so old garnishments still add up.Los periodos archivados también cuentan, así que los embargos antiguos siguen cuadrando.
Each amount counted once: only the garnishment line that belongs to the result’s own period. This relies on monthly payroll, where the period number is the month; with weekly or other periods, compare with the period’s dates instead.Cada importe se cuenta una vez: solo la línea de embargo que pertenece al periodo del propio resultado. Esto se apoya en una nómina mensual, donde el número de periodo es el mes; con periodos semanales u otros, compara con las fechas del periodo.
The per-period detail is built only when it is asked for, so the header stays fast.El detalle por periodo solo se genera cuando se pide, así que la cabecera sigue siendo rápida.
The garnishment ID opens its own detail in a popup ALV. It is only a hotspot when the detail was requested.El identificador del embargo abre su detalle en un ALV emergente. Solo es un hotspot cuando se ha pedido el detalle.
The personnel number opens the garnishment infotype in PA30, with an authority check.El número de personal abre el infotipo de embargos en PA30, con comprobación de autorizaciones.
Result
Payroll answers “how much is left?” in seconds, and can show exactly when each amount was withheld.
Lesson
Reusing a report is not copying it: every hard-coded value is somebody else’s configuration.
Resultado
Nómina responde a «¿cuánto queda?» en segundos, y puede enseñar exactamente cuándo se retuvo cada importe.
Lección
Reutilizar un informe no es copiarlo: cada valor fijo en el código es la configuración de otro.
ABAP
Concur expenses to FI with one-time vendorsGastos de Concur a FI con acreedores CPD
Expense reports with occasional vendors from several countries, posted one document per vendor and all checked before any is posted.
Informes de gastos con proveedores ocasionales de varios países, contabilizados con un documento por proveedor y todos comprobados antes de contabilizar ninguno.
FIBAPISAP Concur
Why it was hard
Expenses with vendors that do not exist in master data (hotels, restaurants) from different countries are posted to a one-time vendor account.
The same vendor number for all of them, depending on the company code; the real vendor data (name, tax ID, country) travels in the one-time data block.
Concur and SAP data had to be crossed and built in a specific order of line items and steps.
The blocker: BAPI_ACC_DOCUMENT_POST accepts only one one-time vendor per document, and one expense report could have several.
How I solved it
Split the report: one FI document per one-time vendor, each with two lines, the employee’s vendor account and the one-time vendor with its withholding tax.
A unique reference per document (base plus counter) so it never hits the duplicate check.
Two passes: BAPI_ACC_DOCUMENT_CHECK for every document first and, only if all pass, post and commit. If one fails, it is logged and the report goes back flagged as an error.
Tax ID validated with each country's own rules (TAX_NUMBER_CHECK) and, for EU vendors, the VAT number checked with EU_TAX_NUMBER_CHECK and passed through EXTENSION1.
Every document linked to its Concur report, so the standard never posts it twice.
Por qué era difícil
Los gastos con proveedores que no existen en el maestro (hoteles, restaurantes) de distintos países se contabilizan contra un acreedor CPD (One Time Vendor).
El mismo número de acreedor para todos, dependiente de la sociedad; los datos reales del proveedor (nombre, NIF, país) viajan en el bloque de datos CPD.
Había que cruzar datos de Concur y de SAP y montarlo todo en un orden concreto de posiciones y de pasos.
El bloqueo: BAPI_ACC_DOCUMENT_POST solo admite un acreedor CPD por documento, y un informe de gastos podía traer varios.
Cómo lo resolví
Partir el informe: un documento FI por acreedor CPD, cada uno con dos posiciones, el acreedor del empleado y el acreedor CPD con sus retenciones.
Una referencia única por documento (base más contador) para no chocar con el control de duplicados.
Dos pasadas: primero BAPI_ACC_DOCUMENT_CHECK para todos los documentos y, solo si pasan todos, contabilizar y hacer commit. Si uno falla, queda en el log y el informe vuelve marcado como error.
NIF validado con las reglas de su país (TAX_NUMBER_CHECK) y, en proveedores de la UE, el NIF-IVA comprobado con EU_TAX_NUMBER_CHECK y pasado por EXTENSION1.
Cada documento enlazado con su informe de Concur, para que el estándar nunca lo contabilice dos veces.
The code that mattersEl código que importa
Simplified, anonymised excerptExtracto simplificado y anonimizado
The split and the two passes, inside the enhancement that receives the expense documents before the standard posts them. And the tax ID check: the national tax ID with its country's rules and, in the EU, the VAT number too.
La partición y las dos pasadas, dentro de la ampliación que recibe los documentos de gastos antes de que el estándar los contabilice. Y la comprobación del NIF: el nacional con las reglas de su país y, en la UE, también el NIF-IVA.
Concur → FI enhancement · POST_ONE_TIME_VENDORS
" One FI document per one-time vendor
LOOP AT lt_vendors INTO DATA(ls_vendor).
DATA(lv_n) = sy-tabix.
APPEND VALUE ty_fi_doc(
header = VALUE #( BASE ls_header ref_doc_no = |{ lv_ref_base } { lv_n }| )
payable = VALUE #( ( itemno_acc = 1 vendor_no = lv_employee_vendor )
( itemno_acc = 2 vendor_no = lv_one_time_vendor ) )
amounts = VALUE #( ( itemno_acc = 1 currency = ls_vendor-waers amt_doccur = 0 - ls_vendor-amount )
( itemno_acc = 2 currency = ls_vendor-waers amt_doccur = ls_vendor-amount ) )
wtax = renumber_wtax( it_wtax = ls_vendor-wtax iv_item = 2 )
cpd = VALUE #( name = ls_vendor-name city = ls_vendor-city
country = ls_vendor-country tax_no_1 = ls_vendor-tax_id )
ext = VALUE #( ( field1 = 'STCEG' field2 = ls_vendor-vat_id ) ) ) TO lt_docs.
ENDLOOP.
" Pass 1: check every document, post none
LOOP AT lt_docs INTO DATA(ls_doc).
CALL FUNCTION 'BAPI_ACC_DOCUMENT_CHECK'
EXPORTING documentheader = ls_doc-header
customercpd = ls_doc-cpd
TABLES accountpayable = ls_doc-payable
currencyamount = ls_doc-amounts
accountwt = ls_doc-wtax
extension1 = ls_doc-ext
return = lt_return.
IF line_exists( lt_return[ type = 'E' ] ) OR line_exists( lt_return[ type = 'A' ] ).
log_errors( lt_return ). " back to the standard flow, flagged as an error
RETURN.
ENDIF.
ENDLOOP.
" Pass 2: all valid, so post them and link each one to its Concur report
LOOP AT lt_docs INTO ls_doc.
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING documentheader = ls_doc-header
customercpd = ls_doc-cpd
IMPORTING obj_key = lv_obj_key
TABLES accountpayable = ls_doc-payable
currencyamount = ls_doc-amounts
accountwt = ls_doc-wtax
extension1 = ls_doc-ext
return = lt_return.
IF line_exists( lt_return[ type = 'E' ] ) OR line_exists( lt_return[ type = 'A' ] ).
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
log_errors( lt_return ). " rare after pass 1: a lock or a number range
EXIT. " documents already posted stay linked
ENDIF.
link_to_report( lv_obj_key ). " BELNR / GJAHR stored with the report
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' EXPORTING wait = abap_true.
ENDLOOP.
CLEAR ct_acc_documents. " the standard must not post them again
… → CHECK_TAX_ID
METHOD check_tax_id.
" Every vendor: national tax ID (tax number 1), with its country's rules.
" EU vendors (T005-XEGLD) also carry a VAT number (STCEG), with its own check.
DATA lv_tax1 TYPE stcd1.
DATA lv_vat TYPE stceg.
lv_tax1 = is_vendor-tax_id.
lv_vat = is_vendor-vat_id.
CALL FUNCTION 'TAX_NUMBER_CHECK'
EXPORTING country = is_vendor-country
tax_code_1 = lv_tax1
EXCEPTIONS OTHERS = 1.
IF sy-subrc <> 0.
rv_valid = abap_false.
RETURN.
ENDIF.
SELECT SINGLE xegld FROM t005 WHERE land1 = @is_vendor-country INTO @DATA(lv_eu).
IF lv_eu = abap_true AND lv_vat IS NOT INITIAL.
CALL FUNCTION 'EU_TAX_NUMBER_CHECK'
EXPORTING country = is_vendor-country
eu_tax_number = lv_vat
EXCEPTIONS OTHERS = 1.
IF sy-subrc <> 0.
rv_valid = abap_false.
RETURN.
ENDIF.
ENDIF.
rv_valid = abap_true.
ENDMETHOD.
One document per one-time vendor: the BAPI accepts a single CUSTOMERCPD block per document.Un documento por acreedor CPD: la BAPI solo admite un bloque CUSTOMERCPD por documento.
Base reference plus a counter, so the duplicate check never blocks the second document.Referencia base más contador, para que el control de duplicados nunca bloquee el segundo documento.
Two lines per document, balanced: the employee’s vendor account against the one-time vendor.Dos posiciones por documento, cuadradas: el acreedor del empleado frente al acreedor CPD.
Pass 1 checks everything and posts nothing. One error and the whole report goes back, flagged.La pasada 1 lo comprueba todo y no contabiliza nada. Un error y el informe entero vuelve, marcado.
Pass 2 posts and links every document to its Concur report, so the standard never posts it twice.La pasada 2 contabiliza y enlaza cada documento con su informe de Concur, para que el estándar nunca lo contabilice dos veces.
The post result is checked too. After pass 1 a failure is rare (a lock, a number range), but if one happens, that document is rolled back and logged, and the ones already posted keep their link, so they are never posted twice.También se comprueba el resultado de la contabilización. Tras la pasada 1 un fallo es raro (un bloqueo, un rango de números), pero si ocurre, ese documento se deshace y queda en el log, y los ya contabilizados conservan su enlace, así que nunca se contabilizan dos veces.
One commit per document, with its link in the same unit of work: no document is ever saved without its link to the report.Un commit por documento, con su enlace en la misma unidad de trabajo: ningún documento se guarda sin su enlace al informe.
The national tax ID goes in tax number 1, the same field the split fills in the one-time vendor block, and SAP's own rules for that country check it.El NIF nacional va en el número de identificación fiscal 1, el mismo campo que rellena la partición en el bloque CPD, y lo comprueban las reglas del propio SAP para ese país.
The EU VAT number is a different field (STCEG) with its own check. It reaches the document through EXTENSION1 and a business transaction event (RWBAPI01).El NIF-IVA comunitario es otro campo (STCEG) con su propia comprobación. Llega al documento por EXTENSION1 y un evento de BTE (RWBAPI01).
How I tell it
“I’m a payroll developer, but I got the FI side of Concur. The key was to split each report into one document per vendor and check them all before posting any: either the whole report goes in, or nothing does.”
Next step
Move the check and post calls, which repeat the same parameters in both passes, into one method, and cover the tax ID rules with a unit test per country.
Cómo lo cuento
«Soy desarrollador de nómina, pero me tocó la parte FI de Concur. La clave fue partir cada informe en un documento por proveedor y comprobarlos todos antes de contabilizar ninguno: o entra el informe entero, o no entra nada.»
Siguiente paso
Llevar las llamadas de comprobación y contabilización, que repiten los mismos parámetros en las dos pasadas, a un único método, y cubrir las reglas de NIF con un test unitario por país.
ABAP
Payroll accounting report: retro and splitsInforme contable de nómina: retroactividad y particiones
A posting report that had to match the standard wage type reporter, including retroactive recalculations and split periods. The fix came from telling a split apart from a recalculation.
Un informe de contabilización que tenía que cuadrar con el reporter estándar de conceptos, incluidos los recálculos retroactivos y los periodos partidos. La solución llegó al distinguir una partición de un recálculo.
A / A → totalA / P → A − PP / O → P − OSplits → sumParticiones → suma
RGDIRRetroRetroactividadSplitsParticionesWPBP
Context
A custom accounting report had to match the standard wage type reporter (PC00_M99_CWTR). In in-period view, recalculated months showed the full amount instead of the difference: a January wage type was 1,737.36 in the original run and 1,737.74 in a later recalculation, so 0.38 should be posted, but the report showed 1,737.74.
What I did
Rebuilt the logic on the payroll directory (RGDIR): each result minus its predecessor. A/A gives the total, A/P gives A − P and P/O gives P − O.
The twist: an employee with January split in two periods (days 1–30 and day 31) showed −1,297.20 instead of 1,341.93 + 44.73 = 1,386.66. The code was treating the second split as a recalculation.
Diagnosed it as a split, not a recalculation, and moved the logic from single results to sets: every split of the month calculated in the selected period is added, every split of the previous calculation is subtracted, however many splits there are.
Validated every case against the standard report, and explained why the ALV now had fewer lines: splits with the same cost centre collapse into one.
Contexto
Un informe contable a medida tenía que cuadrar con el reporter estándar de conceptos (PC00_M99_CWTR). En la vista en-periodo, los meses recalculados salían con el importe completo en lugar de la diferencia: un concepto de enero valía 1.737,36 en el cálculo original y 1.737,74 en un recálculo posterior, así que había que contabilizar 0,38, pero el informe mostraba 1.737,74.
Qué hice
Rehice la lógica sobre el directorio de nómina (RGDIR): cada resultado menos su antecesor. A/A da el total, A/P da A − P y P/O da P − O.
El giro: un empleado con enero partido en dos tramos (del día 1 al 30 y el día 31) salía a −1.297,20 en lugar de 1.341,93 + 44,73 = 1.386,66. El código trataba el segundo tramo como un recálculo.
Lo diagnostiqué como una partición, no un recálculo, y pasé la lógica de resultados sueltos a conjuntos: se suman todos los tramos del mes calculados en el periodo seleccionado y se restan los del cálculo anterior, haya los tramos que haya.
Validé cada caso contra el informe estándar y expliqué por qué el ALV tenía ahora menos líneas: los tramos con el mismo centro de coste se unen en una.
The code that mattersEl código que importa
Simplified, anonymised excerptExtracto simplificado y anonimizado
The fix, in code: work with sets of splits instead of single results, and let a sign do what special cases used to do.
La solución, en código: trabajar con conjuntos de tramos en lugar de resultados sueltos, y dejar que un signo haga lo que antes hacían los casos especiales.
ZHR_PAYROLL_POSTING → LCL_RETRO
METHOD process_for_period.
" One for-period, seen from the selected in-period:
" current set = every split of it calculated in this in-period → added
" previous set = every split of it in the previous in-period → subtracted
DATA(lt_current) = build_set( iv_fpper = iv_fpper iv_inper = iv_inper ).
" The previous in-period that calculated this for-period, if any
DATA(lv_prev) = REDUCE iperi( INIT p = VALUE iperi( )
FOR d IN gt_rgdir
WHERE ( fpper = iv_fpper AND inper < iv_inper )
NEXT p = COND #( WHEN d-inper > p THEN d-inper ELSE p ) ).
DATA(lt_previous) = COND tt_rgdir( WHEN lv_prev IS NOT INITIAL
THEN build_set( iv_fpper = iv_fpper iv_inper = lv_prev ) ).
" A/A → total · A/P → A − P · P/O → P − O · splits → sum
add_set( it_set = lt_current iv_sign = 1 ).
add_set( it_set = lt_previous iv_sign = -1 ).
ENDMETHOD.
METHOD build_set.
" One row per split (FPBEG/FPEND), however many there are
LOOP AT gt_rgdir INTO DATA(ls_dir) WHERE fpper = iv_fpper AND inper = iv_inper.
READ TABLE rt_set ASSIGNING FIELD-SYMBOL(<ls_split>)
WITH KEY fpbeg = ls_dir-fpbeg fpend = ls_dir-fpend.
IF sy-subrc <> 0.
APPEND ls_dir TO rt_set.
ELSEIF ls_dir-seqnr > <ls_split>-seqnr.
<ls_split> = ls_dir. " recalculated twice: latest wins
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD add_set.
LOOP AT it_set INTO DATA(ls_dir).
DATA(ls_result) = read_result( ls_dir-seqnr ). " PYXX_READ_PAYROLL_RESULT
LOOP AT ls_result-inter-rt INTO DATA(ls_rt) WHERE lgart IN gr_lgart.
" Each split brings its own WPBP: a cost-centre change gives two lines
DATA(ls_wpbp) = VALUE pc205( ls_result-inter-wpbp[ apznr = ls_rt-apznr ] OPTIONAL ).
DATA(ls_line) = VALUE ty_line( fpper = ls_dir-fpper
kostl = ls_wpbp-kostl
lgart = ls_rt-lgart
betrg = ls_rt-betrg * iv_sign ).
COLLECT ls_line INTO gt_lines. " same key → one line with the total
ENDLOOP.
ENDLOOP.
ENDMETHOD.
The previous in-period is looked up, not assumed: a retro run can come months later.El in-period anterior se busca, no se supone: un recálculo puede llegar meses después.
Nothing to subtract the first time a month is calculated: A/A gives the full amount.La primera vez que se calcula un mes no hay nada que restar: A/A da el importe completo.
A sign instead of special cases: the same two lines cover A/A, A/P and P/O.Un signo en lugar de casos especiales: las mismas dos líneas cubren A/A, A/P y P/O.
The fix: every split of the month goes into the set and is added. 1,341.93 + 44.73 = 1,386.66 instead of −1,297.20.La solución: cada tramo del mes entra en el conjunto y se suma. 1.341,93 + 44,73 = 1.386,66 en lugar de −1.297,20.
A split recalculated twice in the same in-period: only the latest result counts.Un tramo recalculado dos veces en el mismo in-period: solo cuenta el último resultado.
Cost centre per split, from each split’s own WPBP, the same as the standard does.Centro de coste por tramo, desde la WPBP de cada tramo, igual que el estándar.
Result
The report matches the standard for normal, retroactive and split periods.
Lesson
Partition is not recalculation, and the standard is the only source of truth. The payroll result keeps no difference per wage type: only the difference in the amount paid out, in /551 and /552. The difference per wage type has to be calculated, so first find out which view each user expects.
Resultado
El informe cuadra con el estándar en periodos normales, retroactivos y partidos.
Lección
Una partición no es un recálculo, y el estándar es la única fuente de verdad. El resultado de nómina no guarda la diferencia de cada concepto: solo la del importe a pagar, en /551 y /552. La diferencia por concepto hay que calcularla, así que primero averigua qué vista espera cada usuario.
More projectsMás proyectos
Support, fixes and smaller evolutives: less headline, same care.
Soporte, correcciones y evolutivos más pequeños: menos titular, el mismo cuidado.
Period, not pay datePeriodo, no fecha de pagoPCC: 403 to workingPCC: del 403 a funcionarSEPA urgent paymentsSEPA urgentesConcur employee filesFicheros de Concur
+4
Smaller pieces of work that did not make the main list, but say something about how I work. Open any of them for the details.
Trabajos más pequeños que no entran en la lista principal, pero que dicen algo de cómo trabajo. Abre cualquiera para ver los detalles.
Payroll · FixNómina · CorrecciónPayroll report: master data from the right periodInforme de nómina: datos maestros del periodo correctoRows with empty or mixed-up organisational data, traced back to one root cause.Filas con datos organizativos vacíos o mezclados, hasta llegar a una sola causa.
Context
Two incidents in payroll reports built on the wage type reporter. A new hire on the 30th, paid on the 29th, came out with company, agreement and social security account empty. And employees with retro runs or several splits showed, on their old rows, the organisational data of their latest record.
What I did
Before touching code, confirmed in PC_PAYRESULT that the payroll results were legitimate: the problem was the report, not the data.
Found one root cause behind both: master data was read at the payment date instead of for the payroll period.
Changed the reference date to the payroll period, sorted every infotype newest first and cleared the helper fields between rows, so nothing carries over from one row to the next.
Tested with ordinary employees too before transporting, so the fix did not break what already worked.
Contexto
Dos incidencias en informes de nómina construidos sobre el reporter de conceptos. Un alta del día 30, pagada el 29, salía con la sociedad, el convenio y el código de cuenta de cotización vacíos. Y los empleados con recálculos o varios tramos mostraban, en sus filas antiguas, los datos organizativos de su último registro.
Qué hice
Antes de tocar código, confirmé en PC_PAYRESULT que los resultados de nómina eran legítimos: el problema era el informe, no los datos.
Encontré una sola causa detrás de las dos: los datos maestros se leían a la fecha de pago y no para el periodo de nómina.
Cambié la fecha de referencia al periodo de nómina, ordené todos los infotipos del más reciente al más antiguo y limpié los campos auxiliares entre filas, para que nada se arrastre de una fila a la siguiente.
Probé también con empleados normales antes de transportar, para que la corrección no rompiera lo que ya funcionaba.
The code that mattersEl código que importa
Simplified, anonymised excerptExtracto simplificado y anonimizado
The fix: the reference date comes from the payroll period, taken from the payroll calendar, and each infotype is read newest first.
La corrección: la fecha de referencia sale del periodo de nómina, según el calendario de nómina, y cada infotipo se lee del más reciente al más antiguo.
" Reference date = last day of the payroll period (FPPER), not the payment date.
" The period's dates come from the payroll calendar (T549Q), so weekly or
" four-weekly payroll areas work too, not only monthly ones
DATA(lv_pabrj) = CONV pabrj( <lv_fpper>(4) ).
DATA(lv_pabrp) = CONV pabrp( <lv_fpper>+4(2) ).
SELECT SINGLE t549q~endda
FROM t549a INNER JOIN t549q ON t549q~permo = t549a~permo
WHERE t549a~abkrs = @<lv_abkrs>
AND t549q~pabrj = @lv_pabrj
AND t549q~pabrp = @lv_pabrp
INTO @lv_ref_date.
IF sy-subrc <> 0.
lv_ref_date = <lv_paydt>. " fallback: the previous behaviour
ENDIF.
" Newest first: the first record that starts on or before the reference date
" is the one valid in that period
SORT p0001 BY begda DESCENDING.
LOOP AT p0001 ASSIGNING FIELD-SYMBOL(<ls_p0001>).
CHECK <ls_p0001>-begda <= lv_ref_date OR sy-tabix = lines( p0001 ).
" ... company code, personnel area and subarea, payroll area
EXIT.
ENDLOOP.
Result
Every row shows the organisation, agreement and social security account of its own period: hires, leavers, retro and splits included.
Resultado
Cada fila muestra la organización, el convenio y la cuenta de cotización de su propio periodo, incluidas altas, bajas, recálculos y tramos.
ECP support · Payroll Control CenterSoporte ECP · Payroll Control CenterPayroll Control Center: from 403 to workingPayroll Control Center: del 403 a funcionarWhy PCC tabs failed from SuccessFactors, a dump in PA30, and the audit trail for payroll.Por qué fallaban las pestañas del PCC desde SuccessFactors, un dump en PA30 y el audit trail para nómina.
Context
Payroll users opening Payroll Control Center tabs from SuccessFactors got “403 Forbidden”, and some infotype screens dumped.
What I did
Worked out who returned the 403. PCC tabs are UI5 apps that live in ECP, and some of their SICF services were inactive (for example hrpy_pcc_mc_1 for My Teams). Activating them fixed the tabs.
Traced the dump to a prototype BAdI implementation that was still active and was also overwriting the working-time percentage in IT0008. Proposed deactivating and deleting it.
The PCC audit trail lives in ECP, not in SuccessFactors: added a link to it on the SuccessFactors home page for the payroll team.
Flagged ahead of time that SuccessFactors was retiring HTTP Basic Authentication for its APIs (it ended on 20 November 2026), so the connections could move to OAuth before they broke.
Contexto
Los usuarios de nómina que abrían pestañas del Payroll Control Center desde SuccessFactors recibían «403 Forbidden», y algunas pantallas de infotipos daban dump.
Qué hice
Averigüé quién devolvía el 403. Las pestañas del PCC son aplicaciones UI5 que viven en ECP, y algunos de sus servicios SICF estaban inactivos (por ejemplo hrpy_pcc_mc_1, el de «Mis equipos»). Al activarlos, las pestañas funcionaron.
Llegué al origen del dump: una implementación de BAdI de prototipo que seguía activa y que además pisaba el porcentaje de jornada del IT0008. Propuse desactivarla y borrarla.
El audit trail del PCC vive en ECP, no en SuccessFactors: añadí un enlace en la página de inicio de SuccessFactors para el equipo de nómina.
Avisé con tiempo de que SuccessFactors iba a retirar la autenticación HTTP Basic en sus APIs (se retiró el 20 de noviembre de 2026), para pasar las conexiones a OAuth antes de que fallaran.
Result
PCC working end to end from SuccessFactors, one silent data corruption removed, and the audit trail one click away.
Resultado
El PCC funciona de punta a punta desde SuccessFactors, se eliminó una corrupción silenciosa de datos y el audit trail está a un clic.
Payroll · Bank transfersNómina · TransferenciasIn testingEn pruebasSEPA payroll transfers: urgent payments and categoriesTransferencias SEPA de nómina: pagos urgentes y categoríasThe transfer file sets urgency and payment category from a table that payroll maintains.El fichero de transferencias marca la urgencia y la categoría del pago desde una tabla que mantiene nómina.
Context
Payroll needed to flag some transfers as urgent (severance pay, advances) and set the payment category in the SEPA XML, without changing the payment method in IT0009.
What I did
A custom table, maintained by payroll per employee and payment date, with an urgent flag and an internal category (salary, advance, settlement, severance) that maps to the ISO 20022 code the bank expects, such as SALA.
A DMEE exit for the payment tree that fills InstrPrty (HIGH), SvcLvl (URGP or SEPA), CtgyPurp and the remittance text.
No entry in the table means standard behaviour: the code only writes when there is something to change.
Buffered reads, records marked as processed once used, and processed entries locked against edits.
Contexto
Nómina necesitaba marcar algunas transferencias como urgentes (finiquitos, anticipos) e informar la categoría del pago en el XML SEPA, sin cambiar la vía de pago del IT0009.
Qué hice
Una tabla a medida, mantenida por nómina por empleado y fecha de pago, con una marca de urgencia y una categoría interna (nómina, anticipo, finiquito, indemnización) que se traduce al código ISO 20022 que espera el banco, como SALA.
Un exit de DMEE para el árbol de pagos que informa InstrPrty (HIGH), SvcLvl (URGP o SEPA), CtgyPurp y el texto del concepto.
Sin entrada en la tabla, comportamiento estándar: el código solo escribe cuando hay algo que cambiar.
Lecturas con buffer, registros marcados como procesados una vez usados y entradas procesadas bloqueadas para que no se editen.
Lessons
Write to the parameter where the value arrives: some DMEE nodes carry it in C_VALUE and others in O_VALUE.
The category is set per payment block, not per transaction, so urgent and normal payments should not be mixed in one run. And SEPA does not accept accented characters.
Lecciones
Escribe en el parámetro por el que llega el valor: unos nodos de DMEE lo traen en C_VALUE y otros en O_VALUE.
La categoría se informa por bloque de pago, no por transacción, así que los pagos urgentes y los normales no deberían ir mezclados en la misma ejecución. Y SEPA no admite tildes.
Beyond payroll · HCM → ConcurMás allá de la nómina · HCM → ConcurEmployee files for SAP Concur: approvers and travel profileFicheros de empleados para SAP Concur: aprobadores y perfil de viajeTwo evolutives on the report that feeds Concur with employees.Dos evolutivos sobre el informe que alimenta Concur con los empleados.
Context
A custom report builds the employee file that SAP Concur imports, either on the PC or on the application server. The business needed two new things in it.
What I did
Record 305 · second approver: read from a custom table maintained by the business. A CLEAR in the right place stops an employee from inheriting the approver of the previous one in the loop.
Record 350 · travel profile: travel class derived from the job level, and the org unit mapped through a customizing table instead of the code, resolved by personnel subarea, then personnel area, then company code.
Contexto
Un informe a medida genera el fichero de empleados que importa SAP Concur, en el PC o en el servidor de aplicación. Negocio necesitaba dos cosas nuevas en él.
Qué hice
Registro 305 · segundo aprobador: leído de una tabla a medida que mantiene negocio. Un CLEAR en el sitio justo evita que un empleado herede el aprobador del anterior en el bucle.
Registro 350 · perfil de viaje: clase de viaje según el nivel del puesto, y la unidad organizativa mapeada en una tabla de customizing en lugar de en el código, resuelta por subdivisión, después por división y después por sociedad.
Lesson
In a loop, clear everything that belongs to the employee. A leftover value does not fail: it just says something false.
Lección
En un bucle, limpia todo lo que pertenece al empleado. Un valor que se queda de la vuelta anterior no falla: simplemente dice algo falso.
DocsDocumentación
Notes from the EC ↔ ECP trenchesNotas desde las trincheras EC ↔ ECP
What I look up often, written down so it helps others too.
Lo que consulto a menudo, por escrito para que también le sirva a otros.
How an employee travels from EC to ECPCómo viaja un empleado de EC a ECP
Point-to-point replication step by step: who calls whom, where custom logic goes and where to look when it fails.
La replicación point-to-point paso a paso: quién llama a quién, dónde va la lógica a medida y dónde mirar cuando falla.
Job in ECPJob en ECP→Compound Employee API→BIB mapping + BAdIsMapeo BIB + BAdIs→InfotypesInfotipos→SLG1 + DRM
PTPBIBDRM
The ECP replication program, RP_HRSFEC_PTP_EE_REPLICATION (transaction HRSFEC_PTP_EE_REPL), usually scheduled as a job, calls the Compound Employee API in Employee Central.
Employee Central returns the employees changed since the last run.
The Business Integration Builder applies the field and value mappings, runs the replication BAdIs and writes the infotypes.
Each employee's result goes to the application log (SLG1, object HRSFEC, subobject EMPLOYEE, external ID = the employee's ID in EC) and back to Employee Central. Subobject EMPLOYEE_PTP holds the technical log of each run: the query sent to EC and the confirmation back.
In Employee Central, the Data Replication Monitor shows the status per employee.
Where custom logic goes
Logic that needs the whole employee goes in the common BAdI: HRSFEC_B_CE_PROCESS_EMPLOYEE, method PROCESS_EMPLOYEE_COMMON_ADDIN, in enhancement spot HRSFEC_CE_MASTER_DATA_REPL. Infotype-specific BAdIs, such as the one for IT0008, only run when that infotype is in the BIB field mapping: check it with an external breakpoint before building on it.
Never inside the BIB
No COMMIT WORK, no HR_INFOTYPE_OPERATION on the same employee. The replication has its own unit of work and locks: write through IF_HRPA_MASTERDATA_BL and let it commit.
To debug one employee
Run the replication for a single Person ID and compare with the SFAPI Audit Log in Employee Central: there you see exactly what was sent. To step through it, set an external breakpoint in CL_HRSFEC_EE_MDR_MAIN, method PROCESS_EMPLOYEE, or in your own BAdI implementation.
El programa de replicación de ECP, RP_HRSFEC_PTP_EE_REPLICATION (transacción HRSFEC_PTP_EE_REPL), normalmente planificado en un job, llama a la Compound Employee API de Employee Central.
Employee Central devuelve los empleados modificados desde la última ejecución.
El Business Integration Builder aplica los mapeos de campos y valores, ejecuta las BAdIs de replicación y graba los infotipos.
El resultado de cada empleado va al log de aplicación (SLG1, objeto HRSFEC, subobjeto EMPLOYEE, ID externo = el ID del empleado en EC) y de vuelta a Employee Central. El subobjeto EMPLOYEE_PTP guarda el log técnico de cada ejecución: la consulta enviada a EC y la confirmación de vuelta.
En Employee Central, el Data Replication Monitor muestra el estado de cada empleado.
Dónde va la lógica a medida
La lógica que necesita el empleado completo va en la BAdI común: HRSFEC_B_CE_PROCESS_EMPLOYEE, método PROCESS_EMPLOYEE_COMMON_ADDIN, en el punto de ampliación HRSFEC_CE_MASTER_DATA_REPL. Las BAdIs específicas de infotipo, como la del IT0008, solo se ejecutan cuando ese infotipo está en el mapeo de campos del BIB: compruébalo con un breakpoint externo antes de construir sobre ellas.
Nunca dentro del BIB
Ni COMMIT WORK ni HR_INFOTYPE_OPERATION sobre el mismo empleado. La replicación tiene su propia unidad de trabajo y sus bloqueos: graba a través de IF_HRPA_MASTERDATA_BL y deja que confirme ella.
Para depurar un empleado
Lanza la replicación para un único Person ID y compara con el SFAPI Audit Log de Employee Central: ahí ves exactamente lo que se ha enviado. Para seguirla paso a paso, pon un breakpoint externo en CL_HRSFEC_EE_MDR_MAIN, método PROCESS_EMPLOYEE, o en tu propia implementación de la BAdI.
Key transactionsTransacciones de cabecera
The transactions and programs I use most on an EC ↔ ECP project, and what each one is for.
Las transacciones y programas que más uso en un proyecto EC ↔ ECP, y para qué sirve cada uno.
HRSFEC_*SLG1PCC
HRSFEC_PTP_CONFIG
Point-to-point connection with Employee CentralConexión point-to-point con Employee Central
HRSFEC_PTP_EE_REPL
Employee master data replicationReplicación de datos maestros de empleados
HRSFEC_PTP_ABSE_REPL
Time Off absence replicationReplicación de ausencias de Time Off
HRSFEC_PTP_ATTE_REPL
Time Sheet replicationReplicación de Time Sheet
HRSFEC_PTP_LMOD
Date of the last replication runFecha de la última ejecución de la replicación
HRSFEC_SPOT_EEMDR_CE
Enhancement spot of the employee replication, with its BAdIsPunto de ampliación de la replicación de empleados, con sus BAdIs
ODTF_REPL_CC
Cost center replication (program, run from SE38)Replicación de centros de coste (programa, desde SE38)
SLG1
Application log of the replicationLog de aplicación de la replicación
PA20 / PA30
Display and maintain infotypesVer y mantener infotipos
PM01
Create a custom infotypeCrear un infotipo a medida
PU03
Payroll status of an employeeEstado de nómina del empleado
PC_PAYRESULT
Payroll resultsResultados de nómina
SE18 / SE19
BAdI definition and implementationDefinición e implementación de BAdIs
SOAMANAGER / SRT_UTIL
Web service configuration and tracesConfiguración y trazas de servicios web
SICF · /IWFND/MAINT_SERVICE
UI5 and OData services behind Payroll Control CenterServicios UI5 y OData del Payroll Control Center
SM37
Replication and interface jobsJobs de replicación e interfaces
When an employee does not replicateCuando un empleado no replica
The usual causes, in the order I check them.
Las causas habituales, en el orden en que las reviso.
TroubleshootingIncidenciasSLG1DRM
Read the full message. In SLG1 or the Data Replication Monitor it usually names the field and the infotype.
Unmapped value. A new picklist value or code in Employee Central with no entry in the ECP value mapping.
Empty mandatory field. For example the employee group or subgroup in IT0001.
Out of scope. Country, company or other filters of the replication, or a hire date before the cut-off.
Order of objects. The position or organisational unit has not been replicated yet.
Employee locked. Someone has the employee open in PA30, or payroll is running. It is picked up on the next run.
Retroactivity. The change falls in a closed period or before the employee's earliest retroactive date.
Custom field. A new EC field that no BAdI implementation carries over to ECP.
Lee el mensaje completo. En SLG1 o en el Data Replication Monitor suele aparecer el campo y el infotipo afectados.
Valor sin mapear. Un valor de picklist o un código nuevo en Employee Central sin entrada en el mapeo de valores de ECP.
Dato obligatorio vacío. Por ejemplo, el grupo o el área de personal en el IT0001.
Fuera de alcance. Filtros de país, sociedad u otros de la replicación, o una fecha de alta anterior a la fecha de corte.
Orden de los objetos. La posición o la unidad organizativa todavía no se ha replicado.
Empleado bloqueado. Alguien lo tiene abierto en PA30 o la nómina está en curso. Se recoge en la siguiente ejecución.
Retroactividad. El cambio cae en un periodo cerrado o antes de la fecha de retroactividad más temprana del empleado.
Campo a medida. Un campo nuevo de EC que ninguna implementación de BAdI lleva a ECP.
Writing an infotype inside the replicationGrabar un infotipo dentro de la replicación
Insert a custom infotype record in the BIB's own unit of work, with errors in the replication log.
Insertar un registro de un infotipo a medida en la propia unidad de trabajo del BIB, con los errores en el log de replicación.
IF_HRPA_MASTERDATA_BLBAdI
Inside the common replication BAdI the employee is already locked and the BIB commits at the end. Writing through its infotype framework keeps everything in one unit of work: the custom infotype is saved or fails together with the standard ones. Use the IF_HRPA_MASTERDATA_BL instance and the message handler the replication passes in. An instance of your own, from the factory, would make the flush and the commit yours, and it would no longer be one unit of work.
METHOD process_it9001.
" io_hrpa_masterdata_bl and io_message_handler: the instances the
" replication passes to the BAdI, handed down unchanged
DATA lo_container TYPE REF TO if_hrpa_infty_container.
DATA lo_data TYPE REF TO if_hrpa_infty_container_data.
DATA lv_ok TYPE boole_d.
" lt_new: records built from the EC job information, oldest first
LOOP AT lt_new INTO DATA(ls_p9001).
DATA(ls_pskey) = VALUE pskey( pernr = ls_p9001-pernr
infty = '9001'
begda = ls_p9001-begda
endda = ls_p9001-endda ).
io_hrpa_masterdata_bl->get_infty_container(
EXPORTING tclas = 'A'
pskey = ls_pskey
no_auth_check = abap_true
message_handler = io_message_handler
IMPORTING container = lo_container ).
lo_data ?= lo_container.
lo_container ?= lo_data->modify_primary_record( ls_p9001 ).
io_hrpa_masterdata_bl->insert(
EXPORTING no_auth_check = abap_true
message_handler = io_message_handler
IMPORTING is_ok = lv_ok
CHANGING container = lo_container ).
IF lv_ok = abap_false.
" The error is already in the employee's replication log
EXIT.
ENDIF.
ENDLOOP.
" No COMMIT here: the BIB commits per employee
ENDMETHOD.
Good to know
With time constraint 1, each insert delimits the overlapping record, so inserting in date order is enough. Skip records that already exist with the same values to keep the replication idempotent.
Trade-off
An error in the custom infotype fails the whole employee in that run. That is consistent (all or nothing), but a strange value will block the employee until it is fixed. Parameter names can vary slightly between releases: insert the calls from SE24 with Pattern.
Dentro de la BAdI común de la replicación, el empleado ya está bloqueado y el BIB hace el commit al final. Grabar a través de su framework de infotipos lo mantiene todo en una unidad de trabajo: el infotipo a medida se graba o falla junto con los estándar. Usa la instancia de IF_HRPA_MASTERDATA_BL y el message handler que te pasa la replicación. Con una instancia propia, creada con la factoría, el flush y el commit pasarían a ser tuyos, y ya no sería una sola unidad de trabajo.
METHOD process_it9001.
" io_hrpa_masterdata_bl e io_message_handler: las instancias que la
" replicación pasa a la BAdI, recibidas tal cual
DATA lo_container TYPE REF TO if_hrpa_infty_container.
DATA lo_data TYPE REF TO if_hrpa_infty_container_data.
DATA lv_ok TYPE boole_d.
" lt_new: registros construidos desde el job information de EC, del más antiguo al más reciente
LOOP AT lt_new INTO DATA(ls_p9001).
DATA(ls_pskey) = VALUE pskey( pernr = ls_p9001-pernr
infty = '9001'
begda = ls_p9001-begda
endda = ls_p9001-endda ).
io_hrpa_masterdata_bl->get_infty_container(
EXPORTING tclas = 'A'
pskey = ls_pskey
no_auth_check = abap_true
message_handler = io_message_handler
IMPORTING container = lo_container ).
lo_data ?= lo_container.
lo_container ?= lo_data->modify_primary_record( ls_p9001 ).
io_hrpa_masterdata_bl->insert(
EXPORTING no_auth_check = abap_true
message_handler = io_message_handler
IMPORTING is_ok = lv_ok
CHANGING container = lo_container ).
IF lv_ok = abap_false.
" El error ya está en el log de replicación del empleado
EXIT.
ENDIF.
ENDLOOP.
" Sin COMMIT: el BIB confirma por empleado
ENDMETHOD.
Bueno saberlo
Con restricción temporal 1, cada inserción delimita el registro que solapa, así que basta con insertar en orden de fechas. Sáltate los registros que ya existen con los mismos valores para que la replicación sea idempotente.
Contrapartida
Un error en el infotipo a medida hace fallar al empleado entero en esa ejecución. Es coherente (todo o nada), pero un valor raro bloqueará al empleado hasta que se corrija. Los nombres de los parámetros pueden variar un poco entre releases: inserta las llamadas desde SE24 con Patrón.
Reading the latest payroll resultLeer el último resultado de nómina
Payroll directory, the current results of the latest period and the total of one wage type, in modern ABAP.
Directorio de nómina, resultados actuales del último periodo y suma de un concepto, en ABAP moderno.
CU_READ_RGDIRREDUCE
Reads the employee's payroll directory, keeps the current results of the latest regular period and adds up wage type /101 (total gross). Off-cycle runs are left out, and if the period has more than one current result, all of them are added.
DATA lt_rgdir TYPE STANDARD TABLE OF pc261 WITH EMPTY KEY.
DATA lv_molga TYPE molga.
DATA ls_result TYPE pay99_result.
CALL FUNCTION 'CU_READ_RGDIR'
EXPORTING
persnr = iv_pernr
IMPORTING
molga = lv_molga
TABLES
in_rgdir = lt_rgdir
EXCEPTIONS
no_record_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
RETURN.
ENDIF.
SELECT SINGLE relid FROM t500l
WHERE molga = @lv_molga
INTO @DATA(lv_relid).
" Current results of regular runs only: no old versions (srtza = 'A')
" and no off-cycle runs (payty initial)
DELETE lt_rgdir WHERE srtza <> 'A' OR payty IS NOT INITIAL.
IF lt_rgdir IS INITIAL.
RETURN.
ENDIF.
SORT lt_rgdir BY fpend DESCENDING.
DATA(lv_fpper) = lt_rgdir[ 1 ]-fpper.
" The latest period can have more than one current result, for example
" after a change of payroll area mid-month: read and add them all
DATA lv_gross TYPE maxbt.
LOOP AT lt_rgdir INTO DATA(ls_rgdir) WHERE fpper = lv_fpper.
CLEAR ls_result.
CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'
EXPORTING
clusterid = lv_relid
employeenumber = iv_pernr
sequencenumber = ls_rgdir-seqnr
CHANGING
payroll_result = ls_result
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
RETURN.
ENDIF.
lv_gross = lv_gross + REDUCE maxbt( INIT s = CONV maxbt( 0 )
FOR ls_rt IN ls_result-inter-rt
WHERE ( lgart = '/101' )
NEXT s = s + ls_rt-betrg ).
ENDLOOP.
Lee el directorio de resultados del empleado, se queda con los resultados actuales del último periodo regular y suma el concepto /101 (devengos totales). Las nóminas fuera de ciclo se quedan fuera y, si el periodo tiene más de un resultado actual, se suman todos.
DATA lt_rgdir TYPE STANDARD TABLE OF pc261 WITH EMPTY KEY.
DATA lv_molga TYPE molga.
DATA ls_result TYPE pay99_result.
CALL FUNCTION 'CU_READ_RGDIR'
EXPORTING
persnr = iv_pernr
IMPORTING
molga = lv_molga
TABLES
in_rgdir = lt_rgdir
EXCEPTIONS
no_record_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
RETURN.
ENDIF.
SELECT SINGLE relid FROM t500l
WHERE molga = @lv_molga
INTO @DATA(lv_relid).
" Solo resultados actuales de nóminas regulares: sin versiones antiguas
" (srtza = 'A') ni nóminas fuera de ciclo (payty inicial)
DELETE lt_rgdir WHERE srtza <> 'A' OR payty IS NOT INITIAL.
IF lt_rgdir IS INITIAL.
RETURN.
ENDIF.
SORT lt_rgdir BY fpend DESCENDING.
DATA(lv_fpper) = lt_rgdir[ 1 ]-fpper.
" El último periodo puede tener más de un resultado actual, por ejemplo
" tras un cambio de área de nómina a mitad de mes: se leen y se suman todos
DATA lv_bruto TYPE maxbt.
LOOP AT lt_rgdir INTO DATA(ls_rgdir) WHERE fpper = lv_fpper.
CLEAR ls_result.
CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'
EXPORTING
clusterid = lv_relid
employeenumber = iv_pernr
sequencenumber = ls_rgdir-seqnr
CHANGING
payroll_result = ls_result
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
RETURN.
ENDIF.
lv_bruto = lv_bruto + REDUCE maxbt( INIT s = CONV maxbt( 0 )
FOR ls_rt IN ls_result-inter-rt
WHERE ( lgart = '/101' )
NEXT s = s + ls_rt-betrg ).
ENDLOOP.
From a classic HCM report to ABAP CloudDe un report HCM clásico a ABAP Cloud
My study notes: what a classic HR report relies on, why ABAP Cloud does not allow it and what takes its place.
Mis notas de estudio: en qué se apoya un report de HR clásico, por qué ABAP Cloud no lo permite y qué ocupa su lugar.
PNP · WRITE→Released CDSCDS liberadas→RAP→Fiori elements
ABAP CloudClean coreRAP
ABAP Cloud only lets you use objects that SAP has released for it. A classic HR report uses almost nothing released, so it is not converted line by line: it is rebuilt.
SELECT on PA0001, PA0002… Reading SAP tables directly is not allowed. Instead: a released CDS view, if SAP offers one for that data. Until it does, in private cloud or on-premise, a wrapper class in classic ABAP that is released for cloud development.
Logical database PNP or PNPCE. GET PERNR and selection screens do not exist in ABAP Cloud. Instead: your own selection with ABAP SQL, with the validity dates in the WHERE clause, and the filters coming from the app.
RP_PROVIDE_FROM_LAST and the other HR macros. They come from HR includes and the TRMAC table, which cloud code cannot use. Instead: read the record valid on the key date with a condition on BEGDA and ENDDA.
WRITE, or an ALV with CL_SALV_TABLE. There is no SAP GUI output: no lists and no dynpros. Instead: a CDS view with UI annotations, exposed with RAP and shown in a Fiori elements app.
CALL TRANSACTION and batch input. They drive screens. Instead: a released API, such as a RAP business object called with EML.
What I take from it
Keep reading, logic and output apart from the start, even in classic ABAP. A report built that way moves to ABAP Cloud piece by piece; one written around GET PERNR and WRITE has to start over.
ABAP Cloud solo deja usar objetos que SAP ha liberado para ello. Un report de HR clásico no usa casi nada liberado, así que no se convierte línea a línea: se rehace.
SELECT sobre PA0001, PA0002… No se puede leer directamente de las tablas de SAP. En su lugar: una vista CDS liberada, si SAP ofrece una para esos datos. Mientras no la haya, en private cloud u on-premise, una clase envoltorio en ABAP clásico liberada para el desarrollo cloud.
Base de datos lógica PNP o PNPCE. GET PERNR y las pantallas de selección no existen en ABAP Cloud. En su lugar: una selección propia con ABAP SQL, con las fechas de validez en el WHERE y los filtros llegando desde la aplicación.
RP_PROVIDE_FROM_LAST y el resto de macros de HR. Salen de includes de HR y de la tabla TRMAC, que el código cloud no puede usar. En su lugar: leer el registro vigente a la fecha clave con una condición sobre BEGDA y ENDDA.
WRITE, o un ALV con CL_SALV_TABLE. No hay salida en SAP GUI: ni listas ni dynpros. En su lugar: una vista CDS con anotaciones de UI, expuesta con RAP y mostrada en una aplicación Fiori elements.
CALL TRANSACTION y batch input. Manejan pantallas. En su lugar: una API liberada, como un business object de RAP llamado con EML.
Lo que me llevo
Separar lectura, lógica y salida desde el principio, incluso en ABAP clásico. Un report hecho así pasa a ABAP Cloud pieza a pieza; uno escrito alrededor de GET PERNR y WRITE tiene que empezar de cero.
A 403 between SuccessFactors and ECPUn 403 entre SuccessFactors y ECP
A 403 means you are recognised but not allowed. First find out who returns it.
Un 403 significa que te reconocen pero no te dejan. Lo primero es saber quién lo devuelve.
RBPSICFOAuth
Payroll Control Center tabs. They are UI5 apps that live in ECP. Check that their SICF services are active (My Teams is hrpy_pcc_mc_1) and their OData services in /IWFND/MAINT_SERVICE. If a tab then loads blank, recalculate the UI5 app index.
Replication confirmation. A COE_GENERAL_FORBIDDEN error when the replication writes its status back to EC usually means the API user is missing role-based permissions: Data Replication Monitor, the Foundation OData API, inactive employees and some Job Information fields. Check its target population too.
Authentication method. Since 20 November 2026, SuccessFactors APIs no longer accept HTTP Basic Authentication. If HRSFEC_PTP_CONFIG or an SM59 destination still uses user and password, it no longer connects: move it to OAuth with certificates.
Audit trail. The PCC audit trail is stored in ECP, not in SuccessFactors. Link it from the SuccessFactors home page; for a full download there is the report PYC_SUPPORT_DL_AUDIT_TRAIL.
Pestañas del Payroll Control Center. Son aplicaciones UI5 que viven en ECP. Comprueba que sus servicios SICF están activos («Mis equipos» es hrpy_pcc_mc_1) y sus servicios OData en /IWFND/MAINT_SERVICE. Si después una pestaña sale en blanco, recalcula el índice de aplicaciones UI5.
Confirmación de la replicación. Un error COE_GENERAL_FORBIDDEN cuando la replicación devuelve su estado a EC suele indicar que al usuario API le faltan permisos RBP: Data Replication Monitor, la Foundation OData API, empleados inactivos y algunos campos de Job Information. Revisa también su población objetivo.
Método de autenticación. Desde el 20 de noviembre de 2026, las APIs de SuccessFactors ya no aceptan la autenticación HTTP Basic. Si HRSFEC_PTP_CONFIG o un destino de SM59 siguen con usuario y contraseña, ya no conectan: pásalos a OAuth con certificados.
Audit trail. El audit trail del PCC se guarda en ECP, no en SuccessFactors. Enlázalo desde la página de inicio de SuccessFactors; para descargarlo completo está el report PYC_SUPPORT_DL_AUDIT_TRAIL.
Migrating to ECP in six stepsMigrar a ECP en seis pasos
How I would plan moving a client from SAP HCM on-premise to Employee Central Payroll.
Cómo plantearía llevar a un cliente de SAP HCM on-premise a Employee Central Payroll.
Fit-gapCustom codeCódigo a medidaParallel runsNóminas en paralelo
Employee Central Payroll is the same SAP payroll engine, running in SAP's cloud and fed by Employee Central. The calculation logic you trust stays; how it is delivered and connected changes.
Fit-gap. What fits in ECP as it is and what needs a closer look: very complex time evaluation, heavily customised self-services, and country or public-sector specifics that depend on the localisation. This is where you decide between ECP and keeping HCM in a private cloud.
Custom code inventory. Developments, enhancements and modifications, crossed with real usage statistics so dead code is not migrated. Modifications are redesigned as enhancements.
Data model and replication. Employee Central becomes the master: map EC fields to infotypes (custom ones too), picklist values and personnel numbers.
Customizing and code, in order. Schemas, rules, wage types and developments, respecting their dependencies.
History and integrations. Decide which payroll history to bring for retro and annual reporting, and redesign the interfaces: in ECP, outputs to third parties usually go through web services or SAP Integration Suite.
Parallel payroll runs. Run the same payroll in both systems and compare employee by employee and wage type by wage type until it matches. Then user tests, freeze, go-live and hypercare.
And from day one
Prepare the users: in ECP, master data comes from Employee Central, and that change should not take them by surprise.
Employee Central Payroll es el mismo motor de nómina de SAP, en la nube de SAP y alimentado por Employee Central. La lógica de cálculo de siempre se mantiene; cambia cómo se entrega y cómo se conecta.
Fit-gap. Qué encaja en ECP tal cual y qué hay que mirar con lupa: evaluación de tiempos muy compleja, autoservicios muy personalizados y particularidades de país o de sector público que dependen de la localización. Aquí se decide entre ECP o mantener HCM en una nube privada.
Inventario de código a medida. Desarrollos, ampliaciones y modificaciones del estándar, cruzados con estadísticas de uso reales para no migrar código muerto. Las modificaciones se rediseñan como ampliaciones.
Modelo de datos y replicación. Employee Central pasa a ser el maestro: mapear campos de EC a infotipos (también los a medida), valores de picklist y números de personal.
Customizing y código, en orden. Esquemas, reglas, conceptos y desarrollos, respetando sus dependencias.
Histórico e integraciones. Decidir qué histórico de nómina se trae para la retroactividad y los informes anuales, y rediseñar las interfaces: en ECP, las salidas a terceros suelen ir por servicios web o por SAP Integration Suite.
Nóminas en paralelo. Calcular la misma nómina en los dos sistemas y comparar empleado a empleado y concepto a concepto hasta que cuadre. Después, pruebas de usuario, congelación, arranque e hypercare.
Y desde el primer día
Prepara a los usuarios: en ECP los datos maestros vienen de Employee Central, y ese cambio no debería pillarles por sorpresa.
Lessons from the fieldLecciones aprendidas
Ten things I learned the hard way, each one from a real incident.
Diez cosas que aprendí por las malas, cada una de una incidencia real.
Partition ≠ recalculationA split period is not a retro recalculation: add up every split of the period, do not subtract.
One-way OK ≠ deliveredWith a one-way service, SAP's OK only means the message reached CPI. Check the CPI message monitor and SRT_UTIL.
Dialog ≠ massStatic state in a calculator class is invisible in PA30 and wrong from the second employee in a report.
Transport the whole classA method without its declaration breaks the class in the target system. In a replication BAdI, that stops every employee.
No COMMIT inside the replicationThe BIB has its own unit of work. Write through its infotype framework and let it commit.
Import order is everythingIn a migration, fix the root object and hundreds of chained errors disappear with it.
Write where the value arrivesIn a DMEE exit, some nodes carry the value in C_VALUE and others in O_VALUE.
Period date, not pay dateRead master data for the payroll period. A hire on the 30th paid on the 29th came out without organisational data, and retro rows picked up the latest record.
Agree on empty valuesAn empty optional field made a whole block of records disappear in the receiver. Empty values are part of the interface contract, whatever the WSDL says.
Check everything, then postValidate every document before posting any: either the whole expense report goes in, or nothing does.
Partición ≠ recálculoUn periodo partido no es un recálculo retroactivo: suma todos los tramos del periodo, no restes.
OK one-way ≠ entregadoCon un servicio one-way, el OK de SAP solo significa que el mensaje llegó a CPI. Revisa el monitor de mensajes de CPI y SRT_UTIL.
Diálogo ≠ masivoEl estado estático en una clase de cálculo es invisible en PA30 e incorrecto a partir del segundo empleado en un informe.
Transporta la clase enteraUn método sin su declaración rompe la clase en el sistema destino. En una BAdI de replicación, eso para a todos los empleados.
Nada de COMMIT dentro de la replicaciónEl BIB tiene su propia unidad de trabajo. Graba a través de su framework de infotipos y deja que confirme él.
El orden de importación lo es todoEn una migración, corrige el objeto raíz y cientos de errores en cadena desaparecen con él.
Escribe donde llega el valorEn una salida de DMEE, unos nodos traen el valor en C_VALUE y otros en O_VALUE.
Fecha del periodo, no de pagoLee los datos maestros del periodo de nómina. Un alta del día 30 pagada el 29 salía sin datos organizativos, y las filas retroactivas cogían el último registro.
Pacta los valores vacíosUn campo opcional vacío hizo desaparecer un bloque entero de registros en el receptor. Los vacíos son parte del contrato de la interfaz, diga lo que diga el WSDL.
Primero comprobar, luego contabilizarValida todos los documentos antes de contabilizar ninguno: o entra el informe de gastos entero, o no entra nada.
ToolsHerramientas
Everyday utilitiesUtilidades para el día a día
They run in your browser: nothing you paste leaves this page.
Funcionan en tu navegador: nada de lo que pegues sale de esta página.
Classic → modern ABAP converterConversor ABAP clásico → moderno
Paste old code and get 7.40+ syntax (inline declarations, table expressions, strict Open SQL, NEW, VALUE, COND…) with an explanation of every change and a warning whenever the semantics could change.
Pega código antiguo y obtén sintaxis 7.40+ (declaraciones inline, expresiones de tabla, Open SQL estricto, NEW, VALUE, COND…) con la explicación de cada cambio y un aviso cuando la semántica podría variar.
7.407.507.54+30+ rules30+ reglas
BeforeAntes
SELECT SINGLE ename FROM pa0001 INTO lv_ename
WHERE pernr = lv_pernr.
AfterDespués
SELECT SINGLE ename FROM pa0001
WHERE pernr = @lv_pernr INTO @lv_ename.
Examples:Ejemplos:
Classic ABAPABAP clásicoPaste your codePega tu código
Modern ABAPABAP moderno
Applied changesCambios aplicados
Rule-based conversion meant to save mechanical work. Review the result and activate it in a test system first. Macros, dynamic code and tables with header lines are left as they are.
Conversión por reglas, pensada para ahorrar trabajo mecánico. Revisa el resultado y actívalo antes en un sistema de pruebas. Macros, código dinámico y tablas con cabecera se dejan como están.
Convert OData v2 /Date(…)/ values, ISO 8601, DATS dates and ABAP timestamps into each other. Handy when reading Compound Employee API or iFlow payloads.
Convierte valores /Date(…)/ de OData v2, ISO 8601, fechas DATS y timestamps ABAP entre sí. Útil al revisar payloads de la Compound Employee API o de un iFlow.
OData v2DATSTIMESTAMP
OData v2
/Date(1704067200000)/
ABAP
20240101" DATS20240101000000" TIMESTAMP (UTC)
The Employee Central OData v2 APIs send dates as /Date(…)/: milliseconds since 1 January 1970, in UTC. In ECP, BEGDA and ENDDA are DATS dates without a time zone, and 9999-12-31 is 99991231.
Las APIs OData v2 de Employee Central envían las fechas como /Date(…)/: milisegundos desde el 1 de enero de 1970, en UTC. En ECP, BEGDA y ENDDA son fechas DATS sin zona horaria, y 9999-12-31 equivale a 99991231.
danroca.comSAP ABAP · Payroll on ECPSAP ABAP · Nómina en ECP
Hi, I'm Dan 👋Hola, soy Dan 👋
I write SAP code for the least visible and most delicate part of any company: payroll.Programo en SAP la parte menos visible y más delicada de una empresa: la nómina.
When HR changes your salary…Cuando RR. HH. cambia tu sueldo…
…my code makes sure it reaches your payslip and the bank, correctly.…mi código hace que llegue bien a tu nómina y al banco.
HRRR. HH.Employee Central
My ABAP codeMi código ABAPReplication, infotypes, reportsReplicación, infotipos, informes
Payroll and bankNómina y bancoECP · SEPA · third partiesECP · SEPA · terceros
12real projectsproyectos reales
Each one tells the context, what I did and the code that makes it work. No client names.Cada uno cuenta el contexto, lo que hice y el código que lo hace funcionar. Sin nombres de clientes.
Where to next?¿Por dónde sigues?
The portfolio is all yours.El portfolio es todo tuyo.