通过 MD_SALES_ORDER_STATUS_REPORT 建立MD04展开树
来源:互联网 发布:信捷plc 编程软件3.5 编辑:程序博客网 时间:2024/05/16 16:19
Recently I needed to get information from CO46 tcode to use in a custom development. More specifically, I needed Overview Tree from MD04.
The only FM to get this data is MD_SALES_ORDER_STATUS_REPORT, but this FM just open CO46 tcode.
So we have this NODISP parameter in the FM, but when enabled, it returns only the IIOELX table and any data from Overview Tree.
So, I did a huge workaround to get this information from this FM. As it is described below.
In the Z program we have to o the following:
Declare two variables:
- DATA: lc_md_memory,
- gt_ord_outtab TYPE ty_io_struc_tab.
You can copy ty_io_struc_tab structure from program LM61TTOP.
In your code, before call MD_SALES_ORDER_STATUS_REPORT FM, you need to set some memory information.
Note that NODISP parameter is set to space as default.
- lc_md_memory = cc_x. " Set var to export to memory
- EXPORT lc_md_memory TO MEMORY ID 'MDREPORT'.
- " Call FM with your parameters
- CALL FUNCTION 'MD_SALES_ORDER_STATUS_REPORT'
- EXPORTING
- edelet = ls_mdpsx-delet
- edelkz = ls_mdpsx-delkz
- edelnr = ls_mdpsx-del12
- edelps = ls_mdpsx-delps
- ewerks = ls_mt61d-werks
- i_ignore_mtold = 'X'
- i_profid = 'SAP000000002'
- EXCEPTIONS
- error = 1
- others = 2.
- " Import result table from memory
- IMPORT gt_ord_outtab FROM MEMORY ID 'MDREPORT'.
After this points, you should have your internal table GT_ORD_OUTTAB with the same information from Overview Tree, but to work we need to create another piece of this puzzle: an implicit enhancement.
Go to program LM61TF27, enable Enhance and Show Implicit Enhance Options.
In the end of form ord_create_tree, create an enhance implamentation to insert the following code:
- DATA: lc_md_memory.
- IMPORT lc_md_memory FROM MEMORY ID 'MDREPORT'.
- IF lc_md_memory IS NOT INITIAL.
- EXPORT gt_ord_outtab TO MEMORY ID 'MDREPORT'.
- LEAVE PROGRAM.
- ENDIF.
In this code, we get lc_md_memory from memory to check if it is set from our calling program.
If is set, we export gt_ord_outtab to memory and finally leave current program to avoid open CO46 transaction.
It should be like this:
In our calling program, GT_ORD_OUTTAB will be populated as CO46.
- 通过 MD_SALES_ORDER_STATUS_REPORT 建立MD04展开树
- 如何用MD_SALES_ORDER_STATUS_REPORT函数从MD04事务码获取概览树(overview tree)数据
- 用MD_SALES_ORDER_STATUS_REPORT函数从MD04事务码获取订单报表数据
- 通过中序后序建立二叉树
- .NET 树控件点击节点名称直接展开节点而不是只能通过点击小加号展开
- 通过后续遍历建立二元查找树
- 通过先序中序遍历建立二叉树
- Javascript 通过overflow控制列表闭合展开
- 取得MD04中的信息
- MD04例外说明
- MD04 常用的bapi
- MD04例外说明
- SAP MD04详解
- SAP MD04详解
- JSTree 默认展开 树节点默认展开
- 全部展开树节点
- Flex 展开树
- Flex 展开树
- IO流中FileWriter和FileRead
- Andrroid数据各类持久化工具类
- 从零开始学C++之模板(一):函数模板、函数模板特化、重载函数模板、非模板函数重载
- 【LeetCode】Linked List Cycle
- ProGuard
- 通过 MD_SALES_ORDER_STATUS_REPORT 建立MD04展开树
- CentOS7 安装配置 MariaDB
- 自己学驱动18——中断
- 【Filter】利用过滤器Filter解决post传递的编码问题与利用EL表达式简化参数传递
- llvm 学习笔记 1 :gdb 调试 llvm
- Linux 下编译并运行C++程序
- Linux中设置服务自启动的三种方式
- Android动画学习
- NSDictionary或者NSArray中包含NSNull对象,无法写入文件