Ive a program that builds an ALV and shows some data retrieved from a custom table. The problem is that, during the double-click event processing, if I send an error with MESSAGE E000, the program closes abnormally the next time I click on the ALV (any ALV option closes it immediately).
The program creates the ALV based on the standard command:
CALL METHOD grid_itab1->set_table_for_first_display
and defines a handler for the double-click event with:
SET HANDLER lcl_event_handler=>on_double_click FOR grid_itab1.
My event handler tester is very simple:
CLASS lcl_event_handler DEFINITION.
FOR EVENT double_click OF cl_gui_alv_grid
e_row e_column es_row_no.
CLASS lcl_event_handler IMPLEMENTATION.
MESSAGE E000 WITH BLA BLA BLA.
Does any body know why the program is closing abnormally once the error message is show? I even tried to call the CALL METHOD cl_gui_cfw=>flush before the MESSAGE is sent but it does not solve the problem. A temporary solution I found for the problem was to change from MESSAGE E000 to MESSAGE S000.
Also, when the program stops it does not show any standard ABAP dump screen. In the logs (SM21) the only information I get is roll-back error, Message ID R6 8, on class STSK.
How can I solve this? Is there any method that I have to call before issue the MESSAGE Ennn command?
1. Why do you want to throw an E-message within the double-click event?! Have you tried to throw an I message?!
Have a look at the online documentation for MESSAGE. You find a table stating the different behaviours on certain message types (e, i, s) according to the type of program.
2. An E message will not generate a short dump!!! A shortdump normally occurs because of REALLY severe system problems or syntax errors!
Message types have different behaviour with respect to the context they are called. That is, sometimes the context forces another behaviour overriding the normal type of the message (e.g. your S message is showed as an I message). You can find related behaviour table at the F1 help for <b>"MESSAGE"</b> statement.
About your problem, you give the E message at the OO context. It seems the context requires to stop the execution of the program. So just give the S message and exit the routine if required.
You can set the parameter id "MESSAGE_DISPLAY_TYPE" as I remember to change the display type of a message. However, this is not recommended and may have side effects for the rest of your SAP sessions.
*--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>