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: 

ALV error log still shows even after freeing container and variable

0 Kudos

Hi Sap Gurus,

I would like to ask if ever you've experience the display protocol (error log) from ALV is still showing.
Even if we press exit (sy-ucomm) values with code:

CALL METHOD LO_CUSTOM_CONTAINER->FREE

FREE: LO_CUSTOM_CONTAINER.

The error log still shows, i tried calling the subroutine ACTIVATE_DISPLAY_PROTOCOL and set it to abap_false or blank.

And it does not work. But if i setup this right after the CL_GUI instantiation, it is being hidden.

I was wondering if we need to revoke a subroutine to refresh the setting of the ALV?

Thanks in advance.


Warmest regards,

Ryann Ong

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
0 Kudos

EDIT: you should also free the ALV grid control ! If not, then the protocol control is not freed either.

So, you're implementing the ALV grid control in Edit mode.

We don't know your custom code, we can't know what you do in subroutine ACTIVATE_DISPLAY_PROTOCOL (if it's about changing the property m_display_protocol, why do you need to change it?)

If you use the default way of displaying the input error protocol (an amodal dialog box), then the FREE of the ALV grid also frees the protocol dialog box.

So, the question, what did you exactly do differently?

3 REPLIES 3

Sandra_Rossi
Active Contributor
0 Kudos

EDIT: you should also free the ALV grid control ! If not, then the protocol control is not freed either.

So, you're implementing the ALV grid control in Edit mode.

We don't know your custom code, we can't know what you do in subroutine ACTIVATE_DISPLAY_PROTOCOL (if it's about changing the property m_display_protocol, why do you need to change it?)

If you use the default way of displaying the input error protocol (an amodal dialog box), then the FREE of the ALV grid also frees the protocol dialog box.

So, the question, what did you exactly do differently?

0 Kudos

Hi Sandra,


Thanks for the information. However the ACTIVATE DISPLAY PROTOCOL does not work, it only closes it permanently.

In order to solve this i took the instance of the CL_ALV_CHANGED_DATA_PROTOCOL and have it check when the log is visible by using the PROTOCOL_IS_VISIBLE subroutine.

The subroutine returns 1 if it is visible while 0 if it is not visible.

After this i get the cell with the error data and set it to blank, the issue is that it still reads the data that has wrong value if you just free the container of the grid.

So i used get_selected_rows and change it to blank then i set_selected_rows. This works perfectly.


Thanks and warmest regards,

Ryann Ong

0 Kudos

Sorry, I had NOT understood that you were talking of the method ACTIVATE_DISPLAY_PROTOCOL of CL_GUI_ALV_GRID, because you used the term "subroutine", which is really different from "method" (a subroutine is called with PERFORM).

One question is why do you need this method as anyway the protocol display is activated automatically when there's an error, and hidden automatically when there's no more error?

If you need to change the value of an erroneous cell then you should use the method MODIFY_CELL of CL_ALV_CHANGED_DATA_PROTOCOL.

Anyway, I guess you have programmed the protocol in a special way, and I don't understand how you did it.

If your question is solved, please mark your post as "answered".