Posted: Thu Nov 24, 2011 12:57 pm Post subject: ALVGRID event of user one click on cell Как сделать?
Добрый день !
Подскажите плиз как словить event, когда пользователь кликает только одни раз по строке грида, double click не подходит! использую REUSE_ALV_GRID_DISPLAY_LVC.
Задача стоит так: есть колонка в виде сheck-box и колонка traffic-light, вот если пользователь изменил сheck-box - поставил галочку или убрал, соответственно traffic-light тоже изменяется.
Age: 46 Joined: 05 Nov 2007 Posts: 725 Location: КраснАдар
Posted: Thu Nov 24, 2011 2:55 pm Post subject:
В этой теме REUSE & F4 разбиралась регистрация события по F4. Я думаю, что если заменить на событие DATA_CHANGED, то можно попробовать в нем одиночный клик эммулировать.
Code:
TYPE-POOLS: slis.
CLASS lcl_events DEFINITION DEFERRED.
*----------------------------------------------------------------------*
* CLASS lcl_events DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_events DEFINITION.
PUBLIC SECTION.
METHODS:
data_changed FOR EVENT data_changed OF cl_gui_alv_grid
IMPORTING er_data_changed
e_onf4
e_onf4_before
e_onf4_after
e_ucomm.
ENDCLASS. "lcl_events DEFINITION
*----------------------------------------------------------------------*
* CLASS lcl_events IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_events IMPLEMENTATION.
METHOD data_changed.
BREAK-POINT.
ENDMETHOD. "data_changed
ENDCLASS. "lcl_events IMPLEMENTATION
DATA: itab TYPE TABLE OF spfli,
events TYPE slis_t_event,
event TYPE slis_alv_event,
gr_events TYPE REF TO lcl_events.
DATA: fcat TYPE lvc_t_fcat,
hcat TYPE lvc_s_fcat,
glay TYPE lvc_s_glay.
START-OF-SELECTION.
SELECT * FROM spfli INTO TABLE itab.
*&---------------------------------------------------------------------*
*& Form caller_exit
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM caller_exit USING data.
DATA: grid TYPE REF TO cl_gui_alv_grid,
tab_f4 TYPE lvc_t_f4,
wa_f4 TYPE lvc_s_f4.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = grid.
CREATE OBJECT gr_events.
SET HANDLER gr_events->data_changed
FOR grid.
Age: 46 Joined: 05 Nov 2007 Posts: 725 Location: КраснАдар
Posted: Thu Nov 24, 2011 3:14 pm Post subject:
Как оказалось можно еще проще.
Code:
TYPE-POOLS: slis.
DATA: itab TYPE TABLE OF spfli,
events TYPE slis_t_event,
event TYPE slis_alv_event.
DATA: fcat TYPE lvc_t_fcat,
hcat TYPE lvc_s_fcat,
glay TYPE lvc_s_glay.
START-OF-SELECTION.
SELECT * FROM spfli INTO TABLE itab.
*&---------------------------------------------------------------------*
*& Form data_changed
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM data_changed USING changed.
BREAK-POINT.
ENDFORM. "data_changed
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.