cancel
Showing results for 
Search instead for 
Did you mean: 

Moving field data from a structure into a variable

Former Member
0 Kudos

Hi,

I have declared l_lines like this in my program

DATA: l_lines TYPE tline OCCURS 0 WITH HEADER LINE.

tline is a structure.I want to pass the field value of tdline which is present in structure tline into a variable htext_z020.

I have used the move statement like this.

move l_lines-tdline into htext_z020.

In debugging I found that the value of tdline is coming into the structure l_lines.But when i give l_lines-tdline,i am not able to see any value.How can I move the value of tdline into variable htext_z020?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi hema,

I find only one error in ur program. move statement should be like this.

move l_lines-tdline to htext_z020.

Ex.

DATA: l_lines TYPE tline OCCURS 0 WITH HEADER LINE.

data htext_z020 type string.

l_lines-tdline = 'Arun'.

move l_lines-tdline to htext_z020.

write : / htext_z020.

The above program is working fine.

Try out this, if u have any more query in this let me know..

Regards...

Arun.

sangeetha_sk
Participant
0 Kudos

Arun code is correct. One more suggestion. Instead of using MOVE statement, use

htext_z020 = l_lines-tdline .

It will improve the performance.