Application Development and Automation 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: 
Read only

Assign dump

Former Member
0 Likes
1,325

Hi,

i try to do assign component like that and i get this dump ,any idea why?

after i doing the assign component commend in the line

<date> = sy-datum.

i get the dump :

field symbols: <date>  type sy-datum.



  ASSIGN is_bound_object TO <ls_object>.
  ASSIGN COMPONENT 'DATE' OF STRUCTURE <ls_obt> TO <date>.
  <date> =  sy-datum.

the error:

The following are protected from change:

- Character literals or numerical literals.

- CONSTANTS.

- Parameters of the category IMPORTING REFERENCE in functions and

methods.

- untyped field symbols, that have not been assigned a field using

ASSIGN.

- TABLES parameters, if the actual parameter is protected against

changes.

- USING reference parameters and CHANGING parameters in FORMs,

if the actual parameter is protected against changes.

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

partly or completely protected (for example key components of in

table of the type SORTED or HASHED TABLE).

Br

Nina

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,266

Can you change it from an IMPORTING parameter to CHANGING?

Rob

12 REPLIES 12
Read only

Former Member
0 Likes
1,266

Hi,

Are you trying to change some importing parameters?

Is the type of field 'DATE' OF STRUCTURE <ls_obt> same as sy-datum?

Regards,

Ankur Parab

Read only

0 Likes
1,266

HI ,

Yes sure i checked it ,it's the same type.

Best Regards

Nina

Read only

Former Member
0 Likes
1,266

Hi Nina ,

Are you tried to change field symbols: <date> type sy-datum to type any ?

Because, <date> may receive any value and not just datum.

OR

Try..

WRITE sy-datum TO <date>.

Regards,

Bruno

Edited by: BrunoLima on Jun 25, 2009 6:16 PM

Edited by: BrunoLima on Jun 25, 2009 6:19 PM

Read only

Former Member
0 Likes
1,266

The dump is very informative. Are you trying to change some parameter? What is is_bound_object? have you checked date is being assigned to the field symbol?

Read only

0 Likes
1,266

HI

when i do :

ASSIGN sy-datum TO <date>.

<date> = sy-datum .

i dont have dump but the structure not updated.

can i do it different ?

Br

Nina

Edited by: Nina C on Jun 25, 2009 6:32 PM

Read only

0 Likes
1,266

It is working because sy-datum can be changed, so there is no problem with the assign.

Your code can present several problems.

First, what is is_bound_object? The dump says it clear, if it is an importing parameter, you can't change it. If you want to change the value of the variable in the calling program, then that's a different story.

Second, the second assign returns sy-subrc = 0? If it doesn't the structure has no 'DATE' component and you are getting the dump because of that

Read only

0 Likes
1,266

HI ,

is_bnd_obj it's parameters that i get in the import ,

and i want to update it why i can to that ?

the Sy-subrc returen 0.

i have mistake when i copy it ,it should be:

ASSIGN is_bnd_obj TO <ls_obt>.

ASSIGN COMPONENT 'DATE' OF STRUCTURE <ls_obt> TO <date>.

<date> = sy-datum.

Best Regards

Nina

Read only

0 Likes
1,266

HI,

If it is an importing parameter it cannot be changed.

Regards,

Ankur Parab

Read only

0 Likes
1,266

HI Ankur ,

There is no way to overcome/Bypass this issue, the thing is in that the import parameter is type any ,i.e. can get any type of structure and i need to modify it.

Best regards

Nina

Edited by: Nina C on Jun 25, 2009 9:15 PM

Read only

Former Member
0 Likes
1,267

Can you change it from an IMPORTING parameter to CHANGING?

Rob

Read only

0 Likes
1,266

HI Rob,

I change it and it working,

U think that this is the only way,to change from import to changing?

Best regards

nina

Read only

0 Likes
1,266

No, you can also define a local variable and copy the IMPORTING parameter to it (so long as you only need this value in this form or FM).

Rob