SAP和ABAP内存的区别

1、读取哈使用方法不同
SAP内存使用SET/GET parameters方法;
ABAP内存使用 EXPORT 和 IMPORT  方法;
2、共享范围不同
SAP内存可以被所有的主session访问,内存数据可以同一个session中不同程序之间,或者不同session之间;
ABAP只能在同个session的不同程序之间共享数据;
3、作用范围不同
SAP内存在整个终端session时间内都有效;
ABAP内存只能在一个session时间内有效;
4、使用一般原则
SAP内存用于屏幕默认值输入;
abap内存用于模块之间传替数据
http://space.itpub.net/7762936/viewspace-543122
(一)         Difference Between SAP and ABAP Memory  
(1)、读取和使用方法不同
SAP内存使用SET/GET parameters方法;
SET PARAMETER ID 'MAT' field p_matnr.
GET PARAMETER ID 'MAT' field p_matnr.

ABAP内存使用EXPORT IMPORT  方法;
export p_matnr = p_matnr to memory id 'ZTESTMAT'.
import p_matnr = p_matnr from memory id 'ZTESTMAT'
(2)、共享范围不同
SAP内存可以被所有的主session访问,内存数据可以在同一个session中不同程序之间,或者不同session之间共享数据;
ABAP内存只能在同个session的不同程序之间共享数据;
(3)、作用范围不同
SAP内存在整个终端session时间内都有效;
ABAP内存只能在一个session时间内有效;
(4)、使用一般原则
SAP内存用于屏幕默认值输入;
ABAP内存用于模块之间传替数据
Can any one tell me what is the difference between ABAP Memory and SAP Memory?
Answers 1:-
Within a main session, when ever you start an application program, it opens up an internal sessions with in the main session. The internal session has a memory area that contains the ABAP program and its associated data.  So when ever you want to  pass data between two internal sessions, then you can use ABAP Memory (i.e import, export).
When comes to SAP memory (also known as global memory), if the data has to be passed b/w two main sessions, we can use SAP Memory(SPA/GPA Parameters).  SAP Memory can also be used to pass data b/w internal sessions.
Neelima
Answers 2:-
SAP Memory
SAP memory is a memory area to which all main sessions within a SAPgui have access. You can use SAP memory either to pass data from one program to another within a session, or to pass data from one session to another.  Application programs that use SAP memory must do so using SPA/GPA parameters (also known as SET/GET parameters). These parameters can be set either for a particular user or for a particular program using the SET PARAMETER statement. Other ABAP programs can then retrieve the set parameters using the GET PARAMETER statement. The most frequent use of SPA/GPA parameters is to fill input fields on screens
ABAP/4 Memory
ABAP memory is a memory area that all ABAP programs within the same internal session can access using the EXPORT and IMPORT statements. Data within this area remains intact during a whole sequence of program calls. To pass data
to a program which you are calling, the data needs to be placed in ABAP memory before the call is made. The internal session of the called program then replaces that of the calling program. The program called can then read from the ABAP memory. If control is then returned to the program which made the initial call, the same process operates in reverse.
SAP memory 
The SAP memory, otherwise known as the global memory, is available to a user during the entire duration of a terminal session. Its contents are retained across transaction boundaries as well as external and internal sessions. The SET PARAMETER and GET PARAMETER statements allow you to write to, or read from, the SAP memory. 
ABAP/4 memory 
The contents of the ABAP/4 memory are retained only during the lifetime of an external session (see also Organization of Modularization Units). You can retain or pass data across internal sessions. The EXPORT TO MEMORY and IMPORT FROM MEMORY statements allow you to write data to, or read data from, the ABAP memory. 
(二)         Passing data from one ABAP program to another
1. You have to define an internal table ITAB in program AAA. 
2. In the program AAA you export your ITAB to the memory. 
   EXPORT ITAB TO MEMORY ID 'TD'(ID is the name of memory, you don't need to create it ). 
3. In program BBB you have to declare The same table (same table's name and same fields). 
4. In BBB you can import ITAB : 
   IMPORT ITAB FROM MEMORY ID 'TD' 
5. Now you can export it to AAA after modifications. 
   EXPORT ITAB TO MEMORY ID 'TD'
6. In AAA : 
   IMPORT ITAB FROM MEMORY ID 'TD'
This solution is independant to SUBMIT. 
(三)         Example:    
两个程序010和011,选择屏幕是一样的. 010是ALV行显示的,011是WRITE显示的.需要达到的效果是: 点击:MATNR字段则将010的选择屏幕传到011的选择屏幕中去;点击VBELN,则将当前行的VBELN传到011的选择屏幕中去.
Program:010
1.定义010的选择屏幕:
selection-screen begin of block b1 with frame title bt1.
  parameters  PL_BUKRS like VBRK-BUKRS memory id P_BUKRS default '1000'.
  select-options PI_KUNRG for VBRK-KUNRG.
  select-options PI_FKDAT for VBRK-FKDAT.
  select-options PI_VBELN for VBRK-VBELN.
  select-options PI_VGBEL for VBRP-VGBEL.
selection-screen end of block b1.
2.010中定义USERCOMMAND事件:
form. user_command using i_ucomm like sy-ucomm is_selfield type slis_selfield.
case i_ucomm.
when '&IC1'.
CASE is_selfield-fieldname.
WHEN 'VBELN'.
read table itab index is_selfield-tabindex.      "change
EXPORT ITAB-VBELN TO MEMORY ID 'PT_VBELN'.
EXPORT is_selfield-fieldname TO MEMORY ID 'PP_FIELD'.
CALL TRANSACTION 'ZF011' AND SKIP FIRST SCREEN.
WHEN 'MATNR'.
EXPORT is_selfield-fieldname TO MEMORY ID 'PP_FIELD'.
EXPORT PI_KUNRG to memory id 'PP_KUNRG'.   "add
EXPORT PI_VGBEL TO MEMORY ID 'PP_VGBEL'.   "add
EXPORT PI_VBELN to memory id 'PP_VBELN'.   "add
EXPORT PI_FKDAT TO MEMORY ID 'PP_PKDAT'.   "add
CALL TRANSACTION 'ZF011' AND SKIP FIRST SCREEN.
ENDCASE.
endcase.
endform. "user_command
3.011中定义选择屏幕(这里就不需要定义MEMORY ID):
selection-screen begin of block b1 with frame. title bt1.
parameters PL_BUKRS like VBRK-BUKRS memory id PP_BUKRS default '1000'.
select-options PI_KUNRG for VBRK-KUNRG .
select-options PI_FKDAT for VBRK-FKDAT.
select-options PI_VBELN for VBRK-VBELN .
select-options PI_VGBEL for VBRP-VGBEL .
selection-screen end of block b1.
 
4.011中接收010中传过来的值
DATA : ME_VBELN LIKE VBRK-VBELN .
DATA : ME_FIELD(30) TYPE C . “定义ME_FIELD是为了接收is_selfield-fieldname的MEMORY ID 'PP_FIELD',因为MEMORY不是一个字段,也不是一个内表,只能用这种方式来传输
CLEAR :ME_VBELN ,ME_FIELD.
IMPORT is_selfield-fieldname = ME_FIELD FROM MEMORY ID 'PP_FIELD'.
IF ME_FIELD = 'VBELN'.
IMPORT ITAB-VBELN = ME_VBELN FROM MEMORY ID 'PT_VBELN'.
ELSE .
IMPORT PI_VBELN = PI_VBELN from MEMORY ID 'PP_VBELN'.
ENDIF .
IMPORT PI_FKDAT = PI_FKDAT FROM MEMORY ID 'PP_PKDAT'.
IF NOT ME_VBELN IS INITIAL .  “表示选择了VBELN
PI_VBELN-SIGN = 'I'.
PI_VBELN-OPTION = 'EQ'.
PI_VBELN-LOW = ME_VBELN .  “只选择单值,所以传LOW就可以拉
APPEND PI_VBELN .
ENDIF .:

转载于:https://www.cnblogs.com/clsoho/archive/2010/03/11/1683480.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/463104.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

RocksDB事务实现TransactionDB分析

基本概念 1. LSN (log sequence number) RocksDB中的每一条记录(KeyValue)都有一个LogSequenceNumber(后面统称lsn),从最初的0开始,每次写入加1。该值为逻辑量,区别于InnoDB的lsn为redo log物理写入字节量。 我有几张阿里云幸运券分享给你&…

Leetcode 771. Jewels and Stones

class Solution(object):def numJewelsInStones(self, J, S):""":type J: str:type S: str:rtype: int"""countcollections.Counter(S)ans0for j in J:anscount.get(j,0)return ans 转载于:https://www.cnblogs.com/zywscq/p/10562590.html

iptables规则的增删改查

1、查看 iptables -nvL --line-number -L 查看当前表的所有规则,默认查看的是filter表,如果要查看NAT表,可以加上-t NAT参数 -n 不对ip地址进行反查,加上这个参数显示速度会快很多 -v 输出详细信息,包含通过该规则的数…

2010.3.13郊野公园小记,以及参观托驼峰航线纪念碑

今天是周末&#xff0c;也是个晴好的天气(罪过&#xff0c;今年云南大旱&#xff0c;希望早点下雨吧&#xff09;。去了趟昆明西北郊的郊野公园&#xff0c;09年的时候成龙的<大兵小将>也曾经在此公园取景。 首先上图的是公园里的驼峰航线纪念碑&#xff0c;也差不多到清…

HDFS的读/写流程

1.HDFS读流程 HDFS读流程 1.1 、Client通过FileSystem.open(filePath)方法,与NN节点进行【rpc】协议通信&#xff0c;校验是否有权限是否存在&#xff0c;假如都ok&#xff0c;返回该文件的部分或全部的block的列表(包含各个block块的分布在DN地址的列表)&#xff0c;也就是返…

VS Code设置中文插件

Vscode是一款开源的跨平台编辑器。默认情况下&#xff0c;vscode使用的语言为英文(en) 1&#xff09;打开vscode工具&#xff1b; 2&#xff09;使用快捷键组合【CtrlShiftp】&#xff0c;在搜索框中输入“configure display language”&#xff0c;点击确定后&#xff1b; 3&a…

1.4 CDA扩展

本地定义的标记可能被使用当本地的语义在CDA规范中没有相应的表述。当为不共享的标签的含义提供一个简洁、标准的机制时&#xff0c;CDA力求在最高的层次上共享的语义上进行标准化。为了支持本地扩展的需求&#xff0c;包含CDA架构之外的XML节点和属性是允许的。这些扩展不应该…

如何:将 TraceSource 和筛选器与跟踪侦听器一起使用(转载)

本文转载&#xff1a;http://msdn.microsoft.com/zh-cn/library/ms228993.aspx .NET Framework 2.0 版中的新功能之一就是增强的跟踪系统。基本的前提并未改变&#xff1a;跟踪消息通过开关发送到侦听器&#xff0c;侦听器则向关联的输出介质报告数据。2.0 版的一个主要区别在于…

C++排序之stable_sort()的方法

stable_sort()可以对vector的某个成员进行排序&#xff0c;而且可保证相等元素的原本相对次序在排序后保持不变。 下面是该函数的实现方法代码&#xff1a; #include <iostream> #include<math.h> #include <string> #include <vector> #include <…

linhaifeng fullstack

fullstack day02: 数据类型、字符编码、文件处理 http://www.cnblogs.com/linhaifeng/articles/7133357.html 转载于:https://www.cnblogs.com/marcoxu/p/10564094.html

javascript校验2

* 判断字符串是否符合指定的正则表达式 */ Java代码 function f_check_formatStr(obj) { var str obj.value; var dtype obj.eos_datatype; var regu dtype.substring(dtype.indexOf("(")1,dtype.indexOf(")")); //指定的正则表…

抓取qq邮箱联系人

今天是:2010-03-14 &#xff0c;纪念昨晚熬到3点! 题外话&#xff1a;模拟登陆请求页面这次我用了httpclient4.0&#xff0c;也顺便学习一下&#xff0c;4.0跟以前的版本用法上有很大的不同&#xff0c;具体情况Google一下就知道了&#xff0c;个人觉得知道原理就行了&#xff…

HDFS的Block size的默认大小

今天无意中听到了同事说关于HDFS中每个block的大小&#xff0c;特意查了下&#xff1a; 从Hadoop的官网上看了各个版本的说明文档中关于 Data Blocks 的说明&#xff0c;发现是从2.7.3版本开始&#xff0c;官方关于Data Blocks 的说明中&#xff0c;block size由64 MB变成了12…

Jconsole查看Weblogic自定义MBean

简单的Jconsole连接到weblogic进程&#xff0c;只能连接Platform MBean server,看不到自定义MBean。 这时我们需要连接到 WebLogic MBean server&#xff0c;通过如下方式&#xff1a; 1. 创建wlfulclient.jar 1) cd %WL_HOME%/server/lib 2) java -jar wljarbuilder.jar 2. 启…

Centos7 安装Mysql5.7

我们经常需要在服务器上安装mysql&#xff0c;各种文档都有&#xff0c;但是很多都是一部分&#xff0c;我现在总结了一下&#xff0c;放到一起&#xff0c;以后大家不用一篇一篇查询了。 1.安装yum repo 由于CentOS 的yum源中没有mysql&#xff0c;需要到mysql的官网下载yum r…

MySQL Innodb存储引擎使用B+树做索引的优点

对于数据库来说&#xff0c;索引和表数据都是存放在磁盘上的&#xff0c;一般使用B树作为索引 MySQL Innodb存储引擎使用了B树作为索引的优点&#xff0c;主要有以下原因&#xff1a; 1、索引和表数据都是存放在磁盘上的&#xff0c;如果磁盘上的数据量过大时&#xff0c;无法…

用eclipse配置spket编写extjs代码方法

依然是备忘用的&#xff0c;因为以前学过的东西很容易就会遗忘&#xff0c;现在每学一点就记录下来&#xff0c;一来让自己有一定的成就感&#xff0c;二来也方便以后查阅。 ExtJS的好处我就不多说了&#xff0c;富客户端的ajax框架&#xff0c;美观&#xff0c;大方&#xff0…

【 iview 实践指南】之如何优雅地在Table中嵌套Input(代码篇)

iview 版本 3.2.0 template 部分&#xff1a; <template><div><Table class"data-manage-table"border:disabled-hover"true":columns"columns":data"datalist"><template slot-scope"{ row, index }"…

PHP函数学习摘录

1、任何有效的 PHP 代码都有可能出现在函数内部&#xff0c;甚至包括其它函数和类定义2、PHP 不支持函数重载&#xff0c;也不可能取消定义或者重定义已声明的函数。3、函数名是大小写无关的&#xff0c;不过在调用函数的时候&#xff0c;通常使用其在定义时相同的形式。 变量…

boost::scoped_ptr与std::unique_ptr

boost::scoped_ptr与std::unique_ptr都是类模板&#xff0c;封装了指针 两者都禁用了拷贝构造和赋值函数&#xff0c;因此不能作为STL容器中的元素&#xff0c;因为在执行push_back()时需要调用赋值函数。 std::unique_ptr实际上与boost::scoped_ptr是等价的&#xff0c;只是s…