SAP HCM MEDIDAS DINAMICAS

From SapWiki
Revision as of 13:26, 28 March 2020 by WikiSysop (talk | contribs)

Medidas DInámicas

Las medidas dinámicas se crean en la tabla T588Z

Ejemplo 1: en este caso al actualizar ciertos campos del IT0021 se deben crear IT0015. Los nuevos campos se agregaron como tabla con máximo de 12 líneas, cada línea se procesa en este bloque

T001P-MOLGA='39'
BECA_ESCOLAR(ZHCM_MEDIDAS_DINAMICAS)
RP50D-FLAG1='X'
P0021-ZZFCH_PAGO01<>'00000000'
INS,0015,1159,,(P0021-ZZFCH_PAGO01),(P0021-ZZFCH_PAGO01)
P0015-BETRG=P0021-ZZBET01
P0015-WAERS=P0021-ZZWAERS
P0015-ANZHL=P0021-ZZFASAR01
P0015-ZEINH='025'
P0015-ZUORD=P3226-RUTID
====Tabla T588Z====
Infotipo Subtipo Nombre campo Caracter funcional Nro secuencia Accion Parte variable de la funcion
0021 06 400 * MI MEDIDA DINAMICA *
0021 06 401 P T001P-MOLGA='39'
0021 06 402 F PROCESAR(ZHCM_MEDIDAS_DINAMICAS)
0021 06 403 P RP50D-FLAG1='X'
0021 06 404 P P0021-ZZFCH_PAGO01<>'00000000'
0021 06 405 I INS,0015,1159,,(P0021-ZZFCH_PAGO01),(P0021-ZZFCH_PAGO01)
0021 06 406 W P0015-BETRG=P0021-ZZBET01
0021 06 407 W P0015-WAERS=P0021-ZZWAERS
0021 06 408 W P0015-ANZHL=P0021-ZZFASAR01
0021 06 409 W P0015-ZEINH='025'
0021 06 410 W P0015-ZUORD=P3226-RUTID
0021 06 420 P T001P-MOLGA='39'
0021 06 421 F PROCESAR(ZHCM_MEDIDAS_DINAMICAS)
0021 06 422 P RP50D-FLAG1='X'
0021 06 423 P P0021-ZZFCH_PAGO02<>'00000000'
0021 06 424 I INS,0015,1159,,(P0021-ZZFCH_PAGO02),(P0021-ZZFCH_PAGO02)
0021 06 425 W P0015-BETRG=P0021-ZZBET02
0021 06 426 W P0015-WAERS=P0021-ZZWAERS
0021 06 427 W P0015-ANZHL=P0021-ZZFASAR02
0021 06 428 W P0015-ZEINH='025'
0021 06 429 W P0015-ZUORD=P3226-RUTID

Programa ZHCM_MEDIDAS_DINAMICAS

REPORT ZHCM_MEDIDAS_DINAMICAS.
TABLES: p0021,
        p3226,
        RP50D.

DATA g_tabix LIKE sy-tabix.
DATA gt_p0015 TYPE TABLE OF p0015.


FORM PROCESAR.

  DATA: ls_p0021 TYPE p0021,
        ls_p3226 TYPE p3226,
        ls_p0015 TYPE p0015.

  ls_p0021 = p0021.
  ls_p3226 = p3226.

  ADD 1 TO  g_tabix.

  RP50D-FLAG1 = space.
  CHECK ls_p3226-RUTID IS NOT INITIAL . "Si carga no tiene RUT no se crea IT0015

  DATA: ZZFCH_PAGO TYPE zq0021-ZZFCH_PAGO,
        ZZBET TYPE zq0021-ZZBET,
        zzfasar TYPE zq0021-zzfasar,
        ZZFLAG0015 TYPE zq0021-ZZFLAG0015.

  DATA: l_subrc TYPE sy-subrc,
        l_message TYPE bapiret2-MESSAGE.

  DO 12 TIMES VARYING ZZFCH_PAGO FROM ls_p0021-ZZFCH_PAGO01 NEXT ls_p0021-ZZFCH_PAGO02
              VARYING ZZBET      FROM ls_p0021-ZZBET01      NEXT ls_p0021-ZZBET02
              VARYING zzfasar    FROM ls_p0021-zzfasar01    NEXT ls_p0021-zzfasar02
              VARYING ZZFLAG0015 FROM ls_p0021-ZZFLAG001501 NEXT ls_p0021-ZZFLAG001502.

    IF sy-INDEX = g_tabix.
      CHECK ZZFCH_PAGO IS NOT INITIAL AND ZZFLAG0015 <> 'X'.
      RP50D-FLAG1 = 'X'.   "ver tabla de medidas dinámicas T588Z con IT0021
    ENDIF.

  ENDDO.
ENDFORM.

form PROCESAR_INIT.
  g_tabix = 0.
ENDFORM.