06-05-2009 7:13 AM
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.
06-05-2009 7:15 AM
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
06-05-2009 7:15 AM
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
06-05-2009 7:21 AM
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.
06-05-2009 8:13 AM
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.
06-05-2009 7:22 AM
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
06-05-2009 8:21 AM
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