2014 Dec 02 1:28 PM
Hi,
I am trying to edit the selected rows.I used get_selected_rows method to fetch selected rows.And to make them editable i created a form edit_selected
in that i used cl_gui_alv_grid=>mc_style_enabled. to make them editable.but here i am getting a syntax error "ls_listrow is not a internal table occurs n specifications " . i am not getting my misstake i dified DATA: ls_listrow LIKE LINE OF i_modified , like this here I_modified is a internal table.
can anybody help me with this code.
thanks in advance.
hari.
2014 Dec 02 1:38 PM
In your code I see: "LOOP AT itab INTO i_modified" but i_modified is a table isn't it ?
2014 Dec 02 1:56 PM
yes.Now i made it as inernal table.
i am new to abap .my task is to make selected columns editable
I found some code like this
FORM edit_selected .
DATA ls_listrow LIKE LINE OF i_modified.
DATA: ls_stylerow TYPE lvc_s_styl,
lt_styletab TYPE lvc_t_styl.
" Getting the selected rows index
CALL METHOD o_grid->get_selected_rows
IMPORTING
et_index_rows = i_selected_rows.
" looping selected rows
LOOP AT itab INTO i_modified WHERE id = w_selected_rows-index.
ls_stylerow-fieldname = 'NAME'.
ls_stylerow-style = cl_gui_alv_grid=>mc_style_enabled.
APPEND ls_stylerow TO lt_styletab.
CLEAR ls_stylerow.
ls_stylerow-fieldname = 'MOB'.
ls_stylerow-style = cl_gui_alv_grid=>mc_style_enabled.
APPEND ls_stylerow TO lt_styletab.
CLEAR ls_stylerow.
ls_stylerow-fieldname = 'DEPARTMENT'.
ls_stylerow-style = cl_gui_alv_grid=>mc_style_enabled.
APPEND ls_stylerow TO lt_styletab.
CLEAR ls_stylerow.
INSERT lines of lt_styletab INTO ls_listrow. " here actual code is ls_listrow-cellstyles.
" but i am not finding -cellstyles
MODIFY i_modified FROM lt_styletab.
ENDLOOP.
MODIFY itab FROM TABLE i_modified.
ENDFORM. "edit_selected
here i am getting a error saying that lt_styletab cannot converted to the line type of i_modified.
2014 Dec 02 2:03 PM
Well the error message exactly tell you what is wrong:
INSERT lines of lt_styletab INTO ls_listrow. " here actual code is ls_listrow-cellstyles. " but i am not finding -cellstyles MODIFY i_modified FROM lt_styletab.
2014 Dec 02 2:19 PM
Hi Hari,
You need to add field-cellstyles in ls_listrow structure of type LVC_T_STYL and then MODIFY itab index lv_index FROM ls_listrow transporting cellstyles.
lv_index = sy-tabix.
Note: remove code line MODIFY i_modified FROM lt_styletab.
Regards,
Sudeesh Soni