‎2022 Apr 15 10:08 AM
Hi Gurus,
I am trying to build an Interactive report using classes, but I am facing some issues. After execution of report I am getting the first table, but whenever I will click on the record of that table, it is not navigating me to next desired internal table. I am attaching the utility report in the attachment.
Request you to guide me , what is incorrect in the report.
Thanks and Regards,
Aditya Maneinteractive-report-1.txt
‎2022 Apr 15 10:26 AM
please paste the code in the question, using the "CODE" button to format it.
‎2022 Apr 15 10:40 AM
CLASS lcl_interactive DEFINITION.
PUBLIC SECTION.
TYPES: BEGIN OF ty_data,
usmd_creq_type TYPE usmd_crequest_type,
txtmi TYPE usmd_txtmi,
usmd_model TYPE usmd_model,
usmd_crequest_wf TYPE usmd_workflow,
END OF ty_data,
BEGIN OF ty_data_id,
usmd_creq_type TYPE usmd_crequest_type,
usmd_creq_step TYPE usmd_ssw_crequest_step,
txtmi TYPE usmd_txtmi,
END OF ty_data_id.
DATA: lt_data TYPE STANDARD TABLE OF ty_data,
ls_data TYPE ty_data,
lt_data_id TYPE STANDARD TABLE OF ty_data_id,
ls_data_id TYPE ty_data_id,
lt_fcat TYPE slis_t_fieldcat_alv,
ls_fcat TYPE slis_fieldcat_alv,
lt_fcat_id TYPE slis_t_fieldcat_alv,
ls_fcat_id TYPE slis_fieldcat_alv,
go_data TYPE REF TO cl_gui_alv_grid,
go_cont_data TYPE REF TO cl_gui_custom_container,
go_data_id TYPE REF TO cl_gui_alv_grid,
go_cont_data_id TYPE REF TO cl_gui_custom_container,
var TYPE usmd_crequest_type,
o_event TYPE REF TO lcl_interactive,
go_alv TYPE REF TO cl_gui_alv_grid.
DATA : lr_alv TYPE REF TO cl_salv_table.
METHODS: get_fieldcat,get_data, handle_double_click
FOR EVENT double_click
OF cl_gui_alv_grid
IMPORTING e_row e_column.
ENDCLASS.
CLASS lcl_interactive IMPLEMENTATION.
METHOD get_fieldcat.
ls_fcat-col_pos = '1'.
ls_fcat-fieldname = 'USMD_CREQ_TYPE'.
ls_fcat-seltext_m = 'CR TYPE'.
ls_fcat-hotspot = 'X'.
APPEND ls_fcat TO lt_fcat.
CLEAR ls_fcat.
ls_fcat-col_pos = '2'.
ls_fcat-fieldname = 'TXTMI'.
ls_fcat-seltext_m = 'SHORT DESCRIPTION'.
APPEND ls_fcat TO lt_fcat.
CLEAR ls_fcat.
ls_fcat-col_pos = '3'.
ls_fcat-fieldname = 'USMD_MODEL'.
ls_fcat-seltext_m = 'DATA MODEL'.
APPEND ls_fcat TO lt_fcat.
CLEAR ls_fcat.
ls_fcat-col_pos = '4'.
ls_fcat-fieldname = 'USMD_CREQUEST_WF'.
ls_fcat-seltext_m = 'WORKFLOW'.
APPEND ls_fcat TO lt_fcat.
CLEAR ls_fcat.
*
ls_fcat_id-col_pos = 1.
ls_fcat_id-fieldname = 'USMD_CREQ_TYPE'.
ls_fcat_id-seltext_m = 'CR TYPE'.
APPEND ls_fcat_id TO lt_fcat_id.
CLEAR ls_fcat_id.
ls_fcat_id-col_pos = 2.
ls_fcat_id-fieldname = 'USMD_CREQ_STEP'.
ls_fcat_id-seltext_m = 'Step'.
APPEND ls_fcat_id TO lt_fcat_id.
CLEAR ls_fcat_id.
ls_fcat_id-col_pos = 3.
ls_fcat_id-fieldname = 'TXTMI'.
ls_fcat_id-seltext_m = 'CR TYPE'.
APPEND ls_fcat_id TO lt_fcat_id.
*
ENDMETHOD.
METHOD get_data.
CALL METHOD me->get_fieldcat.
SELECT usmd110c~usmd_creq_type usmd110t~txtmi usmd110c~usmd_model usmd110c~usmd_crequest_wf
INTO TABLE lt_data
FROM usmd110c INNER JOIN usmd110t
ON usmd110c~usmd_creq_type = usmd110t~usmd_creq_type
WHERE usmd110c~usmd_creq_type LIKE 'Z%1'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
* i_callback_user_command = 'UCOMMAND'
* it_events = .
it_fieldcat = lt_fcat
TABLES
t_outtab = lt_data
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDMETHOD.
METHOD handle_double_click.
CALL METHOD me->get_fieldcat.
CASE e_column-fieldname.
WHEN 'usmd_creq_type'.
READ TABLE lt_data INTO ls_data INDEX e_row-index.
IF sy-subrc EQ 0.
SELECT usmd_creq_type usmd_creq_step txtmi FROM usmd202t_ssw
INTO TABLE lt_data_id.
ENDIF.
CREATE OBJECT o_event.
SET HANDLER o_event->handle_double_click FOR go_alv.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
* i_callback_user_command = 'UCOMMAND'
it_fieldcat = lt_fcat_id
TABLES
t_outtab = lt_data_id
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDCASE.
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
DATA: lo_obj TYPE REF TO lcl_interactive,
lo_obj1 TYPE REF TO lcl_interactive.
CREATE OBJECT lo_obj.
CREATE OBJECT lo_obj1.
lo_obj->get_data( ).
lo_obj1->handle_double_click( ).
‎2022 Apr 15 11:27 AM
Few comments:
I think you have to redesign the report a bit 🙂
Kind regards
Jens
‎2022 Apr 15 11:32 AM
Please check the following example as basis for a redesign of the report (based on my comments above):
http://abaptutorialspot.blogspot.com/2018/09/salv-5-salv-double-click.html
When reacting on the double click of the main ALV you can use this example to show the second ALV as a popup version. See here:
http://zevolving.com/2013/09/popup-using-salv/
I hope this helps you 🙂
Kind regards
Jens
‎2022 Apr 15 11:36 AM
good, now it's better; do you know that you may edit a question? That is, insert the code in the body of the question, instead of adding a comment. These things together make for easier reading.
Jens already gave you some tips, nothing to add on that.