看懂SAP ECC6中事务码MB51的程序代码

本文深入探讨SAP ECC6中的事务码MB51,主要用于查看物料凭证。作者决定仿写类似功能,因此详细分析了MB51背后的ABAP程序RM07DOCS,包括其变量声明、屏幕显示、调试技巧和关键代码段,揭示了MB51数据来源于MSEG和MKPF表。
摘要由CSDN通过智能技术生成

宫斗龙老师,还记得您说SAP ECC标准事务码的代码,看不懂很正常么?
看不懂SAP标准事务码的ABAP代码,很多代码就像是盲人摸象。还是应该看懂比较好,下面我们来研究一个事务码MB51.
事务码MB51的样子如下:
screenshot
作用主要是查看 物料凭证
运行结果的样子是这样:
screenshot
注意看MvT这个字段,含义是移动类型
采购入库阶段,主要的移动类型(BWART)是103和105
生产订单投料阶段,主要的移动类型(BWART)是261和262

我对这个事务码很感兴趣,它很好用,我决定写一个类似的事务码,因此,我需要先看懂MB51的ABAP代码。
screenshot
screenshot
注意看到MB59和MB51使用同一个“程序”
screenshot
screenshot
screenshot
screenshot
看到归根结底,MB51这个事务码对应的程序叫做 RM07DOCS
screenshot
上图用SE38看属性,看到这个RM07DOCS 的属性如上图所示。
程序开头注释明确表示,MB51的功能。下面逐行看该程序代码:
screenshot
代码共5900行,其中从第1行至921行,都是声明变量
screenshot
493行include rm07docs_generated 代码用于显示MB51屏幕1000上的前两个selection-screen
screenshot
screenshot
如上图,屏幕1000的元素全部显示出来

然后代码进入INITIALIZATION
screenshot
第一个陌生的语法BREAK-POINT
Debugging ABAP programs using Log Point ID and Break Point ID CheckPoint Group (SAAB tcode) commands makes ABAP debugging easier for programmers. SAP SAAB transaction is used to create new CheckPoint group and activate a checkpoint group for a specified time range and for selected users. In this ABAP tutorial, I'll try to show how to use CheckPoint groups using SAAB transaction and the ABAP code syntax of Log-Point Id and Break-Point Id commands.Using Break-Point Id enables ABAP debugger to activate break points set into the code whenever required. If the Break Points are not activated using the SAAB transaction, they wil

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值