*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(FI_OBJECT) TYPE BALOBJ_D DEFAULT '/BA1/B0'
*" REFERENCE(FI_SUBOBJECT) TYPE BALSUBOBJ DEFAULT 'DEFAULT'
*" TABLES
*" FT_MESSAGES TYPE BAPIRET2_T
*"----------------------------------------------------------------------
FIELD-SYMBOLS:
DATA:
lv_message(300) TYPE c,
ls_log TYPE bal_s_log,
lv_loghandle TYPE balloghndl,
lt_loghandle TYPE bal_t_logh.
* open log
ls_log-object = fi_object.
ls_log-subobject = fi_subobject.
ls_log-aluser = sy-uname.
ls_log-alprog = sy-repid.
CALL FUNCTION 'BAL_LOG_CREATE' "#EC *
EXPORTING
i_s_log = ls_log
IMPORTING
e_log_handle = lv_loghandle
EXCEPTIONS
OTHERS = 1.
LOOP AT ft_messages ASSIGNING
lv_message =
IF NOT
IF NOT
IF NOT
IF NOT
CALL FUNCTION 'BAL_LOG_MSG_ADD_FREE_TEXT' "#EC *
EXPORTING
i_log_handle = lv_loghandle
i_msgty =
i_text = lv_message
EXCEPTIONS
log_not_found = 1
msg_inconsistent = 2
log_is_full = 3
OTHERS = 4.
ENDLOOP.
INSERT lv_loghandle INTO TABLE lt_loghandle.
CALL FUNCTION 'BAL_DB_SAVE' "#EC *
EXPORTING
i_save_all = ' '
i_t_log_handle = lt_loghandle
EXCEPTIONS
log_not_found = 1
save_not_allowed = 2
numbering_error = 3
OTHERS = 4.
ENDFUNCTION.
No comments:
Post a Comment