当前位置:网站首页>ABAP随笔-物料主数据界面增强-页签增强
ABAP随笔-物料主数据界面增强-页签增强
2022-06-27 19:56:00 【Tab Zhu】
物料主数据增强(2)
之前写了一一篇物料主数据增强的文档ABAP随笔-物料主数据界面增强,需要配置+增强代码,今天升级一下功能,对物料主数据页签进行增强
1. 对物料主数据表增强
append custom field in MARA
随便加一个你想要的字段
2. 物料主数据配置
- 配置1 路径为:SPRO->后勤-常规->物料主数据->配置物料主记录->创建定制子屏幕程序
创建对应的函数组
对于屏幕0001 增加一个字段,增加PAI PBO的逻辑module
其中status_0001,set_ztab_mara_01中代码为
MODULE status_0001 OUTPUT.
IF sy-tcode = 'MM02'
OR sy-tcode = 'MM03'.
CALL FUNCTION 'MARA_GET_SUB'
IMPORTING
wmara = mara
xmara = *mara
ymara = lmara.
ENDIF.
IF sy-tcode = 'MM03'.
LOOP AT SCREEN.
screen-input = '0'.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
ENDMODULE.
MODULE set_ztab_mara_01 INPUT.
DATA:ls_cust TYPE ztab_mara_01 .
MOVE-CORRESPONDING mara TO ls_cust .
CALL FUNCTION 'MARA_GET_SUB'
IMPORTING
wmara = mara
xmara = *mara
ymara = lmara.
MOVE-CORRESPONDING ls_cust TO mara .
CALL FUNCTION 'MARA_SET_SUB'
EXPORTING
wmara = mara.
ENDMODULE.
其中function MARA_GET_SUB 和 MARA_SET_SUB 分别是得到和更新MM02/MM01/MM03内存变量中MARA的值
- 配置2 接着我们继续选择spro->后勤-常规->物料主数据->配置物料主记录->定义每个屏幕序列的数据屏幕的结构
目前我们使用的配置是21屏幕顺序
在数据屏幕界面我们新增一条数据
同时我们该数据下子屏幕进行配置,填入我们刚才创建好FUNCTION GROUOP里面的屏幕 其中SAPLMGD1->1002是显示物料号的表头
可以点击右侧的 视图数据屏幕 查看生成的屏幕
- 配置3 保存退出后,我们进入spro->后勤-常规->物料主数据->配置物料主记录->主屏幕和附加屏幕的维护订单中选择21序号屏幕双击回车 我们可以看到配置好的子屏幕,如果想要把Z1屏幕向上移动,则更改顺序编号即可
现在我们进入MM03界面输入物料点击回车就可以看到新增的视图以供选择了
其实我们现在已经可以对新增的字段进行修改和保存了
3. 数据更新
之前我们在物料主数据界面增强中已经讲过了,如何对物料主数据进行增强校验了,
这里我们简单做一个唯一性校验: 启用EXIT_SAPLMGMU_001出口 和 CI_MMH1
*&---------------------------------------------------------------------*
*& 包含 ZXMG0U02
*&---------------------------------------------------------------------*
IF sy-ucomm = 'BU' OR sy-ucomm = 'YES'.
IF sy-tcode = 'MM01' OR sy-tcode = 'MM02'.
CHECK wmara-custom_field1 IS NOT INITIAL.
SELECT matnr INTO TABLE @DATA(lt_matnr)
FROM mara WHERE custom_field1 = @wmara-custom_field1.
IF sy-subrc EQ 0.
DELETE lt_matnr WHERE matnr = wmara-matnr.
IF lt_matnr[] IS NOT INITIAL.
READ TABLE lt_matnr INDEX 1 INTO DATA(ls_matnr).
MESSAGE e001(ztab) WITH wmara-custom_field1 ls_matnr-matnr.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
当我们双击CI_MMH1时,发现该结构不存在,我们直接SE11创建,然后把增强字段写进去
其实CI_MMH1在我们的增强中是做不到的,但是这个创建了CI_MMH1是在结构BMMH1中的,用于LSMW-如果这里不增强,LSMW就无法进行增强字段批导
激活保存后,我们找另一个物料SGPI002,在客户字段中输入1234567890 保存,这时会提示:
4.注意
上方代码中 sy-tcode = 'MM01' 对MM01也进行唯一性的校验是因为,MM01可以对已存在的物料进行扩展
更多其他的文章请点击历史记录
边栏推荐
- 对话乔心昱:用户是魏牌的产品经理,零焦虑定义豪华
- 【微服务】(十六)—— 分布式事务Seata
- Process judgment - ternary operation - for loop
- Crontab scheduled task common commands
- Acwing week 57 longest continuous subsequence - (binary or tree array)
- Gao fushuai in the unit testing industry, pytest framework, hands-on teaching, will do this in the future test reports~
- “顶流爱豆制造机”携手四个产业资本,做LP
- 元气森林的5元有矿之死
- 《7天學會Go並發編程》第7天 go語言並發編程Atomic原子實戰操作含ABA問題
- Secret script of test case design without leakage -- module test
猜你喜欢

Do280openshift access control -- Security Policy and chapter experiment

netERR_CONNECTION_REFUSED 解决大全

Système de gestion - itclub (II)

It smells good. Since I used Charles, Fiddler has been completely uninstalled by me

Login credentials (cookie+session and token token)

Memoirs of actual combat: breaking the border from webshell

月薪3万的狗德培训,是不是一门好生意?
![\W and [a-za-z0-9_], \Are D and [0-9] equivalent?](/img/96/2649c9cf95b06887b57fd8af2d41c2.png)
\W and [a-za-z0-9_], \Are D and [0-9] equivalent?

First knowledge of the second bullet of C language

渗透学习-靶场篇-pikachu靶场详细攻略(持续更新中-目前只更新sql注入部分)
随机推荐
Go language slice vs array panic: runtime error: index out of range problem solving
“顶流爱豆制造机”携手四个产业资本,做LP
Stunned! The original drawing function of markdown is so powerful!
Golang uses regularity to match substring functions
crontab定时任务常用命令
管理系統-ITclub(下)
對話喬心昱:用戶是魏牌的產品經理,零焦慮定義豪華
OpenSSL Programming II: building CA
Is it safe to open a stock account through the account opening link given by the CICC securities manager? I want to open an account
About the SQL injection of davwa, errors are reported: analysis and verification of the causes of legal mix of settlements for operation 'Union'
信通院举办“业务与应用安全发展论坛” 天翼云安全能力再获认可
Yarn performance tuning of CDH cluster
How to participate in openharmony code contribution
One to many association in MySQL to obtain the latest data in multiple tables
北京邮电大学|用于成本和延迟敏感的虚拟网络功能放置和路由的多智能体深度强化学习
Yarn中RMApp、RMAppAttempt、RMContainer和RMNode状态机及其状态转移
使用sqlite3语句后出现省略号 ... 的解决方法
【微服务】(十六)—— 分布式事务Seata
管理系统-ITclub(中)
Penetration learning - shooting range chapter - detailed introduction to Pikachu shooting range (under continuous update - currently only the SQL injection part is updated)