Skip to Content
0
Former Member
Nov 19, 2008 at 02:14 PM

alv's double_click event problem

16 Views

i couldnt trigger the double_click event,if any experts can correct this blow code based on mine,thx in advance,please tell me how put the parameters of function

'CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

REPORT zexercise_kevin.

TYPE-POOLS:slis.

DATA: wa_alv_field TYPE slis_fieldcat_alv.

DATA: wa_alv_fieldcat TYPE slis_t_fieldcat_alv.

TYPES: BEGIN OF linetype ,

cityfrom LIKE spfli-cityfrom,

cityto LIKE spfli-cityto,

carrid LIKE spfli-carrid,

connid LIKE spfli-connid,

countryfr LIKE spfli-countryfr,

countryto LIKE spfli-countryto,

fldate LIKE sflight-fldate,

price LIKE sflight-price,

currency LIKE sflight-currency,

seatsmax LIKE sflight-seatsmax,

seatsocc LIKE sflight-seatsocc,

END OF linetype .

DATA: it_flights TYPE STANDARD TABLE OF linetype,

wa_flights TYPE linetype .

SELECT * UP TO 10 ROWS

FROM spfli INNER JOIN sflight ON

spflicarrid = sflightcarrid AND

spfliconnid = sflightconnid

INTO CORRESPONDING FIELDS OF TABLE IT_FLIGHTS

.

***set column

wa_alv_field-col_pos = 1.

wa_alv_field-fieldname = 'CARRID'.

wa_alv_field-seltext_m = 'CARRID'.

APPEND wa_alv_field TO wa_alv_fieldcat .

wa_alv_field-col_pos = 2.

wa_alv_field-fieldname = 'CONNID'.

wa_alv_field-seltext_m = 'CONNID'.

APPEND wa_alv_field TO wa_alv_fieldcat .

wa_alv_field-col_pos = 3.

wa_alv_field-fieldname = 'CITYFROM'.

wa_alv_field-seltext_m = 'CITYFROM'.

APPEND wa_alv_field TO wa_alv_fieldcat .

wa_alv_field-col_pos = 4.

wa_alv_field-fieldname = 'CITYTO'.

wa_alv_field-seltext_m = 'CITYTO'.

APPEND wa_alv_field TO wa_alv_fieldcat .

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

  • I_CALLBACK_PROGRAM = ''

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ''

  • I_CALLBACK_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME = ''

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

  • IS_LAYOUT =

it_fieldcat = wa_alv_fieldcat

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • IT_EVENTS =

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • I_HTML_HEIGHT_TOP = 0

  • I_HTML_HEIGHT_END = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • IR_SALV_FULLSCREEN_ADAPTER =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

t_outtab = it_flights

  • 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.

CLASS lcl_event_receiver DEFINITION DEFERRED.

  • DATA event_receiver TYPE REF TO lcl_event_receiver.

CLASS lcl_event_receiver DEFINITION.

PUBLIC SECTION.

METHODS:

handle_double_click

FOR EVENT DOUBLE_CLICK OF cl_gui_alv_grid

IMPORTING E_ROW E_COLUMN.

ENDCLASS. "lcl_event_receiver DEFINITION

CLASS lcl_event_receiver IMPLEMENTATION.

METHOD handle_double_click.

  • DATA: li_linetype LIKE LINE OF it_flights.

  • READ TABLE it_flights INDEX e_row-index INTO li_linetype.

WRITE:/ 'ddd'.

MESSAGE e111(ymess).

ENDMETHOD. "handle_double_click

ENDCLASS. "lcl_event_receiver IMPLEMENTATION