您的位置:首页 > 其它

SAP ABAP exporting list to memory

2012-07-04 12:04 411 查看
SUBMIT report EXPORTING LIST TO MEMORY

              AND RETURN.

 

submit 关键字的作用就是在程序内部调用一个程序,and return 就是调用report之后,继续返回当前session。那么exporting list to memory的作用是什么呢?

 

This addition stores the basic list for the program accessed in the ABAP Memory. It can only be used together with the addition AND RETURN.

 

首先他必须要和 AND RETURN 一起使用,其次,它的功能是将report产生的list清单,写入ABAP 缓存里。我们可以通过几个有用的Function module 将这些信息读取、展示等。

不多说,给一个例子:ytest_0102 作为主程序,调用ytest0101,程序ytest0101里面的作用就是一个loop,里面用write语句打印出循环索引值。执行的结果证明,通过'LIST_FROM_MEMORY' 'WRITE_LIST'
两个Function module 可以将submit 产生的list 读取并展示。这个例子可以运用到BDC,batch job等批量作业上面。

REPORT  ytest_0102.

DATA list_tab TYPE TABLE OF abaplist.

SUBMIT ytest0101 EXPORTING LIST TO MEMORY

              AND RETURN.

CALL FUNCTION 'LIST_FROM_MEMORY'

  TABLES

    listobject = list_tab

  EXCEPTIONS

    not_found  = 1

    OTHERS     = 2.

IF sy-subrc = 0.

  CALL FUNCTION 'WRITE_LIST'

    TABLES

      listobject = list_tab.
ENDIF.

结果截图



内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息