Application Development and Automation 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: 
Read only

double click in alv report rows

Former Member
0 Likes
505

Hi to all!!

I have an alv report and I want it to go directly to a transaction IW38 when I double click the row, I know that i have to use the reuse_alv_grid_display's IT_EVENT parameter and also the I_CALLBACK_USERCOMMAND but I don't know exactly how.

Can anybody show me an example or help me?

THANKS A LOT!!!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
463

Hi,

Take a look at the following code ( 2 main perform 😞

*---------------------------------------------------*
*       ITAB_user_command                          *
*--------------------------------------------------*
FORM itab_user_command  USING ucomm TYPE sy-ucomm
                        s_selfield TYPE slis_selfield.

  CASE ucomm.


    WHEN '&IC1'.
*     Call Transaction MM03
      IF s_selfield-fieldname = 'MATNR' .

       READ TABLE t_bom INDEX s_selfield-tabindex.
        SET PARAMETER ID 'MAT' FIELD t_bom-matnr.

        CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
      ENDIF.
  ENDCASE.

----

*&---------------------------------------------*
*&      Form  display_data
*&-----------------------------------------------*
FORM display_data.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
*           i_background_id             = 'SIWB_WALLPAPER'
            i_background_id             = 'ALV_BACKGROUND'
            i_callback_program          = w_repid
*           i_callback_html_top_of_page = w_html_top_of_page
*           i_structure_name            = 'TRDIR'
            i_bypassing_buffer          = 'X'
            i_default                   = 'X'
            i_save                      = w_variant_save "'A'
            is_variant                  = w_variant
            is_layout                   = w_layout
            i_callback_user_command     = 'ITAB_USER_COMMAND'
*            i_callback_pf_status_set    = 'SET_PF_STATUS'
            it_fieldcat                 = i_fieldcat_alv[]
            it_events                   = i_events[]
            it_event_exit               = i_event_exit[]
*            it_excluding                = i_excluding
            is_print                    = w_print
*           i_screen_start_column       = 1
*           i_screen_start_line         = 1
*           i_screen_end_column         = 70
*           i_screen_end_line           = 30
       TABLES
            t_outtab                    = t_bom
       EXCEPTIONS
            program_error               = 1.

ENDFORM.                    " display_data

Best regards,

Erwan

Hi to all!!

I have an alv report and I want it to go directly to a transaction IW38 when I double click the row, I know that i have to use the reuse_alv_grid_display's IT_EVENT parameter and also the I_CALLBACK_USERCOMMAND but I don't know exactly how.

Can anybody show me an example or help me?

THANKS A LOT!!!

2 REPLIES 2
Read only

Former Member
0 Likes
464

Hi,

Take a look at the following code ( 2 main perform 😞

*---------------------------------------------------*
*       ITAB_user_command                          *
*--------------------------------------------------*
FORM itab_user_command  USING ucomm TYPE sy-ucomm
                        s_selfield TYPE slis_selfield.

  CASE ucomm.


    WHEN '&IC1'.
*     Call Transaction MM03
      IF s_selfield-fieldname = 'MATNR' .

       READ TABLE t_bom INDEX s_selfield-tabindex.
        SET PARAMETER ID 'MAT' FIELD t_bom-matnr.

        CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
      ENDIF.
  ENDCASE.

----

*&---------------------------------------------*
*&      Form  display_data
*&-----------------------------------------------*
FORM display_data.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
*           i_background_id             = 'SIWB_WALLPAPER'
            i_background_id             = 'ALV_BACKGROUND'
            i_callback_program          = w_repid
*           i_callback_html_top_of_page = w_html_top_of_page
*           i_structure_name            = 'TRDIR'
            i_bypassing_buffer          = 'X'
            i_default                   = 'X'
            i_save                      = w_variant_save "'A'
            is_variant                  = w_variant
            is_layout                   = w_layout
            i_callback_user_command     = 'ITAB_USER_COMMAND'
*            i_callback_pf_status_set    = 'SET_PF_STATUS'
            it_fieldcat                 = i_fieldcat_alv[]
            it_events                   = i_events[]
            it_event_exit               = i_event_exit[]
*            it_excluding                = i_excluding
            is_print                    = w_print
*           i_screen_start_column       = 1
*           i_screen_start_line         = 1
*           i_screen_end_column         = 70
*           i_screen_end_line           = 30
       TABLES
            t_outtab                    = t_bom
       EXCEPTIONS
            program_error               = 1.

ENDFORM.                    " display_data

Best regards,

Erwan

Read only

Former Member
0 Likes
463

<b>ex-</b>

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IS_LAYOUT = LAYOUT
IT_FIELDCAT = IT_FIELDCAT
IT_SORT = IT_SORT
I_CALLBACK_PF_STATUS_SET = 'STATUS'
IT_EXCLUDING = I_FCODE_EXTAB
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IT_EVENTS = IT_EVENTS[]
TABLES
T_OUTTAB = IT_VBAK

EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.

IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.


FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.

CASE R_UCOMM.
WHEN 'BACK' OR 'CANC' OR 'EXIT'.
LEAVE TO SCREEN 0.

WHEN '&IC1'.
SET PARAMETER ID 'AUN' FIELD RS_SELFIELD-VALUE.
CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
ENDCASE.

ENDFORM. "USER_COMMAND