SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

reuse & F4



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP
View previous topic :: View next topic  
Author Message
Igor_34_rus
Специалист
Специалист



Joined: 08 Apr 2009
Posts: 75

PostPosted: Thu Sep 22, 2011 2:51 pm    Post subject: reuse & F4 Reply with quote

Добрый день!
подскажите как можно перехватить f4 в reuse?


вообще задача:
Из строки ALV-reuse взять три поля и через memory id передать значения в средство поиска(которое запускается сейчас).
Back to top
View user's profile Send private message
John Doe
Модератор
Модератор


Age: 46
Joined: 05 Nov 2007
Posts: 725
Location: КраснАдар

PostPosted: Fri Sep 23, 2011 11:13 am    Post subject: Reply with quote

Есть ощущение, что в reuse никак - ничего подходящего в событиях SLIS не находится.
Если нет желания все перересовывать на ООП, то как вариант - получить инстанцию грида через GET_GLOBALS_FROM_SLVC_FULLSCR и по ней уже отлавливать ONF4.
Code:
TYPE-POOLS: slis.

CLASS lcl_events DEFINITION DEFERRED.
CLASS lcl_events DEFINITION.
  PUBLIC SECTION.
    METHODS:
    onf4                 FOR EVENT onf4
                         OF cl_gui_alv_grid
                         IMPORTING e_fieldname
                                   e_fieldvalue
                                   es_row_no
                                   er_event_data
                                   et_bad_cells
                                   e_display.

ENDCLASS.                    "lcl_events DEFINITION

CLASS lcl_events IMPLEMENTATION.
  METHOD onf4.
    BREAK-POINT.
  ENDMETHOD.                                                "onf4
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.

START-OF-SELECTION.
  SELECT * FROM spfli INTO TABLE itab.

END-OF-SELECTION.
  event-name = 'CALLER_EXIT'.
  event-form = 'CALLER_EXIT'.
  APPEND event TO events.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
    EXPORTING
      i_callback_program = sy-cprog
      i_structure_name   = 'SPFLI'
      it_events          = events
    TABLES
      t_outtab           = 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.

  wa_f4-fieldname = 'CARRID'.
  wa_f4-register = 'X'.
  wa_f4-getbefore = 'X'.
  wa_f4-chngeafter = 'X'.
  APPEND wa_f4 TO tab_f4.

  CALL METHOD grid->register_f4_for_fields
    EXPORTING
      it_f4 = tab_f4.

  CREATE OBJECT gr_events.
  SET HANDLER gr_events->onf4
              FOR grid.

ENDFORM.                    "caller_exit

_________________
FunCoding.ru
KicksCollector.ru
Back to top
View user's profile Send private message Blog
Igor_34_rus
Специалист
Специалист



Joined: 08 Apr 2009
Posts: 75

PostPosted: Fri Sep 23, 2011 3:26 pm    Post subject: Reply with quote

спасибо!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
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.