Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member183497
Active Participant
(Scroll down for the English version)

 

Hola todos,

Al utilizar la BAdI para ajuste de valores relacionados con entradas de infotipo (HRPADES_FIE_BATCH_INPUT), usted puede cambiar las instrucciones de batch input que el programa Mensaje FIE (RPU_PADES_FIE) genera cuando hace la comparación de los ficheros FIE con los datos maestros de los empleados. Por lo tanto, en este blog post usted encuentra ejemplos de utilización para cada uno de los métodos disponibles.

 

Métodos para implementación obligatoria:

 

CHANGE_SUBTY

Este método le permite definir el tipo de absentismo, una vez que recibe como parámetro el seguimiento referente a la información utilizada en la generación de absentismo.

Nota:

Usted puede verificar los tipos de seguimiento en el manual MENSAJE DE I.N.S.S. EMPRESA (FIE).

Ejemplo de código:

method IF_HRPADES_FIE_BATCH_INPUT~CHANGE_SUBTY.

IF is_segment_data-dit_contingency_type = '1'.

cv_subty = '1000'. " Incapacidad Temporal

ELSEIF is_segment_data-dit_contingency_type = '3'.

cv_subty = '2000'. " Accidente de trabajo

ENDIF.

endmethod.

 

SET_DELEGATED_ABSENCE_SUBTY

Este método le permite cambiar el subtipo de un absentismo en lo cual se reporta un cambio para pago directo, o sea, su compañía empieza a pagar un valor diferente de contribución, mientras el empleado sigue incapacitado.

Ejemplo de código:

method IF_HRPADES_FIE_BATCH_INPUT~SET_DELEGATED_ABSENCE_SUBTY.

"Determina cual el subtipo para el absentismo de pago directo baseado en el subtipo del absentismo original

IF is_original_absence-subty = '1000'.

cv_subty = '9991'.

ELSEIF is_original_absence-subty = '2000'.

cv_subty = '9992'.

ELSE.

cv_subty = '9990'.

ENDIF.

endmethod.

 

Métodos para implementación opcional:

 

UPDATE_ABSENCE

Este método recibe la información del absentismo que usted creará y le permite modificarlo de acuerdo con su necesidad, como las fechas del campo Inicio certificado de enfermedad de los absentismos, o algún otro campo nuevo en el infotipo Absentismos (IT2001).

Ejemplo de código:

method IF_HRPADES_FIE_BATCH_INPUT~UPDATE_ABSENCE.

"si no hay una fecha de fin (ENDDA = 31.12.9999), rellénela con la fecha de fin estimada.

IF is_segment_data-dit_estimated_duration IS NOT INITIAL AND

cs_absence-endda = '99991231'.

cs_absence-endda = cs_absence-begda + is_segment_data-dit_estimated_duration.

ENDIF.

endmethod.

 

UPDATE_BI_SCRIPT

Este método recibe el script de batch input y le permite cambiar las instrucciones generadas, de acuerdo con su necesidad. A partir de este método, es posible integrar la funcionalidad con otros programas o soluciones.

Ejemplo de código:

method IF_HRPADES_FIE_BATCH_INPUT~UPDATE_BI_SCRIPT.

FIELD-SYMBOLS <lt_script> TYPE hrcm_bi_tab.

FIELD-SYMBOLS <ls_script_data> TYPE bdcdata.

DATA lt_new_script  TYPE if_hrpades_fie_batch_input=>ty_t_fie_bi_script.

DATA lv_is_delete   TYPE abap_bool.

DATA lv_is_open_end TYPE abap_bool.

 

MOVE-CORRESPONDING ct_script TO lt_new_script.

 

"Evita que las entradas sin fecha de fin (endda = 31.12.9999) sean borrados por el script de batch input

LOOP AT lt_new_script ASSIGNING <lt_script>.

CLEAR lv_is_delete.

CLEAR lv_is_open_end.

 

LOOP AT <lt_script> ASSIGNING <ls_script_data>.

IF <ls_script_data>-fnam = 'BDC_OKCODE' AND

<ls_script_data>-fval = '=DEL'.

 

lv_is_delete = abap_true.

ENDIF.

 

IF <ls_script_data>-fnam = 'RP50G-ENDDA' AND

<ls_script_data>-fval = '31129999'.

 

lv_is_open_end = abap_true.

ENDIF.

ENDLOOP.

 

IF lv_is_open_end = abap_true AND

lv_is_delete   = abap_true.

 

DELETE lt_new_script INDEX sy-tabix.

ENDIF.

ENDLOOP.

 

ct_script = lt_new_script.

 

endmethod.

 

UPDATE_COLISION_ABSTY

Este método le permite definir cuáles son los tipos de absentismo que no se pueden colisionar con los subtipos creados internamente, a través del tipo relacionado (ABSTY) a cada absentismo.

Ejemplo de código:

method if_hrpades_fie_batch_input~update_colision_absty.

"Definindo que el absty debe ser considerado para colisiones

APPEND 'ZZ' TO ct_absty.

