BAPI_ALM_NOTIF_CREATE / BAPI_ALM_NOTIF_DATA_MODIFY– Actualizar campo Duración de Parada (Breakdown duration)

Si necesitamos crear un aviso con la BAPI BAPI_ALM_NOTIF_CREATE o modificarlo vía BAPI_ALM_NOTIF_DATA_MODIFY.

Y debemos actualizar el campo “duración de parada” (Breakdown Duration) deberemos seguir las intrucciones de la nota 

1619709 – Notification breakdown duration not populated by BAPI call

Es una nota informativa, explicando que la funcionalidad no está en dichas BAPIs, por lo cual deberemos implementar la BADI NOTIF_EVENT_SAVE.

method IF_EX_NOTIF_EVENT_SAVE~CHANGE_DATA_AT_SAVE.
IF CS_VIQMEL-AUSZT is initial.
*   Only execute if breakdown time is not already set
     IF ( CS_VIQMEL-MSAUS = 'X' ) AND ( CS_VIQMEL-AUSVN <> 0 ) AND ( CS_VIQMEL-AUSBS >= CS_VIQMEL-AUSVN ).
*       Only if breakdown indicator is set, valid start date, end date not less than start date
        CS_VIQMEL-AUSZT = ( CS_VIQMEL-AUSBS - CS_VIQMEL-AUSVN ) * 24 * 60 * 60.
        CS_VIQMEL-AUSZT = CS_VIQMEL-AUSZT
                  + ( CS_VIQMEL-AUZTB - CS_VIQMEL-AUZTV ).
    ENDIF.
ENDIF.

endmethod.

image

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: