[ABAP] Log using CL_BAL_LOGOBJ

  DATA(lr_log) = NEW cl_bal_logobj( i_log_object        = 'ZMM'
                                   i_default_subobject = 'ZMM_LOGGING' ).

 lr_log->add_statustext( i_statustext = |Write a comment.| ).

 lr_log->add_exception( i_exception = lo_excp )

 lr_log->add_errortext( lo_excp->get_longtext( ) ).

 lr_log->add_msg( i_probclass = 'E' ).   "uses sy-msgty sy-msgid sy-msgno sy-msgv1 ...

 lr_log->save( i_client         = sy-mandt
               i_in_update_task = abap_true ).
 COMMIT WORK.

 lr_log->display( ).

Leave a Reply

Your email address will not be published. Required fields are marked *