BAL_DSP_LOG_DISPLAY
这个函数有点意思,
标准表:关键字为STANDARD TABLE, 系统为该表的每一行数据生成一个逻辑索引。 填充标准表时,可以将数据附加在现有行之后,也可以插入到指定的位置,程序对内表行的寻址操作可通过关键字或索引进行。在对表进行插入、删除等操作时,各数据行在内存中的位置不变,系统仅重新排列各数据行的索引值。
排序表
排序表:关键字为 SORTED TABLE, 也具有一个逻辑索引,不同之处是排序表总是按其关键字升序排序后再进行存储,其访问方式与标准表相同。
哈希表
哈希表:关键字为 HASHED TABLE, 没有索引,只能通过关键字来访问。系统用哈希算法管理表中的数据,因而其寻址一个数据行的时间和表的行数无关。
这种表不允许你直接sort 因为本身是sorted
第二个特殊地方就是
不是所有表都能se16改 这个sort就是
在程序执行的时候检查是否排序表 直接给你报错,而不是允许你随意填一个值来插入,因为你插入的值如果不是sorted 那可能引发翻车案例 直接dump
接下来的问题更加需要注意,
这个函数 你可以这样操作,
下面是我的代码
*&---------------------------------------------------------------------*
*& Report YXFIR462_BACKJOBTEST
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT yxfir462_backjobtest.
DATA: gv_log_handle TYPE balloghndl.
DATA gt_log_handle TYPE bal_t_logh.
DATA:gtall_log TYPE bal_t_logh.
DATA: gl_balloghndl TYPE balloghndl.
CONSTANTS: cons_log_object TYPE bal_s_log-object VALUE 'FIBA',
cons_log_subobject TYPE bal_s_log-subobject VALUE 'BAPAYMIN'.
START-OF-SELECTION.
DO 2 TIMES.
PERFORM frm_log_fimsg_create.
PERFORM frm_log_fimsg.
PERFORM frm_log_fimsg_db_save.
ENDDO.
CALL FUNCTION 'BAL_DSP_LOG_DISPLAY'
EXPORTING
i_t_log_handle = gtall_log
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. "frm_log_display
*&---------------------------------------------------------------------*
*& Form FRM_MOVE_TO_FTPOST
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM frm_log_fimsg_create .
DATA:
g_s_log TYPE bal_s_log,
g_value TYPE i.
* DEFINE SOME HEADER DATA OF THIS LOG
g_s_log-extnumber = text-003.
DATA: l_guid_22 TYPE guid_22.
PERFORM frm_stage_id_guid_create
CHANGING l_guid_22.
WRITE: l_guid_22 TO g_s_log-extnumber+30.
CONDENSE g_s_log-extnumber NO-GAPS.
MOVE l_guid_22 TO gl_balloghndl. " YJZDH
g_s_log-object = cons_log_object.
g_s_log-subobject = cons_log_subobject.
g_s_log-aldate = sy-datum. "WIE IN RSBTCHH0
g_s_log-altime = sy-uzeit.
g_s_log-aluser = sy-uname.
g_s_log-altcode = space.
g_s_log-alprog = sy-repid.
g_s_log-almode = space.
g_s_log-alprog = sy-repid.
* G_S_LOG-PARAMS = SPACE.
CALL FUNCTION 'BAL_LOG_CREATE'
EXPORTING
i_s_log = g_s_log
IMPORTING
e_log_handle = gv_log_handle
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.
ENDFORM. " FRM_LOG_FIMSG_CREATE
*&---------------------------------------------------------------------*
*& Form FRM_STAGE_ID_GUID_CREATE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* <--P_L_GUID_22 text
*----------------------------------------------------------------------*
FORM frm_stage_id_guid_create CHANGING p_stage_guid.
CALL FUNCTION 'GUID_CREATE'
IMPORTING
ev_guid_22 = p_stage_guid.
ENDFORM. " FRM_STAGE_ID_GUID_CREATE
*&---------------------------------------------------------------------*
*& Form FRM_LOG_FIMSG
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM frm_log_fimsg .
DATA:
l_s_msg TYPE bal_s_msg.
l_s_msg-alsort = 01.
* DEFINE DATA OF MESSAGE FOR APPLICATION LOG
l_s_msg-msgty = 'E'.
l_s_msg-msgid = 'YFI'.
l_s_msg-msgno = '000'.
* l_s_msg-msgv1 = fimsg-msgv1.
* l_s_msg-msgv2 = fimsg-msgv2.
* l_s_msg-msgv3 = fimsg-msgv3.
* l_s_msg-msgv4 = fimsg-msgv4.
l_s_msg-probclass = '1'.
CALL FUNCTION 'BAL_LOG_MSG_CUMULATE'
EXPORTING
i_log_handle = gv_log_handle
i_s_msg = l_s_msg
i_compare_attributes = 'X'
i_compare_context = 'X'
i_compare_parameters = 'X'
* IMPORTING
* E_S_MSG_HANDLE =
* E_MSG_WAS_LOGGED =
* E_MSG_WAS_DISPLAYED =
EXCEPTIONS
log_not_found = 0
msg_inconsistent = 2
* OTHERS = 3
.
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_LOG_FIMSG
*&---------------------------------------------------------------------*
*& Form FRM_LOG_FIMSG_DB_SAVE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM frm_log_fimsg_db_save .
REFRESH gt_log_handle.
CLEAR gt_log_handle.
APPEND gv_log_handle TO gt_log_handle.
* APPEND LINES OF gt_log_handle TO gtall_log.
CALL FUNCTION 'BAL_DB_SAVE'
EXPORTING
* I_IN_UPDATE_TASK = 'X'
i_save_all = 'X'
i_t_log_handle = gt_log_handle
EXCEPTIONS
log_not_found = 1
save_not_allowed = 2
numbering_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
EXPORT table = gt_log_handle TO MEMORY ID 'GT_LOG'.
ENDFORM. " FRM_LOG_FIMSG_DB_SAVE
这段代码告诉一个东西就是我允许你在同一个程序里面一次显示多条 错误还是失败。
但是不允许你这样操作
REPORT yxfir462_back_job_test.
DATA gtall_log_handle TYPE bal_t_logh.
DATA:lt_log_handle TYPE bal_t_logh.
START-OF-SELECTION.
DO 2 TIMES.
SUBMIT yxfir462_backjobtest AND RETURN .
IMPORT table = lt_log_handle FROM MEMORY ID 'GT_LOG'.
APPEND LINES OF lt_log_handle TO gtall_log_handle.
ENDDO.
CALL FUNCTION 'BAL_DSP_LOG_DISPLAY'
EXPORTING
i_t_log_handle = gtall_log_handle
* CALL FUNCTION 'BAL_DSP_LOG_PRINT'
* EXPORTING
* I_S_LOG_FILTER =
* I_T_LOG_CONTEXT_FILTER =
* I_S_MSG_FILTER =
* I_T_MSG_CONTEXT_FILTER =
* I_T_LOG_HANDLE =
* I_T_MSG_HANDLE =
* I_S_DISPLAY_PROFILE =
* I_AMODAL = ' '
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. "frm_log_display
不允许你submit操作,一个程序显示多个甚至一个,提示的错误是
Anzeigeprofil ist nicht konsistent(描述文件没有一致性)
希望能给遇到这个问题的朋友提供一些建议。