Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BAL_LOG_MSG_ADD not displaying complete message

0 Kudos

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?

9 REPLIES 9

Sandra_Rossi
Active Contributor
0 Kudos

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?

0 Kudos

It is a grid display.

Sandra_Rossi
Active Contributor

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: ?

Former Member
0 Kudos

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.

0 Kudos

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.

raymond_giuseppi
Active Contributor

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

0 Kudos

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).

0 Kudos

Double-click or click on display icon trigger two pop-up (if that was not as easy as I supposed)

  • Double-click : display message as for any transaction when you double-click on the lower displayed message
  • Click on display icon: display technical data of cursor selected item, those related to message itself and the fields values of the context structure

Regards,
Raymond

Sandra_Rossi
Active Contributor
0 Kudos

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