endmethod.

 

UPDATE_COLISION_ABSTP

Este método le permite definir cuáles son los tipos de absentismo que no se pueden colisionar con los subtipos creados internamente, a través del tipo relacionado (ABSTP) a cada absentismo.

Ejemplo de código:

method if_hrpades_fie_batch_input~update_colision_abstp.

"Definindo que el abstp debe ser considerado para colisiones

APPEND 'Z' TO ct_abstp.

endmethod.

 

APPEND_ABSENCE_TABLE

Este método le permite cambiar las entradas de absentismos, a partir del recibimiento de la tabla de ausencias. La ejecución del método apenas puede ser realizada después de todos los anteriores relacionados con el seguimiento procesado.

Ejemplo de utilización:

  1. Cambiar el segmento LCL_FIE_SEGMENT_PARSER.

  2. Añadir una llamada del nuevo método de BAdI.

  3. Añadir las entradas de absentismos a la tabla de procesamiento de FIE.


Nota:

Al añadirlas a la tabla, las llamadas de los métodos APPEND_NEW_ABSENCE son removidas.

Resultado:

Al concluir el procesamiento actual, incluyendo las implementaciones de BAdIs anteriores, el sistema crea un segmento y una tabla de absentismos correspondientes. El sistema tiene en cuenta el segmento cómo parámetro de importación, mientras envía la tabla de absentismos cómo modificación del nuevo método.

Ejemplo de procesamiento antiguo:

  • Segmento actual: el método indica la creación de un nuevo absentismo.

  • Absentismo: Nuevo absentismo procesando sus informaciones en cada método de la BAdI.


Ejemplo nuevo procesamiento:

  • Segmento actual: el método indica una creación de nuevo absentismo.

  • Tabla de absentismos: Nuevo absentismo procesando sus informaciones en cada método de la BAdI.


Ejemplo de nuevo procesamiento con pago delegado:

  • Segmento actual: el método indica una creación de nuevo absentismo.

  • Tabla de absentismos: Nuevo absentismo procesando sus informaciones en cada método de la BAdI. Además, el absentismo de pago delegado es creado de acuerdo con la entrada SUBTY del método SET_DELEGATED_ABSENCE_SUBTY.


Al fin del procesamiento actual, llamamos el nuevo método, donde cada segmento del FIE tendrá esa tabla de absentismos procesados. A través del segmento, es posible identificar la causa de fin en el infotipo Instruc. Empresa (0035), y el número de días estimados del proceso 365. Por lo tanto, ahora se puede comparar los absentismos enviados y cambiar su fecha fin al crear un nuevo absentismos, añadiéndolo a la tabla.

 

Usted puede llamar la BAdI a través de la actividad de customización Cálculo de la nómina > Cálculo de nómina: España > Evaluaciones para la Seguridad Social > Mensaje FIE > Business Add-In (BAdI) > BAdI para ajuste de valores relacionados con entradas de infotipo.

 

Vea también

 

 

¿Te gusta este blog post? Da un Like y comparte el contenido con tus compañeros.

También podéis dejar un feedback, comentario o pregunta abajo. Y no olviden de seguir el tag HCM Payroll Spain en SAP Community para saber las últimas noticias de Nómina España.

Un abrazo,

Janaína Ferreira

 

----

 

Hi everyone,

Using the BAdI for the adjustment of values related to infotype entries (HRPADES_FIE_BATCH_INPUT), you can change the batch input instructions that the FIE message (RPU_PADES_FIE) report generates when you compare FIE files with employee master data. Therefore, in this blog post you find examples for each method available.

 

Methods for Mandatory Implementation:

 

CHANGE_SUBTY

This method allows you to define the type of absence once you receive as a parameter the tracking regarding the information used in the absence generation.

Note:

You can check the tracking types in the manual MENSAJE DE I.N.S.S. EMPRESA (FIE).

Code example:

method IF_HRPADES_FIE_BATCH_INPUT~CHANGE_SUBTY.

IF is_segment_data-dit_contingency_type = '1'.

cv_subty = '1000'. " Incapacidad Temporal

ELSEIF is_segment_data-dit_contingency_type = '3'.

cv_subty = '2000'. " Accidente de trabajo

ENDIF.

endmethod.

 

 

SET_DELEGATED_ABSENCE_SUBTY

This method allows you to change the subtype of an absence in which a change is reported for direct pay, that is, your company starts paying a different contribution value, while the employee is still incapacitated.

Code example:

method IF_HRPADES_FIE_BATCH_INPUT~SET_DELEGATED_ABSENCE_SUBTY.

"Determina cual el subtipo para el absentismo de pago directo baseado en el subtipo del absentismo original

IF is_original_absence-subty = '1000'.

cv_subty = '9991'.

ELSEIF is_original_absence-subty = '2000'.

cv_subty = '9992'.

ELSE.

cv_subty = '9990'.

ENDIF.

endmethod.

 

Methods for optional implementation:

 

UPDATE_ABSENCE

