Skip to Content
author's profile photo Former Member
Former Member

calling transaction with hotspot_click

Hello everybody,

I need to know if it is possible to call transaction within an ALV when clicking

on a hotspotted field.

In that case how can I handle it ?

Thank you.

Luca

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 29, 2007 at 01:01 PM

    Hi

    In the user command of ALV report you can call a transaction

    see the code

    FORM user_command USING r_ucomm LIKE sy-ucomm

    rs_selfield TYPE slis_selfield.

    CASE r_ucomm.

    WHEN 'PICK'. " Double click line

    • Check field clicked on within ALVgrid report

    IF rs_selfield-fieldname = 'VBELN'.

    • Read data table, using index of row user clicked on

    READ TABLE t_disp_tab INTO wa_item_tab INDEX

    rs_selfield-tabindex.

    • Set parameter ID for transaction screen field

    SET PARAMETER ID 'VL' FIELD wa_item_tab-vbeln.

    CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN.

    endif.

    endform.

    Reward points if useful

    Regards

    Anji

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 29, 2007 at 01:00 PM

    Hi,

    yes we can call the transaction using call transaction by setting the parameter id.

    for example:

    if you click at material number then

    AT USER-COMMAND.

    WHEN &1IC&.

    set parameter id 'MAT' field matnr rs_selfield-sel_tab_field.

    call transaction 'MM03'.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 29, 2007 at 01:02 PM

    Hi,

    you need to code in the at line-selection event.

    At Line-selection.

    CALL transaction <trname>....

    Reward pts if useful.

    Regrards,

    Harsha

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 29, 2007 at 01:07 PM

    the below is the code for the alv double click

    *&---------------------------------------------------------------------*
    *& Report  ZUS_SDN_TWO_ALV_GRIDS
    *&
    *&---------------------------------------------------------------------*
    *&
    *&
    *&---------------------------------------------------------------------*
     
    REPORT  zus_sdn_alvgrid_events_1.
     
     
     
    DATA:
      gd_okcode        TYPE ui_func,
    *
      gt_fcat          TYPE lvc_t_fcat,
      go_docking       TYPE REF TO cl_gui_docking_container,
      go_docking2      TYPE REF TO cl_gui_docking_container,
      go_grid1         TYPE REF TO cl_gui_alv_grid,
      go_grid2         TYPE REF TO cl_gui_alv_grid.
     
     
    DATA:
      gt_t001          TYPE STANDARD TABLE OF t001,
      gt_knb1          TYPE STANDARD TABLE OF knb1.
     
     
     
     
    *---------------------------------------------------------------------*
    *       CLASS lcl_eventhandler DEFINITION
    *---------------------------------------------------------------------*
    *
    *---------------------------------------------------------------------*
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
     
        CLASS-METHODS:
          handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
            IMPORTING
              e_row
              e_column
              es_row_no
              sender.
     
    ENDCLASS.                    "lcl_eventhandler DEFINITION
     
     
    *---------------------------------------------------------------------*
    *       CLASS lcl_eventhandler IMPLEMENTATION
    *---------------------------------------------------------------------*
    *
    *---------------------------------------------------------------------*
    CLASS lcl_eventhandler IMPLEMENTATION.
     
      METHOD handle_double_click.
    *   define local data
        DATA:
          ls_t001     TYPE t001,
          ls_col_id   TYPE lvc_s_col.
     
     
        CHECK ( sender = go_grid1 ).
     
     
        READ TABLE gt_t001 INTO ls_t001 INDEX e_row-index.
        CHECK ( ls_t001-bukrs IS NOT INITIAL ).
     
        SELECT * FROM knb1 INTO TABLE gt_knb1
          WHERE bukrs = ls_t001-bukrs.
        IF ( syst-subrc NE 0 ).
          MESSAGE 'No customers found' TYPE 'S'.
     
        ELSE.
    *     Trigger PAI of dynpro '0100' and set new ok-code
          CALL METHOD cl_gui_cfw=>set_new_ok_code( 'CALL_SCREEN_0200' ).
        ENDIF.
     
     
      ENDMETHOD.                    "handle_hotspot_click
     
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
     
     
     
     
    START-OF-SELECTION.
     
      SELECT * FROM t001 INTO TABLE gt_t001.
      REFRESH: gt_knb1.
     
     
     
    * Create docking container
      CREATE OBJECT go_docking
        EXPORTING
          parent                      = cl_gui_container=>screen0
          ratio                       = 90
        EXCEPTIONS
          OTHERS                      = 6.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CREATE OBJECT go_docking2
        EXPORTING
          parent                      = cl_gui_container=>screen0
          ratio                       = 90
        EXCEPTIONS
          OTHERS                      = 6.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
     
     
    * Create ALV grid
      CREATE OBJECT go_grid1
        EXPORTING
          i_parent          = go_docking
        EXCEPTIONS
          OTHERS            = 5.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CREATE OBJECT go_grid2
        EXPORTING
          i_parent          = go_docking2
        EXCEPTIONS
          OTHERS            = 5.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
     
     
    * Set event handler
      SET HANDLER:
        lcl_eventhandler=>handle_double_click FOR go_grid1.
     
     
     
     
     
     
    * Display data
      CALL METHOD go_grid1->set_table_for_first_display
        EXPORTING
          i_structure_name = 'T001'
        CHANGING
          it_outtab        = gt_t001
        EXCEPTIONS
          OTHERS           = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
     
      CALL METHOD go_grid2->set_table_for_first_display
        EXPORTING
          i_structure_name = 'KNB1'
        CHANGING
          it_outtab        = gt_knb1
        EXCEPTIONS
          OTHERS           = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
     
     
     
    * Link the docking container to the target dynpro
      CALL METHOD go_docking->link
        EXPORTING
          repid                       = syst-repid
          dynnr                       = '0100'
    *      CONTAINER                   =
        EXCEPTIONS
          OTHERS                      = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
     
      CALL METHOD go_docking2->link
        EXPORTING
          repid                       = syst-repid
          dynnr                       = '0200'
    *      CONTAINER                   =
        EXCEPTIONS
          OTHERS                      = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
     
     
    * ok-code field = GD_OKCODE
      CALL SCREEN '0100'.
     
     
    END-OF-SELECTION.
     
    *&---------------------------------------------------------------------*
    *&      Module  STATUS_0100  OUTPUT
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS_0100'.
    *  SET TITLEBAR 'xxx'.
     
     
    ENDMODULE.                 " STATUS_0100  OUTPUT
     
    *&---------------------------------------------------------------------*
    *&      Module  USER_COMMAND_0100  INPUT
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    MODULE user_command_0100 INPUT.
     
      CASE gd_okcode.
        WHEN 'BACK' OR
             'END'  OR
             'CANC'.
          SET SCREEN 0. LEAVE SCREEN.
     
        WHEN 'CALL_SCREEN_0200'.
          go_grid2->refresh_table_display( ).  " necessary
     
          CALL SCREEN '0200'.
     
     
        WHEN OTHERS.
      ENDCASE.
     
      CLEAR: gd_okcode.
     
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    
    

    Girish

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 30, 2007 at 07:14 AM

    Hi,

    Whatever user command in

    FORM <b>user_command</b> USING r_ucomm LIKE sy-ucomm

    rs_selfield TYPE slis_selfield.

    U have to pass that user command in the FM "REUSE_ALV_GRID_DISPLAY"

    exporting paramters

    I_CALLBACK_USER_COMMAND = 'ur user command '

    Thanks,

    Manjunath MS

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.