Add custom field in Material Master
1.Add fields in the Append Structure of table MARA.
2.Configure
SPRO IMG -> Logistics General -> Material Master -> Configuring the Material Master -> Create Programs for Customized Subscreens
SE80 display FUGR MGD1 and select the screen (MM View sub-screen) you want to enhance with your own fields – in our case it will be screen 2701 (Storage data: general data) Copy the selected screen from MGD1 to your FUGR (keep its current number)
3.Paint
4.Coding
process before output.
module modify_screen.
module get_data.
process after input.
chain.
field:
mara-zz_tl_fot_status,
mara-zz_tl_fot_date,
mara-zz_tl_fot_time.
module check_fot_input.
endchain.
chain.
field:
mara-zz_tl_isi_status,
mara-zz_tl_isi_date,
mara-zz_tl_isi_time.
module check_isi_input.
endchain.
field mara-zz_tl_fot_status.
field mara-zz_tl_fot_date.
field mara-zz_tl_fot_time.
field mara-zz_tl_isi_status.
field mara-zz_tl_isi_date.
field mara-zz_tl_isi_time.
module set_data_output.
module modify_screen output.
case sy-tcode.
when 'MM03'.
loop at screen.
case screen-group1.
when 'G1'.
screen-input = 0.
modify screen.
endcase.
endloop.
when 'MM01' or 'MM02'.
loop at screen.
case screen-group1.
when 'G1'.
screen-input = 1.
modify screen.
endcase.
endloop.
endcase.
endmodule. " MODIFY_SCREEN OUTPUT
module get_data output.
call function 'MARA_GET_SUB'
importing
wmara = mara
xmara = *mara
ymara = lmara
.
endmodule. " GET_DATA OUTPUT
module check_isi_input input.
if mara-zz_tl_isi_status is initial
and ( mara-zz_tl_isi_date is not initial or mara-zz_tl_isi_time is not initial ).
clear: mara-zz_tl_isi_date,mara-zz_tl_isi_time.
message 'Select the the ISI status first' type 'E'.
endif.
if mara-zz_tl_isi_status is not initial
and ( mara-zz_tl_isi_date is initial or mara-zz_tl_isi_time is initial )..
message 'Please fill in the ISI status date and time' type 'E'.
endif.
endmodule. " CHECK_DATA_INPUT INPUT
module set_data_output input.
data:
lv_fot_status type mara-zz_tl_fot_status,
lv_fot_date type mara-zz_tl_fot_date,
lv_fot_time type mara-zz_tl_fot_time,
lv_isi_status type mara-zz_tl_isi_status,
lv_isi_date type mara-zz_tl_isi_date,
lv_isi_time type mara-zz_tl_isi_time.
data lv_mail_flag type flag.
check sy-tcode eq 'MM01' or sy-tcode eq 'MM02'.
lv_fot_status = mara-zz_tl_fot_status.
lv_fot_date = mara-zz_tl_fot_date.
lv_fot_time = mara-zz_tl_fot_time.
lv_isi_status = mara-zz_tl_isi_status.
lv_isi_date = mara-zz_tl_isi_date.
lv_isi_time = mara-zz_tl_isi_time.
export lv_fot_status to memory id 'MARA_FOT_STATUS'.
export lv_fot_date to memory id 'MARA_FOT_DATE'.
export lv_fot_time to memory id 'MARA_FOT_TIME'.
export lv_isi_status to memory id 'MARA_ISI_STATUS'.
export lv_isi_date to memory id 'MARA_ISI_DATE'.
export lv_isi_time to memory id 'MARA_ISI_TIME'.
endmodule. " SET_DATA_OUTPUT INPUT
4.Configure
Go to customizing for the MM views in SPRO IMG -> Logistics
General -> Material Master -> Configuring the Material Master
-> Define Structure of Data Screens for Each Screen Sequence (Tcode OMT3)
5.In FM:EXIT_SAPLMGMU_001.include zxmg0u02.
This user exit is called every time PAI is triggered.
if ( sy-tcode eq 'MM01' or sy-tcode eq 'MM02' ) and cmara-matnr cp 'T01*'.
data:
lv_fot_status type mara-zz_tl_fot_status,
lv_fot_date type mara-zz_tl_fot_date,
lv_fot_time type mara-zz_tl_fot_time,
lv_isi_status type mara-zz_tl_isi_status,
lv_isi_date type mara-zz_tl_isi_date,
lv_isi_time type mara-zz_tl_isi_time.
"To be easily understand
"import lv_fot_status from memory id 'MARA_FOT_STATUS'.
"cmara-zz_tl_fot_status = lv_fot_status.
import lv_fot_status = cmara-zz_tl_fot_status from memory id 'MARA_FOT_STATUS'.
import lv_fot_date = cmara-zz_tl_fot_date from memory id 'MARA_FOT_DATE'.
import lv_fot_time = cmara-zz_tl_fot_time from memory id 'MARA_FOT_TIME'.
import lv_isi_status from memory id 'MARA_ISI_STATUS'.
if 'X' eq lv_isi_status and 'X' ne cmara-zz_tl_isi_status.
call function 'ZZXMG0U02_SEND_MAIL'
exporting
iv_material = cmara-matnr
.
endif.
cmara-zz_tl_isi_status = lv_isi_status.
import lv_isi_date = cmara-zz_tl_isi_date from memory id 'MARA_ISI_DATE'.
import lv_isi_time = cmara-zz_tl_isi_time from memory id 'MARA_ISI_TIME'.
endif.
Parameter ID must be same in “export” and “import”
4. Another example.
process before output.
module liste_initialisieren.
loop at extract with control
tctrl_zcustomer_name cursor nextline.
module liste_show_liste.
endloop.
*
process after input.
module liste_exit_command at exit-command.
module liste_before_loop.
loop at extract.
module liste_init_workarea.
chain.
field zcustomer_name-zcustomer_name .
module set_update_flag on chain-request.
endchain.
field vim_marked module liste_mark_checkbox.
chain.
field zcustomer_name-zcustomer_name .
module liste_update_liste.
endchain.
endloop.
module liste_after_loop.
Add custom field in Material Master的更多相关文章
- Add custom and listview web part to a page in wiki page using powershell
As we know, Adding list view web part is different from custom web part using powershell, what's mor ...
- [转]How to query posts filtered by custom field values
Description It is often necessary to query the database for a list of posts based on a custom field ...
- JIRA Plugin Development——Configurable Custom Field Plugin
关于JIRA Plugin开发的中文资料相当少,这可能还是由于JIRA Plugin开发在国内比较小众的原因吧,下面介绍下自己的一个JIRA Plugin开发的详细过程. 业务需求 创建JIRA IS ...
- redmine computed custom field formula tips
项目中要用到Computed custom field插件,公式不知道怎么写,查了些资料,记录在这里. 1.http://apidock.com/ruby/Time/strftime 查看ruby的字 ...
- [webgrid] – header - (How to Add custom html to Header in WebGrid)
How to Add custom html to Header in WebGrid MyEvernote Link Posted on March 30, 2013by mtryambake Ho ...
- How To Add Custom Build Steps and Commands To setup.py
转自:https://jichu4n.com/posts/how-to-add-custom-build-steps-and-commands-to-setuppy/ A setup.py scrip ...
- Add custom daemon on Linux System
Ubuntu add custom service(daemon) Task 需要在系统启动的时候自动启动一个服务(后台程序),在系统关闭的时候关闭服务. 比如在部署某个应用之前,需要将某个任务设置成 ...
- SharePoint Development - Custom Field using Visual Studio 2010 based SharePoint 2010
博客地址 http://blog.csdn.net/foxdave 自定义列表的时候有时候需要自定义一些字段来更好地实现列表的功能,本文讲述自定义字段的一般步骤 打开Visual Studio,我们还 ...
- Material Master
02-03 03: 物料主的定义:相同的物料应该是同一个物料号. 在PP放面我们主要关心的是工厂 . 定义公司后在公司下面在定义工厂. spro配置的时候我们可以在.后勤.物料管理.物料.创建: 后勤 ...
随机推荐
- Java高级特性 第1节 集合框架和泛型
Java中,存储多个同类型的数据,可以用数组来实现,但数组有一些缺陷: 数组长度固定不变,布恩那个很好的适应元素数量动态变化的情况 可以通过数组.length获取数组长度,却无法直接获取数组中实际存储 ...
- 【转】剖析异步编程语法糖: async和await
一.难以被接受的async 自从C#5.0,语法糖大家庭又加入了两位新成员: async和await. 然而从我知道这两个家伙之后的很长一段时间,我甚至都没搞明白应该怎么使用它们,这种全新的异步编程模 ...
- mysql 启动失败,数据恢复
mysql 启动失败,数据恢复 2017年02月13日 16:46:36 阅读数:621 Forcing InnoDB Recovery提供了6个等级的修复模式,需要注意的是值大于3的时候,会对数据文 ...
- c++11 关于typelist的foreach
建好一个typelist,其中都是类型信息而已,很重要的一个应用,循环迭代干些事情. 看了下boost的for_each实现,用我自己的typelist,大概代码如下: template<typ ...
- Kettle从excel导入数据到sql server
从excel工作表中读取数据逐行执行insert语句插入到sqlserver 为了简单起见只选取了三个个字段作为参数,日期,字符类型的需要加上'' Spoon是作业配置的GUI界面,配置好后可以通过控 ...
- 一个简单的gridlayout栗子
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- day32基于tcp协议的远程执行命令
客户端 from socket import *import structimport json client = socket(AF_INET, SOCK_STREAM)client.connect ...
- POI导入工具类
前言 导入的通用方法,包括xls.xlsx的取值方法,非空判断方法,空行判断,处理了手机号读取和日期读取格式问题.这几个方法就可以完成简单读取了,有时间我在优化下. maven依赖 <!-- P ...
- PHP判断是手机端还是PC访问
function isMobile(){ $useragent=isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ' ...
- django session 的简单操作
#!SESSION_SAVE_EVERY_REQUEST = True 设置根据最后一次操作设置登录超时时间#!SESSION_EXPIRE_AT_BROWSER_CLOSE = True 设置是否关 ...