report z_barry_export_import .
data: begin of itab1 occurs 0 ,
ff(10) ,
end of itab1.
data: itab2 like itab1 occurs 0 with header line .
data: str1 type string ,
str2 type string .
append '111111111' to itab1.
append '222222222' to itab1.
str1 = 'sssssssssss'.
***如果是同名的对象,可以这么写:
*free memory id 'M1'."清空ID为M1的内存区域
*free memory."清空整个ABAP memory
export itab1 to memory id 'M1'."ID 值最长为32位
free itab1.
import itab1 from memory id 'M1'.
loop at itab1.
write / itab1-ff.
endloop.
***如果不是同名的对象,需要加上一个对象名
export a = itab1 b = str1 to memory id 'M2'.
import a = itab2 b = str2 from memory id 'M2'.
loop at itab2.
write / itab2-ff.
endloop.
write / str2.
*Q:多个用户同时执行一个程序 export,
*那多个用户同时在取的时候不是就乱了?
*想知道export的有效性。
*
*A:每个登录用户都有自己的内存空间,不会乱套的
*建议你看看关于ABAP memory 和SAP memory概念的东西
评论