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

Checkbox in Reuse Alv Grid



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ALV Grid / ALV Tree / ALV List
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1636

PostPosted: Fri Oct 26, 2007 6:20 pm    Post subject: Checkbox in Reuse Alv Grid Reply with quote

Code:
REPORT ychatest.

TABLES : sflight.
TYPE-POOLS: slis.

DATA : w_repid LIKE sy-repid.

w_repid = sy-repid.

DATA: BEGIN OF it_sflight OCCURS 0,
  checkbox(1),
  carrid LIKE sflight-carrid,
END OF it_sflight.
*layout

DATA: wa_layout TYPE slis_layout_alv.

*field catalog
DATA: it_fieldcatalog TYPE slis_t_fieldcat_alv,
          wa_fieldcatalog TYPE slis_fieldcat_alv.

START-OF-SELECTION.
  SELECT carrid FROM sflight
     INTO CORRESPONDING FIELDS OF TABLE it_sflight.

END-OF-SELECTION.
  CLEAR it_fieldcatalog.
  REFRESH it_fieldcatalog.

  wa_fieldcatalog-fieldname = 'CHECKBOX'.
  wa_fieldcatalog-outputlen = '3'.
  wa_fieldcatalog-col_pos = '1'.
  wa_fieldcatalog-seltext_m = 'Chk'.
  wa_fieldcatalog-checkbox = 'X'.
  wa_fieldcatalog-edit = 'X'.
  APPEND wa_fieldcatalog TO it_fieldcatalog.
  CLEAR wa_fieldcatalog.

  wa_fieldcatalog-fieldname = 'CARRID'.
  wa_fieldcatalog-outputlen = '10'.
  wa_fieldcatalog-col_pos = '2'.
  wa_fieldcatalog-seltext_m = 'Carrid'.
  APPEND wa_fieldcatalog TO it_fieldcatalog.
  CLEAR wa_fieldcatalog.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program = w_repid
      is_layout = wa_layout
      i_callback_user_command = 'USER_COMMAND'
      it_fieldcat = it_fieldcatalog
    TABLES
      t_outtab = it_sflight
    EXCEPTIONS
      program_error = 1
      OTHERS = 2.

*&---------------------------------------------------------------------
*& Form USER_COMMAND
*&---------------------------------------------------------------------
FORM user_command USING p_ucomm TYPE sy-ucomm

  p_selfld TYPE slis_selfield.

  CASE p_ucomm.
   WHEN '&DATA_SAVE'.
      DATA ref1 TYPE REF TO cl_gui_alv_grid.
      CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
         IMPORTING
           e_grid = ref1.
      CALL METHOD ref1->check_changed_data.
      LOOP AT it_sflight WHERE checkbox = 'X'.
         DELETE it_sflight INDEX sy-tabix.
      ENDLOOP.
      p_selfld-refresh = 'X'.
  ENDCASE.
ENDFORM. "user_command
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 -> ALV Grid / ALV Tree / ALV List 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.