‎2011 Feb 14 11:18 AM
Hi,
I am create a log in a sub-screen using the following flow logic:-
1. Create log using FM 'BAL_LOG_CREATE'
2. Adding messages using FM 'BAL_LOG_MSG_ADD'
3. Create a display profile where the column is set as Message text from stru BAL_S_SHOW-T_MSG
4. Initialization of display profile using FM 'BAL_DSP_OUTPUT_INIT'
5. And finally setting the data to be displayed using FM 'BAL_DSP_OUTPUT_SET_DATA'
Though everything works fine and log gets generated but in the message text column i get the message no, message class also which i need to suppress which i am not able to figure out how.
Below you can find the subroutine called for each message:-
FORM LOG_MSG_ADD USING
value(i_log_handle) TYPE balloghndl.
DATA: l_s_msg TYPE bal_s_msg.
define data of message for Application Log
l_s_msg-msgty = sy-msgty.
l_s_msg-msgid = sy-msgid.
l_s_msg-msgno = sy-msgno.
l_s_msg-msgv1 = sy-msgv1.
l_s_msg-msgv2 = sy-msgv2.
l_s_msg-msgv3 = sy-msgv3.
l_s_msg-msgv4 = sy-msgv4.
add this message to log file
CALL FUNCTION 'BAL_LOG_MSG_ADD'
EXPORTING
i_log_handle = i_log_handle
i_s_msg = l_s_msg
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.
Kindly suggest me pointers.
Thanks,
Jatin
Edited by: Jatin Grover on Feb 14, 2011 12:19 PM
‎2011 Feb 14 12:00 PM
Hello,
Your code looks good. But I am not sure on Step 3 and 4 below.
Try calling BAL_DB_SAVE in step 3 and then after saving to database, You can access the message and display on screen.
Regards
Shiva
‎2011 Feb 25 4:14 PM
I was using the message which is defined in the message class but instead of text it consisted of 4 placeholders i.e. &1 &2 &3 &4 which i was filling in my program.
So instead of using FM BAL_LOG_MSG_ADD now i am using FM BAL_LOG_MSG_ADD_FREE_TEXT which has solved the problem.
Edited by: Jatin Grover on Mar 1, 2011 11:17 AM