ABAP程序相互调用--SUBMIT
(1) 调用其他程序:
* Trigger the IDOC
SUBMIT zpcppmd001_idoc AND RETURN.
(2) 调用其他程序参数传递参数:
*当被调用的程序的屏幕有输入参数时: SUBMIT zreport with p_param1 = 'value1'
with p_param2 = 'value2'. *当要传递一个内表到被调用的程序时,需要用SAP MEMORY或者ABAP MEMORY: *在调用的程序中:
EXPORT it_tab TO MEMORY 'Z_MEMORY'. *在被调用的程序中:
IMPORT T_ITAB FROM MEMORY 'Z_MEMORY'.
(3) RANGE表:
*Code used to populate 'select-options' & execute report
DATA: seltab type table of rsparams,
seltab_wa like line of seltab. seltab_wa-selname = 'PNPPERNR'.
seltab_wa-sign = 'I'.
seltab_wa-option = 'EQ'. * load each personnel number accessed from the structure into
* parameters to be used in the report
loop at pnppernr.
seltab_wa-low = pnppernr-low.
append seltab_wa to seltab.
endloop.
SUBMIT zreport with selection-table seltab
via selection-screen.
(4)其他情况:
*Submit report and return to current program afterwards SUBMIT zreport AND RETURN. *Submit report via its own selection screen SUBMIT zreport VIA SELECTION-SCREEN. *Submit report using selection screen variant SUBMIT zreport USING SELECTION-SET 'VARIANT1'.
REPORT ZPPR0051. TABLES:AUFM. DATA: IT_SELTAB TYPE TABLE OF RSPARAMS,
IW_SELTAB LIKE LINE OF IT_SELTAB. SELECTION-SCREEN BEGIN OF BLOCK BLK WITH FRAME TITLE TEXT-.
SELECT-OPTIONS: S_WERKS FOR AUFM-WERKS OBLIGATORY NO INTERVALS,
S_AUFNR FOR AUFM-AUFNR.
SELECTION-SCREEN END OF BLOCK BLK. *----------------------------------------------------------------------*
* START-OF-SELECTION.
*----------------------------------------------------------------------* START-OF-SELECTION. LOOP AT S_WERKS.
IW_SELTAB-SELNAME = 'S_WERKS'.
IW_SELTAB-SIGN = S_WERKS-SIGN .
IW_SELTAB-OPTION = S_WERKS-OPTION.
IW_SELTAB-LOW = S_WERKS-LOW.
APPEND IW_SELTAB TO IT_SELTAB.
ENDLOOP. LOOP AT S_AUFNR .
IW_SELTAB-SELNAME = 'S_AUFNR'.
IW_SELTAB-SIGN = S_AUFNR-SIGN .
IW_SELTAB-OPTION = S_AUFNR-OPTION.
IW_SELTAB-LOW = S_AUFNR-LOW.
IW_SELTAB-HIGH = S_AUFNR-HIGH.
APPEND IW_SELTAB TO IT_SELTAB.
ENDLOOP. SUBMIT ZPPR0015 WITH SELECTION-TABLE IT_SELTAB.
*---------------------------------------------------------------------------
、最普通的用法 *Code used to execute a report
SUBMIT Zreport. 、带select-options程序的Submit的用法 *Code used to populate 'select-options' & execute report
DATA: seltab type table of rsparams,
seltab_wa like line of seltab. seltab_wa-selname = 'PNPPERNR'.
seltab_wa-sign = 'I'.
seltab_wa-option = 'EQ'. * load each personnel number accessed from the structure into
* parameters to be used in the report
loop at pnppernr.
seltab_wa-low = pnppernr-low.
append seltab_wa to seltab.
endloop.
SUBMIT zreport with selection-table seltab
via selection-screen. 、带parameters程序的Submit的用法 *Code used to populate 'parameters' & execute report SUBMIT zreport with p_param1 = 'value'
with p_param2 = 'value'. 、其他情况 *Submit report and return to current program afterwards SUBMIT zreport AND RETURN. *Submit report via its own selection screen
SUBMIT zreport VIA SELECTION-SCREEN. *Submit report using selection screen variant
SUBMIT zreport USING SELECTION-SET 'VARIANT1'. *Submit report but export resultant list to memory, rather than
*it being displayed on screen
SUBMIT zreport EXPORTING LIST TO MEMORY.
* Once report has finished and control has returned to calling
* program, use function modules LIST_FROM_MEMORY, WRITE_LIST and
* DISPLAY_LIST to retrieve and display report. *Example Code (Retrieving list from memory)
DATA BEGIN OF itab_list OCCURS .
INCLUDE STRUCTURE abaplist.
DATA END OF itab_list. DATA: BEGIN OF vlist OCCURS ,
filler1() TYPE c,
field1() TYPE c,
filler() TYPE c,
field2() TYPE c,
filler3() TYPE c,
field3() TYPE c,
filler4() TYPE c,
field4() TYPE c,
filler5() TYPE c,
field5() TYPE c,
filler6() TYPE c,
field6() TYPE c,
filler7() TYPE c,
field7() TYPE c,
END OF vlist. SUBMIT zreport EXPORTING LIST TO MEMORY. CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = itab_list
EXCEPTIONS
not_found =
OTHERS = . CALL FUNCTION 'LIST_TO_ASCI'
EXPORTING
list_index = -
TABLES
listasci = vlist
listobject = itab_list
EXCEPTIONS
empty_list =
list_index_invalid =
OTHERS = . IF sy-subrc NE ''.
WRITE:/ 'LIST_TO_ASCI error !! ', sy-subrc.
ENDIF. 、Submit为后台执行 *Submit report as job(i.e. in background) data: jobname like tbtcjob-jobname value
' TRANSFER TRANSLATION'.
data: jobcount like tbtcjob-jobcount,
host like msxxlist-host.
data: begin of starttime.
include structure tbtcstrt.
data: end of starttime.
data: starttimeimmediate like btch0000-char1. * Job open
call function 'JOB_OPEN'
exporting
delanfrep = ' '
jobgroup = ' '
jobname = jobname
sdlstrtdt = sy-datum
sdlstrttm = sy-uzeit
importing
jobcount = jobcount
exceptions
cant_create_job =
invalid_job_data =
jobname_missing = .
if sy-subrc ne .
"error processing
endif. * Insert process into job
SUBMIT zreport and return
with p_param1 = 'value'
with p_param2 = 'value'
user sy-uname
via job jobname
number jobcount.
if sy-subrc > .
"error processing
endif. * Close job
starttime-sdlstrtdt = sy-datum + .
starttime-sdlstrttm = ''.
call function 'JOB_CLOSE'
exporting
event_id = starttime-eventid
event_param = starttime-eventparm
event_periodic = starttime-periodic
jobcount = jobcount
jobname = jobname
laststrtdt = starttime-laststrtdt
laststrttm = starttime-laststrttm
prddays =
prdhours =
prdmins =
prdmonths =
prdweeks =
sdlstrtdt = starttime-sdlstrtdt
sdlstrttm = starttime-sdlstrttm
strtimmed = starttimeimmediate
targetsystem = host
exceptions
cant_start_immediate =
invalid_startdate =
jobname_missing =
job_close_failed =
job_nosteps =
job_notex =
lock_failed =
others = .
if sy-subrc eq .
"error processing
endif.
START-OF-SELECTION. PERFORM GET_DATA.
*&———————————————————————* *& Form GET_DATA *&———————————————————————* * text
*———————————————————————-* * –> p1 text * <– p2 text *———————————————————————-* FORM GET_DATA. DATA:LS_DATA TYPE REF TO DATA. FIELD-SYMBOLS: <LT_DATA> TYPE TABLE, <L_DATA> TYPE DATA.
CL_SALV_BS_RUNTIME_INFO=>SET( DISPLAY = '' METADATA = '' DATA = 'X' ). SUBMIT ZMM000000 WITH ZBUDAT IN ZBUDAT AND RETURN. TRY. CL_SALV_BS_RUNTIME_INFO=>GET_DATA_REF( IMPORTING R_DATA = LS_DATA ). ASSIGN LS_DATA->* TO <LT_DATA>. CATCH CX_SALV_BS_SC_RUNTIME_INFO. MESSAGE 'UNABLE TO RETRIEVE ALV DATA' TYPE 'E'. ENDTRY. CL_SALV_BS_RUNTIME_INFO=>CLEAR_ALL( ). LOOP AT <LT_DATA> ASSIGNING <L_DATA>. MOVE-CORRESPONDING <L_DATA> TO GT_TAB. APPEND GT_TAB. ENDLOOP. ENDFORM.
ABAP程序相互调用--SUBMIT的更多相关文章
- ABAP程序互调用:SUBMIT、CALL TRANSACTION、LEAVE TO TRANSACTION
声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...
- ABAP 程序/接口调用其他程序的数据
在ABAP遇到的业务场景中,可能会遇到一种情况,需要调用其他报表的数据来发送或者二次加工,这个时候又不想对源程序做大的改动.有以下几种思路解决. 1.修改源程序,将需要展示的数据存储到DB中,然后主程 ...
- [SAP ABAP开发技术总结]ABAP程序之间数据共享与传递
声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...
- C程序与Lua脚本相互调用
Lua脚本是一种可用于C程序开发/测试的工具,本篇介绍一下C程序与Lua脚本如何进行相互调用,更加详细的操作参见<Programing in Lua>.本文分为3个部分:1.Windows ...
- C 程序与 C++ 程序之间的相互调用
因为 C 编译器编译函数时不带参数的类型信息,只包含函数的符号名字.如 void foo( int x ) , C 编译器会将此函数编译成类似 _foo 的符号,C 链接器只要找到了调用函数的符号,就 ...
- ABAP RFC远程调用
声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...
- 多个Activity相互调用和Intent
MainActivity.java和OtherActivity.java的相互调用 首先MainActivity.java是Android程序自带的,新建一个类OtherActiviy extends ...
- Java(JCo3)与SAP系统相互调用
声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...
- Lua与C++相互调用
{--1.环境--} 为了快速入手,使用了小巧快速的vc++6.0编译器 以及在官网下载了Lua安装包..官网地址{--http://10.21.210.18/seeyon/index.jsp--} ...
随机推荐
- ExtJS 获取浏览器宽度
JS中代码: Ext.onReady(function() { var width=window.screen.availWidth; var height=window.screen.availHe ...
- 【win8技巧】应用商店里面如何搜索应用app
win8应用商店搜索app软件的技巧 1.组合键 WIN+C 打开屏幕最右边磁条 2.点击搜索,输入你想搜的软件名称,里面会列出你已经安装的app或者你点击下面的应用商店选项,就可以搜索互联网上应用商 ...
- 利用ZABBIX的RPC-JSON作API扩展应用示例
计划将ZABBIX的一些状态可以在另一个应用的显示GRAPH及链接. 故而在网上找了几个文档,作了一个测试. https://www.zabbix.com/documentation/2.4/manu ...
- http://www.itpub.net/thread-1778530-1-1.html
http://www.itpub.net/thread-1778530-1-1.html
- 李洪强iOS开发之-环信05_EaseUI 使用指南
李洪强iOS开发之-环信05_EaseUI 使用指南 EaseUI 使用指南 简介 EaseUI 封装了 IM 功能常用的控件(如聊天会话.会话列表.联系人列表).旨在帮助开发者快速集成环信 SDK. ...
- 关于安装完Node.js 出现node is not dedined 问题
今天想来接触下Node.js 神奇 怀着揣揣的心 从官网下载了windows 的64位mis版本 几个下一步就顺利安装完毕了 接着跟着新手教程走 不懂教程里的 苹果shell 是什么 反正就是检 ...
- Altium designer入门篇-过孔不开窗
有没有觉得在设计PCB的时候,放的过孔开窗了,在焊接实际PCB板子的时候,会有各种锡尖,拖锡尾巴,严重的网络间短路.此经验简述了使用Altium designer软件,让过孔不开窗的设置办法.初学者可 ...
- Ubuntu10.10 安装scim
Ubuntu10.10 上没有找到默认的输入法,所以要安装一个中文输入法,网上好多介绍的,但都 不怎么好用,下面参考http://blog.csdn.net/caodesheng110/article ...
- C++中为什么要用虚函数、指针或引用才能实现多态?
原文链接:http://blog.csdn.net/zoopang/article/details/14071779 学过C++的都知道,要实现C++的多态性必须要用到虚函数,并且还要使用引用或者指针 ...
- 通过jQuery或ScriptManager以Ajax方式访问服务
1.客户端和服务端 服务端对外提供服务时,可以通过handler或者webservice.handler比较轻便,但是难以对外公开,只有程序员自己知道它到底做了些什么工作.webservice可以将服 ...