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

Copy string caracters to structure

Former Member
0 Likes
732

Hi all,

in SAP 4.6 i could write this :

"----


DATA : l_data(500).

DATA : BEGIN OF gs_part,

pernr TYPE persno,

atext TYPE anrex,

nachn TYPE nachn,

vorna TYPE vorna,

serv(33) TYPE c,

ccua(8) TYPE c,

stras(38) TYPE c,

...

END OF gs_part.

MOVE l_data TO gs_part.

"----


Now in ECC 6 i can't do that, so how can i change the MOVE code ?

Thanks a lot for your help.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
669

Hi,

Check this method CL_ABAP_CONTAINER_UTILITIES=>READ_CONTAINER_C

call method CL_ABAP_CONTAINER_UTILITIES=>READ_CONTAINER_C
      exporting  IM_CONTAINER           = <DATA>
      importing  EX_VALUE               = <Structure>
      exceptions others                 = 0.

4 REPLIES 4
Read only

Former Member
0 Likes
669

Hi,

You will have to make use of length and offset or use concatenate statement with offset.

The reason why it is not allowed is because of unicode.

Regards,

Ankur Parab

Read only

naveen_inuganti2
Active Contributor
0 Likes
669

Hi..,

You can do it....

What ever the value there in first variable or structure will be moved to first component of target strusture.

If you have any queries on this... Let us know exactly your sourse and target...

Thanks,

Naveen Inuganti.

Read only

Former Member
0 Likes
670

Hi,

Check this method CL_ABAP_CONTAINER_UTILITIES=>READ_CONTAINER_C

call method CL_ABAP_CONTAINER_UTILITIES=>READ_CONTAINER_C
      exporting  IM_CONTAINER           = <DATA>
      importing  EX_VALUE               = <Structure>
      exceptions others                 = 0.

Read only

0 Likes
669

Thanks a lot Avinash.