Code: Alles auswählen.
*-----------------------------------------------------------------------
* Feldkatalog besorgen
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = i_struktur
CHANGING
ct_fieldcat = i_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
RAISE kein_feldkatalog.
ENDIF.
*-----------------------------------------------------------------------
* Reagieren auf Doppelklick
SET HANDLER lcl_event_handler=>on_db_click
FOR ALL INSTANCES.
*-----------------------------------------------------------------------
* Reagieren auf Hotspotklick
SET HANDLER lcl_event_handler=>on_hs_click
FOR ALL INSTANCES.
*-----------------------------------------------------------------------
* ALV_Grid darstellen
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_struktur
* I_BACKGROUND_ID = ' '
* I_GRID_TITLE =
* I_GRID_SETTINGS =
is_layout = i_layout
it_fieldcat = i_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
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* I_HTML_HEIGHT_TOP =
* I_HTML_HEIGHT_END =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = i_values
* EXCEPTIONS
* PROGRAM_ERROR = 1
* OTHERS = 2
.
Code: Alles auswählen.
*&---------------------------------------------------------------------*
*& Class LCL_EVENT_HANDLER
*&---------------------------------------------------------------------*
* Text
*----------------------------------------------------------------------*
CLASS lcl_event_handler DEFINITION.
*------------------*
* PUBLIC SECTION
PUBLIC SECTION.
CLASS-METHODS:
on_db_click
FOR EVENT double_click
OF cl_gui_alv_grid
IMPORTING es_row_no
e_column.
CLASS-METHODS:
on_hs_click
FOR EVENT hotspot_click
OF cl_gui_alv_grid
IMPORTING e_row_id
e_column_id
es_row_no.
*------------------*
* PROTECTED SECTION
PROTECTED SECTION.
*------------------*
* PRIVATE SECTION
PRIVATE SECTION.
ENDCLASS. "LCL_EVENT_HANDLER
*---------------------------------------------------------------------*
* CLASS lcl_event_handler IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS lcl_event_handler IMPLEMENTATION.
METHOD on_db_click.
MESSAGE 'DB-KLICK' TYPE 'S'.
PERFORM double_click USING es_row_no e_column.
ENDMETHOD. "on_db_click
METHOD on_hs_click.
MESSAGE 'HS-KLICK' TYPE 'S'.
ENDMETHOD. "on_hs_click
ENDCLASS. "lcl_event_handler IMPLEMENTATION
Mit Read Table:BesenWesen hat geschrieben:ich habe den gesamten Inhalt meiner Tabelle einem <FS> zugewiesen.
aber wie kann ich den n-ten Eintrag da rauslesen?
Danke babap, genauso hab ich es auch geloest.babap hat geschrieben:Hallo,
oder noch schicker: statt Workarea ein Feldsymbol:
GrußCode: Alles auswählen.
FIELD-SYMBOLS: <wa> TYPE LINE OF table. READ TABLE <fs> ASSIGNING <wa> INDEX 2.
babap