femina_alba написал(а):
Можно ли как нибудь добавить свои поля в лог ошибок, который формируется ФМ BAL_LOG_MSG_ADD?
Нашел описание добавления полей в
http://help.sap.com/saphelp_47x200/helpdata/EN/bb/6811ed80ae11d3966f00a0c930660b/frameset.htm"This context information can be passed with a message (or a log header) in the Application Log. You must define a DDIC structure to contain the context information (maximum length 256 bytes). Enter the DDIC structure name in the CONTEXT field CONTEXT-TABNAME, and the structure content in CONTEXT-VALUE. The context data can be displayed later."
Code:
DATA:
l_s_msg TYPE bal_s_msg,
l_s_my_context type my_ddic_structure.
* Message 123(XY): 'Credit limit exceeded for customer &1'.
l_s_msg-msgty = 'E'.
l_s_msg-msgid = 'XY'.
l_s_msg-msgno = '123'.
l_s_msg-msgv1 = 'ABC'.
* Put document number in the message as context:
l_s_my_context-document = '3000012345'.
l_s_msg-context-tabname = 'MY_DDIC_STRUCTURE'.
l_s_msg-context-value = l_s_my_context.
* Put message in log
CALL FUNCTION 'BAL_LOG_MSG_ADD'
EXPORTING
i_s_msg = l_s_msg
EXCEPTIONS
others = 1.