cancel
Showing results for 
Search instead for 
Did you mean: 

Runtime Error : MOVE_TO_LIT_NOTALLOWED_NODATA after ALV execution

former_member184029
Participant
0 Kudos
1,600

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

View Entire Topic
RichHeilman
Developer Advocate
Developer Advocate

We will need to see the coding of your program.

REgards,

Rich Heilman

former_member184029
Participant
0 Kudos

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

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Make sure that SELE is a field in your internal table which is being passed to the ALV function.

ch_alv_layout-box_fieldname  = 'SELE'. <--- you are specifying this as your selectable column, make sure it exists

Regards,

Rich Heilman

former_member184029
Participant
0 Kudos

Thanks, I check and post my comments.

Regards

Tokio

former_member184029
Participant
0 Kudos

Rich

Thank you very much for answering. Problem solve.

Regards

Tokio