Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

SAPLKKBL Issue MOVE_TO_LIT_NOTALLOWED_NODATA

Former Member
0 Kudos

Hi Experts,

I have some regarding running a custom program. The Custom Program will run until ALV DIsplay but when a specific user prints the ALV List, it will dump an error above MOVE_TO_LIT_NOTALLOWED_NODATA. This is only specific to this user and other users exactly ran the same values and print, they had no problems.

What should be the problem here?

Quote from ST22:

Short text

Error at assignment: Overwritten protected field.

What happened?

Error in the ABAP Application Program

The current ABAP program "SAPLKKBL" had to be terminated because it has

come across a statement that unfortunately cannot be executed.

...

Error analysis

A new value is to be assigned to the field "<L_UNIT>", although this field is

entirely or partly protected against changes.

The following are protected against changes:

- Character literals or numeric literals

- Constants (CONSTANTS)

- Parameters of the category IMPORTING REFERENCE for functions and

methods

- Untyped field symbols not yet assigned a field using ASSIGN

- TABLES parameters if the actual parameter is protected against changes

- USING reference parameters and CHANGING parameters for FORMs, if the

actual parameter is protected against changes and

- Accesses using field symbols if the field assigned using ASSIGN is

protected (or partially protected, e.g. key components of an internal

table with the type SORTED or HASHED TABLE) against changes

- Accesses using references, if the field bound to the reference is

protected (or partially protected) against changes

- External write accesses to READ-ONLY attributes,

- Content of a shared object area instance accessed using a shared lock

(ATTACH_FOR_READ).

How to correct the error

The field to be overwritten is a parameter or a

field symbol:

Declare the parameter as VALUE parameter or transfer a help field, to

which you assigned the constant before, and assign the help field

instead of the constant to the field symbol.

If the error occurred in your own ABAP program or in an SAP

program you modified, try to remove the error.

If the error occures in a non-modified SAP program, you may be able to

find an interim solution in an SAP Note.

If you have access to SAP Notes, carry out a search with the following

keywords:

"MOVE_TO_LIT_NOTALLOWED_NODATA" " "

"SAPLKKBL" or "LKKBLF98"

"SUM_UNIT_OUT_CHECK"

9 REPLIES 9

Former Member
0 Kudos

Hi

Probably something is wrong in your catalog table, you should post how you fill it

Max

0 Kudos

Here is the catalog posting, as I look at it, there's nothing wrong with it:

