‎2007 May 10 10:56 PM
Hi experts,
I have created my itab like this..for ALV grid
data: begin of gt_stage occurs 0.
include structure zbitstge.
data: field_style type lvc_t_styl.
data: end of gt_stage.
data: ls_stylerow type lvc_s_styl,
lt_styletab type lvc_t_styl.
iam trying to inserting the styles for fields to modify..
loop at gt_stage.
ls_stylerow-fieldname = 'KOSTL'.
ls_stylerow-style = gv_grid->mc_style_enabled.
append ls_stylerow to gt_stage-field_style.
modify gt_stage.
endloop.
Iam able to inesrt few fields bofre KOSTL. But it comes to KOSTL iam getting following error.
"Error inserting into or changing a sorted table
You tried to insert or change a line at position 4 in the internal
table "\PROGRAM=ZBIPSTGE\DATA=GT_STAGE-FIELD_STYLE" (of the kind SORTED_TABLE).
This violated the sort sequence of the table, which was laid down when
the table was declared. "
What is the meaning of this error? Where iam doing wrong?
reward guraranteed
thanks
kaki
‎2007 May 10 11:01 PM
Hi,
Try this..
loop at gt_stage.
ls_stylerow-fieldname = 'KOSTL'.
ls_stylerow-style = gv_grid->mc_style_enabled.
<b> append ls_stylerow to lt_styletab.
gt_stage-field_style[] = lt_styletab[].</b>
modify gt_stage.
<b> refresh lt_styletab.</b>
endloop.
Thanks,
Naren
‎2007 May 10 11:00 PM
Hi Kaki,
In the case of sorted tables, you have to maintain sort sequence. So you have to insert in the correct sort order. Otherwise try using 'insert' statement instead of append. That might work.
Regards,
Aravind
‎2007 May 10 11:01 PM
Hi,
Try this..
loop at gt_stage.
ls_stylerow-fieldname = 'KOSTL'.
ls_stylerow-style = gv_grid->mc_style_enabled.
<b> append ls_stylerow to lt_styletab.
gt_stage-field_style[] = lt_styletab[].</b>
modify gt_stage.
<b> refresh lt_styletab.</b>
endloop.
Thanks,
Naren
‎2007 May 10 11:05 PM
Hi,
If it is sorted table try this..
loop at gt_stage.
ls_stylerow-fieldname = 'KOSTL'.
ls_stylerow-style = gv_grid->mc_style_enabled.
<b>INSERT ls_stylerow INTO TABLE lt_styletab.</b>
<b>gt_stage-field_style[] = lt_styletab[].</b>
<b>modify gt_stage.
refresh lt_styletab.</b>
endloop.
Thanks,
Naren
‎2007 May 10 11:10 PM
Hi Arvind & Narendra,
I got it with insert statement...
Points alloted to both of u.
Thanks
kaki