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 problem...?

Former Member
0 Likes
1,224

Hi all,

I have a following problem with this piece of code:

CLEAR lv_fieldname.

MOVE 'VALUEPART1' TO lv_fieldname.

ASSIGN COMPONENT lv_fieldname OF STRUCTURE ev_targetstruct TO <lf_valuepart>.

<lf_valuepart> = <ls_targetline>+0(240).

CLEAR lv_fieldname.

MOVE 'VALUEPART2' TO lv_fieldname.

ASSIGN COMPONENT lv_fieldname OF STRUCTURE ev_targetstruct TO <lf_valuepart>.

<lf_valuepart> = <ls_targetline>+240(240).

The ev_targetstruct has a following structure:

STRUCTURE TE_STRUC CHAR 30 0

VALUEPART1 VALUEPART CHAR 240 0

VALUEPART2 VALUEPART CHAR 240 0

VALUEPART3 VALUEPART CHAR 240 0

VALUEPART4 VALUEPART CHAR 240 0

The field VALUEPART1 is filled correctly and the value is transfered to the structure ev_targetstruct. But I am having trouble with the VALUEPART2, this field is not filled even though the <lf_valuepart> is filled from <ls_targetline>+240(240). But the value from <lf_valuepart> is not transfered to the structure ev_targetstruct.

Do you have any idea what might be the problem?

Thanks a lot!

Tomas Kraus

12 REPLIES 12
Read only

Former Member
0 Likes
1,196

Hi,

Cud you write the statements where you are passing the values of fieldsymbols to the structure

Read only

0 Likes
1,196

Hi,

there are no such statements, the above coding is all there is. The VALUEPART1 is filled and transfered to the structure but in the next step the VALUEPART2 is not passed to the structure.

Thanks for help.

Tomas

Read only

0 Likes
1,196

Maybe try to use a new <lf_valuepart2> in the second case 😃

Read only

Former Member
0 Likes
1,196

Hi,

Check the statement for <lf_valuepart> = <ls_targetline>+240(240).

and also the declaration for VALUEPART2.

Read only

Former Member
0 Likes
1,196

also let us show the declaration for <lf_valuepart>??, is its length greater than 480?

Read only

0 Likes
1,196

The <lf_valuepart> is defined as VALUEPART2:

MOVE 'VALUEPART2' TO lv_fieldname.

ASSIGN COMPONENT lv_fieldname OF STRUCTURE ev_targetstruct TO <lf_valuepart>.

<lf_valuepart> = <ls_targetline>+240(240).

ie. <lf_valuepart> length is 240

Read only

0 Likes
1,196

CLEAR lv_fieldname.

MOVE 'VALUEPART1' TO lv_fieldname.

ASSIGN COMPONENT lv_fieldname OF STRUCTURE ev_targetstruct TO <lf_valuepart>.

<b><lf_valuepart> = <ls_targetline>+0(240).</b>

CLEAR lv_fieldname.

MOVE 'VALUEPART2' TO lv_fieldname.

ASSIGN COMPONENT lv_fieldname OF STRUCTURE ev_targetstruct TO <lf_valuepart>.

<b><lf_valuepart> = <ls_targetline>+240(240).</b>

You say that ]<lf_valuepart> is only 240 , but you are assigning it a length of 480,

so is the dump , change the second bold line to this , declare another variable <lf_valuepart1>

<b><lf_valuepart1></b> = <ls_targetline>+240(240).

Read only

0 Likes
1,196

the value is stored but probably not visible due to some length problem.

or are usure <ls_targetline>+240(240) is not blank?

Read only

0 Likes
1,196

Hi,

the <ls_targetline>+240(240) is not empty, the <lf_valuepart> is filled - there is no short dump, but it is not transfered to the ev_targetstruct whereas in the first step it is transfered to the structure....that's what puzzles me....

Read only

0 Likes
1,196

u say <lf_valuepart> length is 240 and u want to fill that with length of 480 , how is that possible?????

Read only

0 Likes
1,196

I will try your suggestion and let you know.

Thank you.

Read only

0 Likes
1,196

Hi,

it doesn't work either. Thanks for your suggestion...

Tomas