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

Move lraw data to internal table

Former Member
0 Likes
939

I have data for an internal table stored in a 3000 length char field. I need to move this to an internal table that has different type of fileds like CHAR, QUAN ....

What is the best way to do this?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
883

Try to use offset .. in moving the data

loop at itab. "field1 - 3000 length char field

itab1-field1 = itab-field1+0(10).

itab1-field2 = itab-field1+10(10).

itab1-field3 = itab-field1+20(10).

append itab1.

endloop.

I have data for an internal table stored in a 3000 length char field. I need to move this to an internal table that has different type of fileds like CHAR, QUAN ....

What is the best way to do this?

5 REPLIES 5
Read only

Former Member
0 Likes
884

Try to use offset .. in moving the data

loop at itab. "field1 - 3000 length char field

itab1-field1 = itab-field1+0(10).

itab1-field2 = itab-field1+10(10).

itab1-field3 = itab-field1+20(10).

append itab1.

endloop.

Read only

Former Member
0 Likes
883

Hi,

Use offset to move to the internal table. Becareful while moving to Amount, Quantity, Date, Time... fields.

Read only

Former Member
0 Likes
883

hiii

you can do that by using OFFSET only..but while moving check for the data type in which you are trying to move then use that much OFFSET only otherwise it will give you dump.

reward if useful

thx

twinkal

Read only

Former Member
0 Likes
883

Thanks for the help. I could solve it with the code below: -

class CL_ABAP_CONTAINER_UTILITIES definition load.

call method CL_ABAP_CONTAINER_UTILITIES=>READ_CONTAINER_C

exporting IM_CONTAINER = zmqsq-msgdata

importing EX_VALUE = w_znextlnxnq

exceptions ILLEGAL_PARAMETER_TYPE = 1

others = 2.

Read only

0 Likes
883

hello

I have a similar problem but this method does not work for packed decimals. the structure returns some bizzare value. Any ideas that would help?

Thanks!!

Veena