I am using REUSE_ALV_GRID_DISPLAY function module. It has a exception parameter PROGRAM_ERROR defined.
But still the FM throws runtime dump when fieldcat is blank.
So is it possible to catch these exceptions in my program and trigger error? This is to avoid dump.
I have tried to enclose the FM within TRY and CATCH but still it is not caught.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
i_callback_program = v_repid
i_structure_name = 'I_STOCK'
it_fieldcat = i_fieldcat
i_callback_user_command = 'USER_COMMAND' "For buton event handlers
i_callback_pf_status_set = 'SET_PF_STATUS' "For ALV toolbar
i_callback_top_of_page = 'TOP_OF_PAGE' "For ALV Header
is_layout = x_layout
i_save = c_x
i_grid_title = v_grid_title
es_exit_caused_by_user = x_exit
t_outtab = i_stock
program_error = 1
OTHERS = 2.
CATCH cx_root INTO oref.
v_exptext = oref->get_text( ).
What am I doing wrong? Is there any solution?