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: 

Error at assignment: Overwritten protected field - On change of tables para

Former Member
0 Kudos

Hey Folks,

Has anyone faced this error ?

Error Source

The short text of the error states "Error at assignment: Overwritten protected field"

I have a function module which has tables parameter of type BAPIRET2. During runtime I am appending a structure of the same type to the table.

At this juncture I am getting this error in runtime.

Error Analysis

On checking the error analysis in ST22, I see that apparently the system detected ' A new value is to be assigned to the field "T_RETURN[]", although this field is entirely or partly protected against changes.'

Among the fields that are protected as described in the error analysis, its mentioned that

"- TABLES parameters if the actual parameter is protected against changes:

However, I dont seem to understand how it is not possible to be able to change the value of the any TABLES parameter defined.

Besides I have written the same code many times earlier and even now, but somehow it just dumps in this code when I am trying to append the error message (BAPIRET2) to my table. Nothign seems to be different in my current coding when compared to the other Function Modules that are working.

Please let me know if someone has faced a similar problem earlier.

Thanks and Best Regards,

Puja

1 REPLY 1

Former Member
0 Kudos

Eeek, My bad

The source of error was not in the function module whcih had the Tables parameter, but the calling function module.(I was actually trying to feed an importing parameter from calling function module A to the tables parameter in called function module B)

I have a importing parameter T1, which is a type, table type, in function module A. A call to the function module B is being done in A. The actual parameter T1 was being passed to the tables parameter T2(formal parameter) in function module B.

The value of B was being evaluated appropriately. However, when the importing parameter T1 was being modified (since it was passed in the tables parameter), the exception was being thrown.

So the reason was not that the table parameter T2 was being overritten, but the parameter T1(which is actually an importing paramtere in A) which was being modified.