при нажатии клаывиши делаються нередактируемые строки в динамической таблице (dyn_table)
Code:
WHEN 'DECLINE_POZITION_OZM'.
PERFORM no_edit_rows.
ENDCASE.
CALL METHOD g_grid2->refresh_table_display.
*&---------------------------------------------------------------------*
*& Form NO_EDIT_ROWS
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
*----------------------------------------------------------------------*
FORM no_edit_rows .
TYPES:
BEGIN OF ts_alv,
matnr TYPE matnr,
style TYPE lvc_t_styl,
END OF ts_alv. " для таблицы it_components
FIELD-SYMBOLS: <fs_otklonenie> TYPE ANY, " переменная для чекбокса ОТКЛОНИТЬ
<fs_style> TYPE ANY, " переменная для STYLE
<fs_note> TYPE ANY. " переменная для ПРИМЕЧАНИЯ
DATA: lt_rows TYPE lvc_t_row,
otkl_tab TYPE REF TO cl_abap_tabledescr, " для таблицы it_components
otkl_struc TYPE REF TO cl_abap_structdescr, " для таблицы it_components
it_components TYPE abap_component_tab, " таблица it_components с названиями столбцов из <dyn_table>
wa_components TYPE abap_componentdescr, " структура таблицы it_components
gs_alv TYPE ts_alv, " для таблицы it_components
ls_stylerow TYPE lvc_s_styl, " для таблицы it_components
index4 TYPE i. " кол-во считанных строк
otkl_tab ?= cl_abap_typedescr=>describe_by_data( <dyn_table> ). " для таблицы it_components
otkl_struc ?= otkl_tab->get_table_line_type( ). " для таблицы it_components
it_components = otkl_struc->get_components( ). " Копирование название столбцов из <dyn_table> в it_components
showsuccess = 'X'.
PERFORM saveozmdata USING showsuccess CHANGING er_check_atr. " Сохранение данных
index4 = 1.
LOOP AT <dyn_table> INTO <dyn_wa>.
ASSIGN COMPONENT 'OTKLONENIE' OF STRUCTURE <dyn_wa> TO <fs_otklonenie>.
ASSIGN COMPONENT 'NOTE' OF STRUCTURE <dyn_wa> TO <fs_note>.
ASSIGN COMPONENT 'STYLE' OF STRUCTURE <dyn_wa> TO <fs_style>.
IF <fs_otklonenie> = 'X'. " Если позиция отмечена
LOOP AT it_components INTO wa_components.
ls_stylerow-fieldname = wa_components-name.
ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled. " нередактируемые строки
INSERT ls_stylerow INTO TABLE gs_alv-style. " вставка их в таблицу gs_alv
ENDLOOP.
<fs_style> = gs_alv-style. " внести изменения в <fs_style>
MODIFY <dyn_table> FROM <dyn_wa> INDEX index4. " изменение <dyn_table>
ENDIF.
index4 = index4 + 1.
ENDLOOP.
All times are GMT + 4 Hours Goto page Previous1, 2
Page 2 of 2
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.