10-25-2016 8:02 AM
Hi
I am using BAL_LOG_MSG_ADD to add message to the log but the ALV in the log is not displaying the complete message. How can i display the complete message in the logs?
10-25-2016 8:20 AM
What do you mean? Are you using the grid or list output? For the grid, it displays up to 255 characters. Can you show a screenshot?
10-25-2016 10:36 AM
10-25-2016 11:04 AM
Q: What do you mean exactly?
A: ?
.
Q: Are you using the grid or list output?A: It is a grid display.
.
Q: For the grid, it displays up to 255 characters. Can you show a screenshot?
A: ?
10-25-2016 12:10 PM
Dear Pratishtha Bhatnagar,
Please Let us know clearly about your Query.
Why you are using this FM?
What you are displaying in Report Output?
Here from this FM, you are importing parameters are,
E_S_MSG_HANDLE - Message handle
E_MSG_WAS_LOGGED - Message collected
E_MSG_WAS_DISPLAYED - Message output
Here Logged and Displayed parameter is boolean. Msg_Handle is type of structure BALMSGHNDL.
In that structure two fields Log_Handle and Msgnumber.
Those fields length is only 22 characters.
So you should receive that export parameters with same character length variable.
data: Msg_handle LIKE BALMSGHNDL OCCURS 0 WITH HEADER LINE,
I_LOG_HANDLE type BALLOGHNDL,
I_S_MSG type BAL_S_MSG.
CALL FUNCTION 'BAL_LOG_MSG_ADD'
EXPORTING
I_LOG_HANDLE = I_LOG_HANDLE
i_s_msg = i_s_msg
IMPORTING
E_S_MSG_HANDLE = MSG_HANDLE
* E_MSG_WAS_LOGGED =
* E_MSG_WAS_DISPLAYED =
* EXCEPTIONS
* LOG_NOT_FOUND = 1
* MSG_INCONSISTENT = 2
* LOG_IS_FULL = 3
* OTHERS = 4
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
Thanks,
Sivaraj Sadasivam.
10-25-2016 2:33 PM
We are using this FM to log error messages in SLG1. so when i am looking for the error message in SLG1 the message is not displayed completely. Some part of it is truncated because of which we are not able to know about the reason of error.
11-04-2016 7:04 AM
BAL_LOG_MSG_ADD doesn't display anything, SLG1 and some of the BAL* FM can display data.
If you correctly fill the parameters, the message should be correctly displayed, did you map fields' value in your code or did you use a tool like cl_ops_ehp_mapping_helper=>map_bapiret2_to_bal_s_msg, also the four parameter of a message are limited in size to 50 characters.
NB: The displayed tree has limitations too, but there is easily found options to display a message in a pop-up.
There is a trick to add information, you can add one "context" structure (not too wide) to the message that can be displayed in SLG1, map a structure to context-value (max length 256, if possible use char type, Unicode use method cl_abap_container_utilities=>fill_container_c) and the ddic reference name to context-tabname.
Regards,
Raymond
11-04-2016 8:09 AM
The grid can display values up to 128 characters and cannot be changed. Cf note 857823 (ALV Grid: Strings with maximum of 128 characters) -> https://service.sap.com/sap/support/notes/857823
You have to double-click the message to display the whole text. Or create a program to display the log via BAL_DSP_LOG_DISPLAY, and add an additional column in the ALV grid to display the second part of the message, and use a callback routine to fill it (see for example demo program SBAL_DEMO_04_SELF).
11-04-2016 11:09 AM
Double-click or click on display icon trigger two pop-up (if that was not as easy as I supposed)
Regards,
Raymond
11-04-2016 8:07 AM
Sorry, I was wrong: a grid displays up to 128 characters and cannot be changed. Cf note 857823 (ALV Grid: Strings with maximum of 128 characters) -> https://service.sap.com/sap/support/notes/857823