通过 SUBMIT 执行程序,并带有 GUI 抑制
我想将 SAP 程序(事务)的功能公开为 BAPI。 我需要调用报告并提供范围过滤器,以便绕过 GUI。
有谁有 SUBMIT ...WITH...ABAP 构造的工作示例,或者关于如何完成我需要做的事情的其他建议?
I want to expose the functionality of an SAP program (transaction) as a BAPI.
I need to call a report and supply range filters such that the GUI is bypassed.
Does anyone have a working example of the SUBMIT ... WITH ... ABAP construct, or other suggestions on how to accomplish what I need to do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这是一个工作示例:
所有“WITH”语句都与被调用程序上的选择字段相关,其中我使用=它是一个PARAMETER语句(单个字段),我使用IN它是一个SELECT_OPTIONS语句(范围)
这是一个简单的如何填充范围的示例:
Here is a working example:
All the "WITH" statements relates to selection fields on the called program where I use = it is a PARAMETER statement (single field), where I use IN it is a SELECT_OPTIONS statement (range)
Here is a simple example of how to fill a range:
如果您想将此功能抑制为 BAPI,则必须将该功能包装在远程函数调用 (RFC) 模块中。 只需实现一个RFC功能模块即可。 根据报告的实现方式,它可能会使用 ABAP 对象,也可以从 RFC 实现中调用该对象。 鉴于这种情况,你有一个很好的解决方案。 每当调整报告时,您的 BAPI 也会反映更改。 如果它是来自 SAP 的标准程序,无法包装,请考虑将其复制到您的命名空间中并进行调整。 然而,当 SAP 通过支持包堆栈执行更新时,这可能会带来一些麻烦,而您不会意识到这一点。 两种方法的输出是不同的。 除此之外,如果你想从外部调用它,除了实现 RFC 模块之外别无他法。
提交报告不能返回外部值。 报告始终仅用于 GUI 功能,而不用于交换数据。 如果您的报告使用选择选项,您必须以某种方式在 RFC 中“手动”实现此功能,因为此语句不能在 RFC 模块内使用。 我通常会尝试重新编写报告,将其模块化,并将选择信息放入一个中心类中,或者可能是另一个可以从报告和 BAPI 功能模块中调用的功能模块中。 您所讨论的过滤器无法在 RFC 中自动实现。 您必须手动实施这些范围。 出现的警告无法被抑制,如果您从远程系统进行 RFC 调用,并且弹出带有警告的窗口,您将以简短转储结束。 因此,您必须重新编写报告并根据您的需要重新实施它。
如果您只是想通过作业调度绕过它,请创建一个变体并使用该变体安排报告,但我认为这不是您正在寻找的解决方案。
If you want to suppress this functionality as a BAPI you have to wrap the functionality in a Remote Function Call (RFC) module. Just implement a RFC function module. Depending how the report is implemented, it may use ABAP objects, which can also be called from your RFC implementation. Given that case you have a quite good solution. Whenever the report is adjusted, also your BAPI will reflect the changes. In case it's a standard programm from SAP which cannot be wrapped, think about copying it into your namespace and adjusting it. Nevertheless this might give some hassle, when SAP performs an update via Support Package Stack and you won't realize it. The output of the two methods is different. Apart from that, if you want to call it from outside, there is nothing else possible than implementing a RFC module.
A submit report can not return the values outside. Reports are always only for GUI functionalities and not for exchanging data. In case your report uses select options, you somehow have to implement this feature "by hand" in your RFC, as this statements can not be used inside RFC modules. I would generally try to rework the report, modularize it and put the selection information in a central class or maybe another function module wich can be called from the report and your BAPI function module. The filters you are talking about can not be implemented in RFCs automatically. You have to implement those ranges manually. The warning which comes up cannot be suppressed, if you do a RFC call from a remote system and the popup with the warning comes up you'll end with a shortdump. Therefore, you have to rework the report and to re-implement it for your needs.
If you are just looking for bypassing it via job scheduling, create a variant and schedule the report with that variant but I suppose that's not the solution you're looking for.
您可以使用内置的 BAPI 也只需编写“范围”并按 F4。
You can use inbuilt BAPI also just write "Range" and press F4.
您可以将报告封装在 BATCH INPUT 会话中,并在函数内执行它。 唯一的缺点是每次更改报告时都需要重写 BATCH INPUT。
You can wrap your report in an BATCH INPUT session and execute it inside a function. The only drawback is that you need to rewrite the BATCH INPUT every time you change the report.