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: 

Assignment error: Overwriting a protected field.

Former Member
0 Kudos

Hi,

I'm having an error message when the program dumps: Assignment error: Overwriting a protected field.

And it is pointed in this code:

012370 DATA:

012380 up_field(20),

012390 up_xavis LIKE zdtam100-xavis_req.

012400

012410 up_xavis = zdtam100-xavis_req.

012420 CLEAR zdtam100.

012430 zdtam100-xavis_req = up_xavis.

012440 up_field = 'DTAM100-'.

012450 LOOP AT nametab.

012460 CHECK nametab-fieldname NE 'XAVIS_REQ'.

012470 CHECK nametab-fieldname NE 'XCRLF_SUPP'.

012480 CHECK nametab-fieldname NE 'XCHAR_NREP'.

012490 up_field+8 = nametab-fieldname.

012500 ASSIGN (up_field) TO <up_field>.

012510 CLEAR dta_mt100.

012520 dta_mt100-tag = nametab-fieldname.

012530 READ TABLE dta_mt100.

> <up_field> = dta_mt100-value.

012550 ENDLOOP.

Can somebody tell me on what to do?

Help will be rewarded.

Thanks in advance!

4 REPLIES 4

Former Member
0 Kudos

Hi!

That field is protected in some way. This could be, if it is an IMPORTING parameter of a function call, or a PERFORM.

Or it is a constant maybe.

Regards

Tamá

Former Member
0 Kudos

My guess is u are accessing wrong field with help of field symbol. Check using debug what is the value of the field 'DTAM100-xxx' append the xxx part with the actual field name.

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

I hope <up_field> is a field-symbol and since because you are trying to assign a value directly you are getting this error.

<up_field> = dta_mt100-value.

0 Kudos

if your field test "DTAM100-xxx" is part of the key, and if so does not allow you to dynamically assign values or primary key.