And the wierd thing is, this issue is only specific to one user, other users do not encounter issue like this in their printing of the same Customer Program in ALV display.


  DATA: ls_fieldcat TYPE slis_fieldcat_alv.
  CLEAR v_pos.

  CLEAR ls_fieldcat.
  v_pos = v_pos + 1.

  ls_fieldcat-col_pos   = v_pos.
  ls_fieldcat-fieldname = 'CNAME'.
  ls_fieldcat-datatype  = 'C'.
  ls_fieldcat-seltext_m = text-008.    "'Customer Name'.
  ls_fieldcat-outputlen = '40'.
  APPEND ls_fieldcat TO lt_fieldcat.

  CLEAR ls_fieldcat.
  v_pos = v_pos + 1.

  ls_fieldcat-col_pos   = v_pos.
  ls_fieldcat-fieldname = 'KUNRG'.
  ls_fieldcat-datatype  = 'C'.
  ls_fieldcat-seltext_m = text-016.    "'Customer Code'.
  ls_fieldcat-outputlen = '11'.
  APPEND ls_fieldcat TO lt_fieldcat.

  CLEAR ls_fieldcat.
  v_pos = v_pos + 1.

  ls_fieldcat-col_pos   = v_pos.
  ls_fieldcat-fieldname = 'KUNAG'.
  ls_fieldcat-datatype  = 'C'.
  ls_fieldcat-seltext_m = text-021.  " 'Ship-to Party'.
  ls_fieldcat-outputlen = '11'.
  APPEND ls_fieldcat TO lt_fieldcat.

  CLEAR ls_fieldcat.
  v_pos = v_pos + 1.

  ls_fieldcat-col_pos   = v_pos.
  ls_fieldcat-fieldname = 'JNAME'.
  ls_fieldcat-datatype  = 'C'.
  ls_fieldcat-seltext_m = text-022.  " 'Ship-to Party Name'.
  ls_fieldcat-outputlen = '40'.
  APPEND ls_fieldcat TO lt_fieldcat.

  CLEAR ls_fieldcat.
  v_pos = v_pos + 1.

  ls_fieldcat-col_pos   = v_pos.
  ls_fieldcat-fieldname = 'VTEXT'.
  ls_fieldcat-datatype  = 'C'.
  ls_fieldcat-seltext_m = text-031.  " 'Ship-to Party Classification'.
  ls_fieldcat-outputlen = '20'.
  APPEND ls_fieldcat TO lt_fieldcat.

  CLEAR ls_fieldcat.
  v_pos = v_pos + 1.

  ls_fieldcat-col_pos   = v_pos.
  ls_fieldcat-fieldname = 'NAMEP'.
  ls_fieldcat-datatype  = 'C'.
  ls_fieldcat-seltext_m = text-027.  " 'Plant'.
  ls_fieldcat-outputlen = '40'.
  APPEND ls_fieldcat TO lt_fieldcat.

  CLEAR ls_fieldcat.
  v_pos = v_pos + 1.

  ls_fieldcat-col_pos   = v_pos.
  ls_fieldcat-fieldname = 'MATNR'.
  ls_fieldcat-datatype  = 'C'.
  ls_fieldcat-seltext_m = text-023.  " 'Part Number'.
  ls_fieldcat-outputlen = '20'.
  APPEND ls_fieldcat TO lt_fieldcat.

  CLEAR ls_fieldcat.
  v_pos = v_pos + 1.

  ls_fieldcat-col_pos   = v_pos.
  ls_fieldcat-fieldname = 'ARKTX'.
  ls_fieldcat-datatype  = 'C'.
  ls_fieldcat-seltext_m = text-024.  " 'Mix Description'.
  ls_fieldcat-outputlen = '35'.
  APPEND ls_fieldcat TO lt_fieldcat.

  CLEAR ls_fieldcat.
  v_pos = v_pos + 1.

  ls_fieldcat-col_pos   = v_pos.
  ls_fieldcat-fieldname = 'FKIMG'.
  ls_fieldcat-datatype  = 'QUAN'.
  ls_fieldcat-seltext_m = text-013.  "'Quantity'.
  ls_fieldcat-outputlen = '18'.
  ls_fieldcat-do_sum    = 'X'.
  APPEND ls_fieldcat TO lt_fieldcat.

  CLEAR ls_fieldcat.
  v_pos = v_pos + 1.

  ls_fieldcat-col_pos    = v_pos.
  ls_fieldcat-fieldname  = 'KBETR'.
  ls_fieldcat-datatype   = 'CURR'.
  ls_fieldcat-cfieldname = 'WAERK'.
  ls_fieldcat-seltext_m  = text-014.  " 'Selling Price'.
  ls_fieldcat-outputlen  = '16'.
  APPEND ls_fieldcat TO lt_fieldcat.

  CLEAR ls_fieldcat.
  v_pos = v_pos + 1.

  ls_fieldcat-col_pos    = v_pos.
  ls_fieldcat-fieldname  = 'AMOUNT'.
  ls_fieldcat-datatype   = 'CURR'.
  ls_fieldcat-cfieldname = 'WAERK'.
  ls_fieldcat-seltext_m  = text-025.  "  'Amount (SGD)'.
  ls_fieldcat-outputlen  = '16'.
  ls_fieldcat-do_sum = 'X'.
  APPEND ls_fieldcat TO lt_fieldcat.

  CLEAR ls_fieldcat.
  v_pos = v_pos + 1.

  ls_fieldcat-col_pos   = v_pos.
  ls_fieldcat-fieldname = 'CHAR1'.
  ls_fieldcat-datatype  = 'C'.
  ls_fieldcat-seltext_m = text-029.  " 'Material Classification'.
  ls_fieldcat-outputlen = '5'.
  APPEND ls_fieldcat TO lt_fieldcat.

  CLEAR ls_fieldcat.
  v_pos = v_pos + 1.

  ls_fieldcat-col_pos   = v_pos.
  ls_fieldcat-fieldname = 'CHAR2'.
  ls_fieldcat-datatype  = 'C'.
  ls_fieldcat-seltext_m = text-030.  " 'Material Grade'.
  ls_fieldcat-outputlen = '5'.
  APPEND ls_fieldcat TO lt_fieldcat.

0 Kudos

Hi

If you use to set DATATYPE field, if the field is a char you should move CHAR, not C

a code like this:

ls_fieldcat-col_pos   = v_pos.
ls_fieldcat-fieldname = 'CNAME'.
*ls_fieldcat-datatype  = 'C'.            "<------
ls_fieldcat-datatype  = 'CHAR'.
ls_fieldcat-seltext_m = text-008.    "'Customer Name'.
ls_fieldcat-outputlen = '40'.
APPEND ls_fieldcat TO lt_fieldcat.

C is the value for internal type, so the correct way to set a field is a char should be

ls_fieldcat-col_pos   = v_pos.
ls_fieldcat-fieldname = 'CNAME'.
ls_fieldcat-datatype  = 'CHAR'.
ls_fieldcat-inttype   = 'C'.
ls_fieldcat-seltext_m = text-008.    "'Customer Name'.
ls_fieldcat-outputlen = '40'.
APPEND ls_fieldcat TO lt_fieldcat.

You should indicate the true lenght of the field, not only output lenght so:

ls_fieldcat-col_pos   = v_pos.
ls_fieldcat-fieldname = 'CNAME'.
ls_fieldcat-datatype  = 'CHAR'.
ls_fieldcat-inttype   = 'C'.   "<-------
ls_fieldcat-seltext_m = text-008.    "'Customer Name'.
ls_fieldcat-outputlen = '40'.
ls_fieldcat-intlen    = 40.    "<-------
APPEND ls_fieldcat TO lt_fieldcat.

But if you want to make sure the ctalog field are filled correctly, you can use a reference of a dictionary field (it's just a little tip)

ls_fieldcat-col_pos   = v_pos.
ls_fieldcat-fieldname = 'CNAME'.
ls_fieldcat-ref_fieldname  = 'NAME1'.
ls_fieldcat-ref_tabname   = 'KNA1'.   
ls_fieldcat-seltext_m = text-008.    "'Customer Name'.
APPEND ls_fieldcat TO lt_fieldcat.

Bur anyway I think the problem is in the amount field:

you have set the field WAERK as reference to the field is the currency is, but you don't insert this field in catalog::

ls_fieldcat-col_pos    = v_pos.
ls_fieldcat-fieldname  = 'KBETR'.
ls_fieldcat-datatype   = 'CURR'.
ls_fieldcat-cfieldname = 'WAERK'.      "<---------- Where is this field?
ls_fieldcat-seltext_m  = text-014.  " 'Selling Price'.
ls_fieldcat-outputlen  = '16'.
APPEND ls_fieldcat TO lt_fieldcat.

I mean the field WAERK is in your output table?

Max

0 Kudos

Thanks Max,

I'll try your suggestion. Oh, the field WAERK is part of the outtab internal table, which is declared but not to be displayed in the ALV. Is there any problem in that?

0 Kudos

Hi

I'm not sure, but it seems you have a problem with a reference field so for amount field or quantity field

Try to investigate

Max

0 Kudos

Hello,

As a rule-of-thumb, whenever you face a runtime error in ALV, try running the [ALV Consistency check|/people/rainer.hbenthal/blog/2009/09/25/sos--my-alv-report-is-not-working].

Try to correct the errors reported(if any) in the consistency check.

BR,

Suhas

0 Kudos

Thanks Suhas,

Very much Appreciated with the info of the Rule of Thumb Consistency Check.

Former Member
0 Kudos

Recommended Solutions and Tips for ALV ouput for Currency Values

Former Member
0 Kudos

Hi,

     I am facing the same issue. Was your issue solved? Please suggest the solution.

Thanks

Hariny S