on 2008 May 21 9:06 PM
Hi experts
I'm facing this runtime error after execute an interface and show an ALV grid for data processed.
ShrtText
Assignment error: Overwriting a protected field.
What happened?
Error in ABAP application program.
The current ABAP program "SAPLSLVC_FULLSCREEN" had to be terminated because one
of the
statements could not be executed.
Error analysis
The program tried to assign a new value to the field "<L_BOX>" even though
it is protected against changes.
The following objects are protected:
- Character or numeric literals
- Constants (CONSTANTS)
- Parameters of the category IMPORTING REFERENCE for functions
and methods
- Untyped field symbols to which a field has not yet been assigned
using ASSIGN
- TABLES parameters if the corresponding actual parameter is protected
against changes
- USING reference parameters and CHANGING parameters for FORMs if
the actual parameter for this is protected against changes
- Field symbols if the field assigned using ASSIGN or ASSIGNING
is protected against changes
- External write accesses to READ-ONLY attributes
- Key components of lines in internal tables of the type HASHED or
SORTED TABLE
SORTED TABLE.
What I must check on ABAP code for fix it.
Thanks in advance.
Tokio
Request clarification before answering.
We will need to see the coding of your program.
REgards,
Rich Heilman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for answering.
This is my code
DATA: v_nametab(20) TYPE c.
v_nametab = p_nametab.
ch_alv_layout-zebra = 'X'.
ch_alv_layout-box_fieldname = 'SELE'.
ch_alv_layout-box_tabname = v_nametab.
ch_alv_layout-reprep = 'X'.
ch_alv_layout-info_fieldname = 'COLOR'. "infofield for listoutput
ch_alv_layout-colwidth_optimize = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
is_layout = ch_alv_layout
it_fieldcat = ch_alv_fieldcat
it_sort = ch_alv_sortinfo
i_save = 'X'
it_events = ch_slis_event
TABLES
t_outtab = p_control
EXCEPTIONS
program_error = 1
OTHERS = 2.
Information on where terminated
The termination occurred in the ABAP program "SAPLSLVC_FULLSCREEN" in
"MARKS_SAVE".
The main program was "Z963370 ".
The termination occurred in line 686 of the source code of the (Include)
program "LSLVC_FULLSCREENF02"
of the source code of program "LSLVC_FULLSCREENF02" (when calling the editor
6860).
Source Code Extract ( standard prog)
Line SourceCde
656 if not gt_grid-s_layout-box_fieldname is initial.
657 call method gt_grid-grid->get_selected_rows
658 importing
659 et_index_rows = lt_rows.
660 delete lt_rows where rowtype ne ' '.
661 sort lt_rows by index.
662 assign component gt_grid-s_layout-box_fieldname
663 of structu
664 to <l_box>.
665 data: l_sel_lines type i.
666 data: l_tab_lines type i.
667 data: ls_rows type lvc_s_row.
668 * check
669 if r_ucomm = '&SAL' or r_ucomm = '&ALL'.
670 l_ucomm = r_ucomm.
671 else.
672 describe table lt_rows lines l_sel_lines.
673 describe table t_outtab lines l_tab_lines.
674 if l_sel_lines = 0.
675 l_ucomm = '&SAL'.
676 endif.
677 if l_sel_lines = l_tab_lines.
678 l_ucomm = '&ALL'.
679 endif.
680 endif.
681 * set/unset <box> of all items
682 if l_ucomm eq '&SAL' or l_ucomm eq '&ALL'.
683 if l_ucomm eq '&SAL'.
684 loop at t_outtab.
685 l_tabix = l_tabix + 1.
<l_box> = ' '. *" Error line*
687 modify t_outtab index l_tabix.
688 endloop.
689 endif.
690 if l_ucomm eq '&ALL'.
691 loop at t_outtab.
692 l_tabix = l_tabix + 1.
693 <l_box> = 'X'.
694 modify t_outtab index l_tabix.
695 endloop.
696 endif.
697 else.
698 *delete all existing marks of <box>
699 loop at t_outtab.
700 l_tabix = l_tabix + 1.
701 <l_box> = ' '.
702 modify t_outtab index l_tabix.
703 endloop.
704 *insert new marks in <box>
705 loop at lt_rows into ls_rows.
Regards
Tokio
User | Count |
---|---|
72 | |
30 | |
8 | |
7 | |
6 | |
6 | |
6 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.