2007 Jan 04 2:05 PM
Hi Abap Programers!
I want to create a editable alv_grid as in the sapmle BCALV_EDIT_04.
To the internal_tabele is added a deep structure, where are stored the RW or RO properties.
At the PAI Module all is well, the deep structure is accesable, visible.
LOOP AT lt_ordbu INTO la_ordbu.
MOVE-CORRESPONDING la_ordbu TO la_outtab_line.
APPEND la_outtab_line TO p_gt_ordbu.
ENDLOOP.
REFRESH la_outtab_line-celltab.
LOOP AT p_gt_ordbu INTO la_outtab_line.
l_index = sy-tabix.
REFRESH lt_celltab.
PERFORM fill_celltab USING 'RO'
CHANGING lt_celltab.
** Copy your celltab to the celltab of the current row of gt_outtab.
INSERT LINES OF lt_celltab FROM l_index TO l_index
INTO TABLE la_outtab_line-celltab.
MODIFY p_gt_ordbu FROM la_outtab_line INDEX l_index.
ENDLOOP.
Then I collected the inserted rows in lt_ins_keys internal tabelle, after a enterter event.
LOOP AT lt_ins_keys INTO l_ins_key.
MOVE-CORRESPONDING l_ins_key TO la_outtab_line.
APPEND la_outtab_line TO gt_ordbu.
ENDLOOP.
LOOP AT lt_ins_keys INTO l_ins_key.
l_index = sy-tabix + records.
REFRESH lt_celltab.
PERFORM fill_celltab USING 'RO'
CHANGING lt_celltab.
READ TABLE gt_ordbu INTO la_outtab_line INDEX l_index.
INSERT LINES OF lt_celltab
INTO TABLE la_outtab_line-celltab.
MODIFY gt_ordbu FROM la_outtab_line INDEX l_index.
ENDLOOP.
At debug, I have yet seen the constance of deep structure (celltab), but after it is empty.
It is very important.
2007 Jan 05 5:21 AM
U can set specific fields editable in the fieldcatalog.
Like,
w_fieldcat-reptext = text-001.
w_fieldcat-fieldname = 'NAME'.
w_fieldcat-tabname = 'I_OUTPUT1'.
w_fieldcat-edit = 'X'.
APPEND w_fieldcat TO i_fieldcat.
Later on the edited field can be handled using the event data_changed.
Hi Abap Programers!
I want to create a editable alv_grid as in the sapmle BCALV_EDIT_04.
To the internal_tabele is added a deep structure, where are stored the RW or RO properties.
At the PAI Module all is well, the deep structure is accesable, visible.
LOOP AT lt_ordbu INTO la_ordbu.
MOVE-CORRESPONDING la_ordbu TO la_outtab_line.
APPEND la_outtab_line TO p_gt_ordbu.
ENDLOOP.
REFRESH la_outtab_line-celltab.
LOOP AT p_gt_ordbu INTO la_outtab_line.
l_index = sy-tabix.
REFRESH lt_celltab.
PERFORM fill_celltab USING 'RO'
CHANGING lt_celltab.
** Copy your celltab to the celltab of the current row of gt_outtab.
INSERT LINES OF lt_celltab FROM l_index TO l_index
INTO TABLE la_outtab_line-celltab.
MODIFY p_gt_ordbu FROM la_outtab_line INDEX l_index.
ENDLOOP.
Then I collected the inserted rows in lt_ins_keys internal tabelle, after a enterter event.
LOOP AT lt_ins_keys INTO l_ins_key.
MOVE-CORRESPONDING l_ins_key TO la_outtab_line.
APPEND la_outtab_line TO gt_ordbu.
ENDLOOP.
LOOP AT lt_ins_keys INTO l_ins_key.
l_index = sy-tabix + records.
REFRESH lt_celltab.
PERFORM fill_celltab USING 'RO'
CHANGING lt_celltab.
READ TABLE gt_ordbu INTO la_outtab_line INDEX l_index.
INSERT LINES OF lt_celltab
INTO TABLE la_outtab_line-celltab.
MODIFY gt_ordbu FROM la_outtab_line INDEX l_index.
ENDLOOP.
At debug, I have yet seen the constance of deep structure (celltab), but after it is empty.
It is very important.
2007 Jan 04 2:33 PM
Hi, Gabor,
check the layout structure.
The field stylefname, must contain your deep structure field.
Ex: s_layout-stylefname = 'CELLTAB'.
Regards
2007 Jan 04 2:49 PM
2007 Jan 04 5:00 PM
Hi,
In the Grid Function Module u have paramter called 'GRID_SETTINGS'. try to under the understand the structure of that paramter thru SE37. A structure is used declare that structure, in that structure u have to set a field 'X'. This enables the editing of the fields in the output.
Regards,
Aravind.
2007 Jan 05 11:38 AM
If I understand it good , it refer to fields just. First of all need this settings to final success, but not enought.
2007 Jan 05 5:05 AM
You can make all the fields as editable by the following
DATA GS_LAYOUT TYPE LVC_S_LAYO.
DATA: gt_fieldcat TYPE lvc_t_fcat.
GS_LAYOUT-EDIT = 'X'.
After this pass this to the
CALL METHOD cc_column->set_table_for_first_display
EXPORTING
is_layout = gs_layout
CHANGING
it_outtab = it_alv
it_fieldcatalog = gt_fieldcat[]
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
ENDIF.
If you want to make editable by field level
make this before calling method the above
gt_fieldcat-edit = 'X'.
APPEND gt_fieldcat .
2007 Jan 05 9:19 AM
Ok.
But i want to make editable just the selected rows. not the fields
2007 Jan 05 5:21 AM
U can set specific fields editable in the fieldcatalog.
Like,
w_fieldcat-reptext = text-001.
w_fieldcat-fieldname = 'NAME'.
w_fieldcat-tabname = 'I_OUTPUT1'.
w_fieldcat-edit = 'X'.
APPEND w_fieldcat TO i_fieldcat.
Later on the edited field can be handled using the event data_changed.
2007 Jan 08 8:54 AM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |