Case: Abap application modifies on low level appraisal documents so BADI HRHAP00_ACTION_LOG not in USE. We need to implement standard logging.

Here is an simple example solution.

REPORT  ZYS_LOG_TEST.

DATA: PLAN_VERSION TYPE  HAP_PLAN_VERSION value ’01’,
S_APPRAISAL_ID
TYPE  HAP_S_APPRAISAL_ID value ’53C40DD5C7C9045FE1008001AC100BB80000′, “Appraisap GUID
ls_status       
TYPE hap_s_status_sub,
S_RETURN
TYPE  BAL_S_MSG,
COMMIT TYPE  BOOLE_D value ‘X’.

DATA: lt_messages      TYPE hap_t_msg,
        ls_message      
TYPE bal_s_msg.
ls_message
msgty = ‘S’.
ls_message
msgid = ‘HRHAP00_ACTION_LOG’.
ls_message
msgno = ‘100’.
ls_message
msgv1 = ‘Write something to LOG’.
APPEND ls_message to lt_messages.

  CALL FUNCTION ‘HRHAP_DOC_ACTION_LOG_ADD_MSGS’
   
EXPORTING
      plan_version  
= plan_version
      s_appraisal_id
= s_appraisal_id
      s_status      
= ls_status
      administrator 
= “s_doc_processing-administrator
        t_messages    
= lt_messages
     
IMPORTING
        s_return      
= s_return.

*   write notes to actionlog (without real commit)
   
IF NOT commit IS INITIAL AND s_returnmsgty IS INITIAL.
*     write to BAL
   
CALL FUNCTION ‘HRHAP_DOC_ACTION_LOG_COMMIT’
     
EXPORTING
        plan_version  
= plan_version
        s_appraisal_id
= s_appraisal_id.

    ENDIF.


/wp-content/uploads/2014/09/log_531354.png

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply