Application Development 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: 

Using the AT-LINE SELECTION

Former Member
0 Kudos

Hi all,

I have developed a report with two ALV grid displays on one page using the OOPs method. In the first ALV there are some fields displayed like begin date, end date, partner number (rcvprn) and IDOCTP. I want a functionality such that when the user double clicks any of the partner numbers or any of the single records, transaction BDM2 should run with its selection screen filled with the values of that particular row which was selected on the ALV grid.

Can any one help how this can be done

Thanks.

Warm regards,

Harshad.

1 ACCEPTED SOLUTION

kesavadas_thekkillath
Active Contributor
0 Kudos

Jsut a sample


  METHOD handle_hotspot_click .
    CLEAR e_row.
    CLEAR col.
    CALL METHOD go_grid1->get_current_cell
      IMPORTING
        e_row     = e_row
        es_col_id = col.
    IF col-fieldname = 'VBELN'.
      FREE MEMORY ID 'AUN'.
      READ TABLE tbl_out1[] INTO wa INDEX e_row TRANSPORTING vbeln.
      IF sy-subrc = 0.
        SET PARAMETER ID: 'AUN' FIELD wa-vbeln.
        CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
      ENDIF.
    ENDIF.
  ENDMETHOD.  

Search in forum for better results

5 REPLIES 5

kesavadas_thekkillath
Active Contributor
0 Kudos

Jsut a sample


  METHOD handle_hotspot_click .
    CLEAR e_row.
    CLEAR col.
    CALL METHOD go_grid1->get_current_cell
      IMPORTING
        e_row     = e_row
        es_col_id = col.
    IF col-fieldname = 'VBELN'.
      FREE MEMORY ID 'AUN'.
      READ TABLE tbl_out1[] INTO wa INDEX e_row TRANSPORTING vbeln.
      IF sy-subrc = 0.
        SET PARAMETER ID: 'AUN' FIELD wa-vbeln.
        CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
      ENDIF.
    ENDIF.
  ENDMETHOD.  

Search in forum for better results

0 Kudos

Hey,

Thanks for your reply. Do i need to give any settings for the hotspot on my that particular GRID while dsiplaying the ALV?

Harshad.

0 Kudos

something like this



example

*----------------------------------------------------------------------*
*       CLASS LCL_EVENT_HANDLER DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_event_handler DEFINITION .
  PUBLIC SECTION .
    METHODS:handle_hotspot_click
    FOR EVENT hotspot_click OF cl_gui_alv_grid.
ENDCLASS.                    "LCL_EVENT_HANDLER DEFINITION

  w_fieldcat-fieldname = 'VBELN'.
  w_fieldcat-reptext =  'SAP Order'.
  w_fieldcat-hotspot = 'X'.                 <--------
  w_fieldcat-emphasize = 'C210'.
  w_fieldcat-tabname = 'TBL_OUT1'.
  w_fieldcat-col_pos = '8'.
  APPEND w_fieldcat TO i_fieldcat.
  CLEAR w_fieldcat.

  CALL METHOD go_grid1->set_table_for_first_display
    EXPORTING
      i_structure_name = 'TBL_OUT1'
      i_default        = 'X'
      is_layout        = w_layout
    CHANGING
      it_sort          = gt_sort[]
      it_outtab        = tbl_out1
      it_fieldcatalog  = i_fieldcat.

  CREATE OBJECT w_event_click.
  SET HANDLER w_event_click->handle_hotspot_click FOR go_grid1.

faisal_altaf2
Active Contributor
0 Kudos

Hi, Harshad

As i understand you, CALL TRANSACTION <T-Code> USING it_bdcdata can solve out your problem for sample code Please Press F1 on CALL TRANSACTION and test sample code give at the end.

Hope will help you to solve out your problem,

Best Regards,

Faisal

Former Member
0 Kudos

Hi,

You can use ,

AT LINE-SELECTION

Then with, GET CURSOR FIELDNAME

You can use CALL TRANSACTION 'T-CODE NAME' WITH PARAMETERS

Hope it helps

Regards

Mansi