REPORT zvil_log_display.
DATA:git_msg TYPE TABLE OF bal_s_msg,
gwa_msg TYPE bal_s_msg.
DATA: git_err TYPE STANDARD TABLE OF bapiret2,
gwa_err TYPE bapiret2.
gwa_msg-msgty = 'E'.
gwa_msg-msgid = 'BK'.
gwa_msg-msgno = '001'.
gwa_msg-msgv1 = 'GK01'.
APPEND gwa_msg TO git_msg.
PERFORM frm_dis_log.
*&---------------------------------------------------------------------*
*& Form FRM_DIS_LOG
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM frm_dis_log .
DATA: ls_appl_log TYPE bal_s_log,
ls_appl_log_handle TYPE balloghndl,
ls_display_profile TYPE bal_s_prof,
ls_fcat TYPE bal_s_fcat,
lc_bal_s_excm TYPE bal_s_excm.
CALL FUNCTION 'BAL_LOG_CREATE'
EXPORTING
i_s_log = ls_appl_log
IMPORTING
e_log_handle = ls_appl_log_handle
EXCEPTIONS
log_header_inconsistent = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*GIT_MSG
LOOP AT git_msg INTO gwa_msg.
CALL FUNCTION 'BAL_LOG_MSG_ADD'
EXPORTING
i_log_handle = ls_appl_log_handle
i_s_msg = gwa_msg
EXCEPTIONS
log_not_found = 0
OTHERS = 1.
IF sy-subrc <> 0 .
ENDIF.
ENDLOOP.
LOOP AT git_err INTO gwa_err.
CALL FUNCTION 'BAL_LOG_MSG_ADD_FREE_TEXT'
EXPORTING
i_log_handle = ls_appl_log_handle
i_msgty = gwa_err-type
i_text = gwa_err-message
EXCEPTIONS
log_not_found = 1
msg_inconsistent = 2
log_is_full = 3
OTHERS = 4.
IF sy-subrc <> 0 .
ENDIF.
ENDLOOP.
CALL FUNCTION 'BAL_DSP_PROFILE_POPUP_GET'
* EXPORTING
* START_COL = 5
* START_ROW = 5
* END_COL = 87
* END_ROW = 25
IMPORTING
e_s_display_profile = ls_display_profile.
ls_display_profile-use_grid = 'X'.
ls_display_profile-title = sy-title.
ls_display_profile-pop_adjst = 'X'.
ls_display_profile-cwidth_opt = 'X'.
* LS_FCAT-REF_TABLE = 'BAPI_TE_XMKPF'.
* LS_FCAT-REF_FIELD = 'DOC_YEAR'.
* LS_FCAT-OUTPUTLEN = '25'.
* LS_FCAT-COL_POS = 100.
* APPEND LS_FCAT TO LS_DISPLAY_PROFILE-MESS_FCAT.
* LS_FCAT-REF_TABLE = 'BAPI_TE_XMKPF'.
* LS_FCAT-REF_FIELD = 'MAT_DOC'.
* LS_FCAT-OUTPUTLEN = '25'.
* LS_FCAT-COL_POS = 200.
* APPEND LS_FCAT TO LS_DISPLAY_PROFILE-MESS_FCAT.
IF git_err IS INITIAL.
ENDIF.
* " display message
CALL FUNCTION 'BAL_DSP_LOG_DISPLAY'
EXPORTING
i_s_display_profile = ls_display_profile
* IMPORTING
* E_S_EXIT_COMMAND = LC_BAL_S_EXCM
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
* " clear log
CALL FUNCTION 'BAL_LOG_REFRESH'
EXPORTING
i_log_handle = ls_appl_log_handle
EXCEPTIONS
log_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " FRM_DIS_LOG
阅读(653) | 评论(0) | 转发(0) |