Application Development 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: 

how to assign data to itab from memory

Former Member
0 Kudos

hi,

i have some line items in (SAPMV50A)XLIPS during run time,

may i know how to assign it to an internal table for further processing it?

thanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello,

You can do it like this.

DATA: LV_MEMORY_1(15).
" For exporting the table to Memory
CONCATENATE SY-UNAME SY-MODNO 'XLIPS' INTO LV_MEMORY_1.
EXPORT XLIPS TO MEMORY ID LV_MEMORY_1.

" For importing the table for further usage.
data: xlips like lips occurs 0 with header line.
CONCATENATE SY-UNAME SY-MODNO 'XLIPS' INTO LV_MEMORY_1.
IMPORT XLIPS FROM MEMORY ID LV_MEMORY_1.

Hope this will helps you.

Cheers,

Vasanth M

9 REPLIES 9

Former Member
0 Kudos

Hi

use APPEND stmt

APPEND <WA> TO <ITAB>.

Regards

Winneie

Former Member
0 Kudos

Hello,

You can do it like this.

DATA: LV_MEMORY_1(15).
" For exporting the table to Memory
CONCATENATE SY-UNAME SY-MODNO 'XLIPS' INTO LV_MEMORY_1.
EXPORT XLIPS TO MEMORY ID LV_MEMORY_1.

" For importing the table for further usage.
data: xlips like lips occurs 0 with header line.
CONCATENATE SY-UNAME SY-MODNO 'XLIPS' INTO LV_MEMORY_1.
IMPORT XLIPS FROM MEMORY ID LV_MEMORY_1.

Hope this will helps you.

Cheers,

Vasanth M

0 Kudos

hi Vasanth M,

the table will available only i type (SAPMV50A)XLIPS in the debuggin window. in this case how should i code that in abap program, since it will throw me error if i

put EXPORT (SAPMV50A)XLIPS TO MEMORY ID LV_MEMORY_1.

?

0 Kudos

try using user exit : MV50AFZ1 , in whcih u can export or import data to / from memory , or if u want to modify values in lips tables u can do in this exit .

Hope this solves ur problem.

Regards,

Ramesh

0 Kudos

Hi,

This can be done by Field symbol



  field-symbols <fs_xlips> type standard table.

  data: lt_xlips_t(50) value '(SAPMV50A)XLIPS[]'. 

  assign (lt_xlips_t) to <fs_xlips>.

Now the field symbol <fs_xlips> contains the data of table XLIPS[].

Cheers,

Kothand

0 Kudos

hi Kothand,

i'm have one problem with this, i'm able to get the value through the below

DATA: LOC_FIELD(85) VAlUE '(SAPMV50A)XLIPS',

P_LIPS TYPE LIPS,

FIELD-SYMBOLS: <LOC_FS_LIPS> TYPE ANY.

ASSIGN (LOC_FIELD6) TO <LOC_FS_LIPS>.

P_LIPS = <LOC_FS_LIPS>.

however in the exists, when i access p_lips, it always contain only the last row of the internal table only. no matter how many line items there, and how many times the system loop through the exits based on the count of line items, it will only contain the last line item.

any idea where is going wrong?

thanks.

0 Kudos

Hi,

P_LIPS is a structure as per your declaration Also you have declared field-symbols as any.It should be table form. Try this


DATA: loc_field(85) VALUE '(SAPMV50A)XLIPS',
p_lips TYPE STANDARD TABLE OF lips. "Should be table

FIELD-SYMBOLS: <loc_fs_lips> TYPE STANDARD TABLE. "Should be Table

ASSIGN (loc_field) TO <loc_fs_lips>.

p_lips[] = <loc_fs_lips>[].

Cheers,

Kothand

0 Kudos

thank you Kothand.

Former Member
0 Kudos

For assigning data from memory: first you will have to export that memory and then import it in your program provided that memory name is kept same.