This method receives the absence information that you will create and allows you to change it according to your needs, such as the dates in the Start of Illness Certificate field of the absences, or some other new field in the Absences (IT2001) infotype.

Code example:

method IF_HRPADES_FIE_BATCH_INPUT~UPDATE_ABSENCE.

"si no hay una fecha de fin (ENDDA = 31.12.9999), rellénela con la fecha de fin estimada.

IF is_segment_data-dit_estimated_duration IS NOT INITIAL AND

cs_absence-endda = '99991231'.

cs_absence-endda = cs_absence-begda + is_segment_data-dit_estimated_duration.

ENDIF.

endmethod.

 

 

UPDATE_BI_SCRIPT

This method receives the batch input script and allows you to change the generated instructions, according to your need. From this method, it is possible to integrate the functionality with other programs or solutions.

Code example:

method IF_HRPADES_FIE_BATCH_INPUT~UPDATE_BI_SCRIPT.

FIELD-SYMBOLS <lt_script> TYPE hrcm_bi_tab.

FIELD-SYMBOLS <ls_script_data> TYPE bdcdata.

DATA lt_new_script  TYPE if_hrpades_fie_batch_input=>ty_t_fie_bi_script.

DATA lv_is_delete   TYPE abap_bool.

DATA lv_is_open_end TYPE abap_bool.

 

MOVE-CORRESPONDING ct_script TO lt_new_script.

 

"Evita que las entradas sin fecha de fin (endda = 31.12.9999) sean borrados por el script de batch input

LOOP AT lt_new_script ASSIGNING <lt_script>.

CLEAR lv_is_delete.

CLEAR lv_is_open_end.

 

LOOP AT <lt_script> ASSIGNING <ls_script_data>.

IF <ls_script_data>-fnam = 'BDC_OKCODE' AND

<ls_script_data>-fval = '=DEL'.

 

lv_is_delete = abap_true.

ENDIF.

 

IF <ls_script_data>-fnam = 'RP50G-ENDDA' AND

<ls_script_data>-fval = '31129999'.

 

lv_is_open_end = abap_true.

ENDIF.

ENDLOOP.

 

IF lv_is_open_end = abap_true AND

lv_is_delete   = abap_true.

 

DELETE lt_new_script INDEX sy-tabix.

ENDIF.

ENDLOOP.

 

ct_script = lt_new_script.

 

endmethod.

 

UPDATE_COLISION_ABSTY

This method allows you to define which absence types cannot be collided with internally created subtypes, via the related type (ABSTY) to each absence.

Code example:

method if_hrpades_fie_batch_input~update_colision_absty.

"Definindo que el absty debe ser considerado para colisiones

APPEND 'ZZ' TO ct_absty.

endmethod.

 

UPDATE_COLISION_ABSTP

This method allows you to define which absence types cannot be collided with internally created subtypes, via the related type (ABSTP) to each absence.

Code example:

method if_hrpades_fie_batch_input~update_colision_abstp.

"Definindo que el abstp debe ser considerado para colisiones

APPEND 'Z' TO ct_abstp.

endmethod.

 

APPEND_ABSENCE_TABLE

This method allows you to change absence entries, based on the receipt of the absence table. The execution of the method can hardly be performed after all of the above related to the processed follow-up.

Usage example:

  1. Change the LCL_FIE_SEGMENT_PARSER segment.

  2. Add a call of the new BAdI method.

  3. Add the absence entries to the FIE processing table.


Note:

When they are added to the table, the APPEND_NEW_ABSENCE method calls are removed.

Result:

At the end of the current processing, including the previous BAdI implementations, the system creates a corresponding segment and absence table. The system considers the segment as an import parameter, while sending the absence table how to change the new method.

Example of old processing:

  • Current Segment: The method indicates the creation of a new absence.

  • Absence: New absence by processing your information in each method of the BAdI.


Reprocessing example:

  • Current Segment: The method indicates a new absence creation.

  • Absence table: New absence by processing its information in each method of the BAdI.


Example of reprocessing with delegated payment:

  • Current Segment: The method indicates a new absence creation.

  • Absence table: New absence by processing its information in each method of the BAdI. In addition, the delegated payment absence is created according to the entry SUBTY of method SET_DELEGATED_ABSENCE_SUBTY.


At the end of the current processing, we call the new method, where each segment of the FIE will have that table of absences processed. Through the segment, it is possible to identify the cause of the end in the infotype Company Instructions (0035), and the estimated number of days of process 365. Therefore, you can now compare the submitted absences and change their end date when creating a new absence by adding it to the table.

 

 

You can call the BAdI through the Customizing activity Payroll > Payroll: Spain > Valuations for Social Insurance > FIE Message > Business Add-In (BAdI) > BAdI for the adjustment of values related to infotype entries.

 

See also

 

Did you enjoy this post? Choose “Like” and share the content with your colleagues.

Feel free to leave your feedback, comment or question in the space provided below. And don’t forget to follow the tag HCM Payroll Spain in SAP Community to stay tuned on latest news of Payroll Spain.

All the best,

Janaína Ferreira