5. Значения в нашем техническом поле можно менять в ходе выполнения программы, не забывая делать после этого REFRESH_TABLE_DISPLAY. Тем самым полностью регулируется возможность ввода в конкретные ячейки грида.
U can do that using ABAP OBJECTS, chk program BCALV_EDIT_05
If we use the checkbox field concept, by using the layout-box_fieldname concept, then we can do what u require.
we have to set the field in internal table (for checkbox purpose)
= 1 (checkbox is CHECKED and disabled)
= X (checkbox is CHECKED and enabled)
= blank (for unchecked and enabled)
= 0 (checkbox is unchecked and disabled)
Code:
REPORT z_checkbox.
TYPE-POOLS : slis.
* Data
DATA : BEGIN OF itab OCCURS 0.
INCLUDE STRUCTURE t001.
DATA : flag tyPE c,
END OF itab.
DATA : alvfc TYPE slis_t_fieldcat_alv.
DATA : alvly TYPE slis_layout_alv.
* Select Data
SELECT * FROM t001 INTO TABLE itab.
LOOP AT ITAB.
IF SY-TABIX = 1.
ITAB-FLAG = '1'.
MODIFY ITAB.
ENDIF.
IF SY-TABIX = 2.
ITAB-FLAG = 'X'.
MODIFY ITAB.
ENDIF.
*-------------------------------------------------
CALL BACK FORM
*-------------------------------------------------
FORM itab_user_command
USING whatcomm TYPE sy-ucomm
whatrow TYPE slis_selfield.
DATA: msg(100) type c.
LOOP AT itab.
IF itab-flag = 'X'.
msg = sy-tabix.
condense msg.
concatenate 'Row Number ' msg ' ' into msg
separated by space.
message msg type 'I'.
ENDIF.
ENDLOOP.
Age: 170 Joined: 04 Oct 2007 Posts: 1218 Location: Санкт-Петербург
Posted: Thu Jan 31, 2008 11:28 pm Post subject:
Внутри REUSE_ALV_GRID_DISPLAY grid все равно объектный. С помощью FM 'GET_GLOBALS_FROM_SLVC_FULLSCR'
можно получить ссылку на объект грида и управлять checkbox.
Внутри REUSE_ALV_GRID_DISPLAY grid все равно объектный. С помощью FM 'GET_GLOBALS_FROM_SLVC_FULLSCR'
можно получить ссылку на объект грида и управлять checkbox.
Age: 170 Joined: 04 Oct 2007 Posts: 1218 Location: Санкт-Петербург
Posted: Fri Feb 01, 2008 1:22 pm Post subject:
Code:
REPORT z_checkbox_disable.
DATA: l_f_repid LIKE sy-repid.
DATA: l_t_fieldcat TYPE lvc_t_fcat,
l_r_fieldcat TYPE lvc_s_fcat.
CLASS cl_gui_alv_grid DEFINITION LOAD.
DATA: BEGIN OF itab OCCURS 0,
cb,
f1,
f2(10),
style TYPE lvc_t_styl,
END OF itab.
DATA: ls_style TYPE lvc_s_styl.
DATA: ls_layo TYPE lvc_s_layo.
ls_layo-stylefname = 'STYLE'.
Age: 46 Joined: 05 Nov 2007 Posts: 725 Location: КраснАдар
Posted: Tue May 13, 2008 9:40 pm Post subject:
to wax - А это собственно ответ - 4 поста выше :
vga wrote:
Внутри REUSE_ALV_GRID_DISPLAY grid все равно объектный. С помощью FM 'GET_GLOBALS_FROM_SLVC_FULLSCR'
можно получить ссылку на объект грида и управлять checkbox.
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.