问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501

你好,请问关于工艺路线分料到N多工序,有没有批导程序呀!

发布网友 发布时间:2022-04-30 03:27

我来回答

2个回答

懂视网 时间:2022-04-30 07:49

 

工藝路線SQL

标签:

热心网友 时间:2022-04-30 04:57

工艺路线的组件分配是在CA02种用BDC来进行的;
其实在创建工艺路线的时候,BAPI_ROUTING_CREATE这个BAPI本身就可以进行组件分配,当然如果已经在存在了,那么就用BDC吧! 下面是一部分代码,你可以适当修改。

"""调用BDC进行组件分配
""""
"______首先需要展开BOM

data: begin of WT_ITAB occurs 10,
MATNR like MARA-MATNR, "父件物料编码
POSNR LIKE STPOB-POSNR, "项目号
STLNR LIKE STPOB-STLNR, "00214339
IDNRK like MARA-MATNR, "子件物料编码
OJTXP like MAKT-MAKTX, "子件物料描述
MEINS like MARA-MEINS. "子件计量单位
data: end of WT_ITAB.
"------查询行号的内表
DATA : BEGIN OF IT_COLUM OCCURS 0,
VORNR LIKE RCM01-VORNR,
POSNR LIKE STPOB-POSNR, "项目号
STLNR LIKE STPOB-STLNR."00214339
" COLUM TYPE I.
data: end of IT_COLUM.

"给IT_COLUM赋予前三个值
LOOP AT COMPONENTALLOCATION.
CLEAR IT_COLUM.
IT_COLUM-VORNR = COMPONENTALLOCATION-ACTIVITY.
IT_COLUM-POSNR = COMPONENTALLOCATION-ITEM_NO.
IT_COLUM-STLNR = COMPONENTALLOCATION-BOM_NO.
APPEND IT_COLUM.

ENDLOOP.

READ TABLE MATERIALTASKALLOCATION INTO MAAA INDEX 1.
LOOP AT IT_COLUM .
"" 下面开始用BDC了
CLEAR iw_bdcdata. "bdc_dynpro
iw_bdcdata-program = 'SAPLCPDI'.
iw_bdcdata-dynpro = '1010'.
iw_bdcdata-dynbegin = 'X'.
APPEND iw_bdcdata TO it_bdcdata.

CLEAR iw_bdcdata. "bdc_field
iw_bdcdata-fnam = 'BDC_CURSOR'.
iw_bdcdata-fval = 'RC271-PLNNR' .
APPEND iw_bdcdata TO it_bdcdata.
CLEAR iw_bdcdata. "bdc_field
iw_bdcdata-fnam = 'BDC_OKCODE'.
iw_bdcdata-fval = '/00' .
APPEND iw_bdcdata TO it_bdcdata.
CLEAR iw_bdcdata. "bdc_field
iw_bdcdata-fnam = 'RC27M-MATNR'.
iw_bdcdata-fval = MAAA-MATERIAL . "z最开始的父件物料
APPEND iw_bdcdata TO it_bdcdata.
CLEAR iw_bdcdata. "bdc_field
iw_bdcdata-fnam = 'RC27M-WERKS'.
iw_bdcdata-fval = MAAA-PLANT . "工厂
APPEND iw_bdcdata TO it_bdcdata.
CLEAR iw_bdcdata. "bdc_field
iw_bdcdata-fnam = 'RC271-PLNNR'.
iw_bdcdata-fval = GROUP . "组
APPEND iw_bdcdata TO it_bdcdata.
CLEAR iw_bdcdata. "bdc_field
iw_bdcdata-fnam = 'RC271-STTAG'.
iw_bdcdata-fval = MAAA-VALID_FROM . "有效日期
APPEND iw_bdcdata TO it_bdcdata.
CLEAR iw_bdcdata. "bdc_field
iw_bdcdata-fnam = 'RC271-PLNAL'.
iw_bdcdata-fval = '1' . "组计数器
APPEND iw_bdcdata TO it_bdcdata. "以上为第一屏

CLEAR iw_bdcdata. "bdc_dynpro
iw_bdcdata-program = 'SAPLCPDI'.
iw_bdcdata-dynpro = '1400'.
iw_bdcdata-dynbegin = 'X'.
APPEND iw_bdcdata TO it_bdcdata.
CLEAR iw_bdcdata. "bdc_field
iw_bdcdata-fnam = 'BDC_CURSOR'.
iw_bdcdata-fval = 'RC27X-ENTRY_ACT' .
APPEND iw_bdcdata TO it_bdcdata.
CLEAR iw_bdcdata. "bdc_field
iw_bdcdata-fnam = 'BDC_OKCODE'.
iw_bdcdata-fval = '=MATA' .
APPEND iw_bdcdata TO it_bdcdata.
CLEAR iw_bdcdata. "bdc_field
iw_bdcdata-fnam = 'RC27X-ENTRY_ACT'.
iw_bdcdata-fval = '1' .
APPEND iw_bdcdata TO it_bdcdata. "进入了分配界面了

"查询动作
CLEAR iw_bdcdata. "bdc_dynpro
iw_bdcdata-program = 'SAPLCMDI'.
iw_bdcdata-dynpro = '1000'.
iw_bdcdata-dynbegin = 'X'.
APPEND iw_bdcdata TO it_bdcdata.
CLEAR iw_bdcdata. "bdc_field
iw_bdcdata-fnam = 'BDC_CURSOR'.
iw_bdcdata-fval = 'RCM01-MATNR' .
APPEND iw_bdcdata TO it_bdcdata.
CLEAR iw_bdcdata. "bdc_field
iw_bdcdata-fnam = 'BDC_OKCODE'.
iw_bdcdata-fval = '=FIND' .
APPEND iw_bdcdata TO it_bdcdata.

CLEAR iw_bdcdata. "bdc_dynpro
iw_bdcdata-program = 'SAPLCM01'.
iw_bdcdata-dynpro = '1055'.
iw_bdcdata-dynbegin = 'X'.
APPEND iw_bdcdata TO it_bdcdata.
CLEAR iw_bdcdata. "bdc_field
iw_bdcdata-fnam = 'BDC_CURSOR'.
iw_bdcdata-fval = 'SEARCH_BY-STLNR' .
APPEND iw_bdcdata TO it_bdcdata.
CLEAR iw_bdcdata. "bdc_field
iw_bdcdata-fnam = 'BDC_OKCODE'.
iw_bdcdata-fval = '=GOON' .
APPEND iw_bdcdata TO it_bdcdata.
CLEAR iw_bdcdata. "bdc_field
iw_bdcdata-fnam = 'SEARCH_BY-STLNR'.
iw_bdcdata-fval = IT_COLUM-STLNR . ".........00214339
APPEND iw_bdcdata TO it_bdcdata.
CLEAR iw_bdcdata. "bdc_field
iw_bdcdata-fnam = 'SEARCH_BY-POSNR'.
iw_bdcdata-fval = IT_COLUM-POSNR . ".........0003
APPEND iw_bdcdata TO it_bdcdata.
CLEAR iw_bdcdata. "bdc_field
iw_bdcdata-fnam = 'FIRST_HIT'.
iw_bdcdata-fval = 'X' .
APPEND iw_bdcdata TO it_bdcdata.
""new
CLEAR iw_bdcdata. "bdc_dynpro
iw_bdcdata-program = 'SAPLCMDI'.
iw_bdcdata-dynpro = '1000'.
iw_bdcdata-dynbegin = 'X'.
APPEND iw_bdcdata TO it_bdcdata.
CLEAR iw_bdcdata. "bdc_field
iw_bdcdata-fnam = 'BDC_CURSOR'.
iw_bdcdata-fval = 'RCM01-MATNR' .
APPEND iw_bdcdata TO it_bdcdata.
CLEAR iw_bdcdata. "bdc_field
iw_bdcdata-fnam = 'BDC_OKCODE'.
iw_bdcdata-fval = '=NEW' .
APPEND iw_bdcdata TO it_bdcdata.
"""工序
CLEAR iw_bdcdata. "bdc_dynpro
iw_bdcdata-program = 'SAPLCM01'.
iw_bdcdata-dynpro = '1090'.
iw_bdcdata-dynbegin = 'X'.
APPEND iw_bdcdata TO it_bdcdata.
CLEAR iw_bdcdata. "bdc_field
iw_bdcdata-fnam = 'BDC_CURSOR'.
iw_bdcdata-fval = 'RCM01-VORNR' .
APPEND iw_bdcdata TO it_bdcdata.
CLEAR iw_bdcdata. "bdc_field
iw_bdcdata-fnam = 'BDC_OKCODE'.
iw_bdcdata-fval = '=GOON' .
APPEND iw_bdcdata TO it_bdcdata.
CLEAR iw_bdcdata. "bdc_field
iw_bdcdata-fnam = 'RCM01-VORNR'.
iw_bdcdata-fval = IT_COLUM-VORNR . "工序0010 0020 0030
APPEND iw_bdcdata TO it_bdcdata.
CLEAR iw_bdcdata. "bdc_field
iw_bdcdata-fnam = 'RCM01-PLNFL'.
iw_bdcdata-fval = '0' .
APPEND iw_bdcdata TO it_bdcdata.

CLEAR iw_bdcdata. "bdc_dynpro
iw_bdcdata-program = 'SAPLCMDI'.
iw_bdcdata-dynpro = '1000'.
iw_bdcdata-dynbegin = 'X'.
APPEND iw_bdcdata TO it_bdcdata.
CLEAR iw_bdcdata. "bdc_field
iw_bdcdata-fnam = 'BDC_CURSOR'.
iw_bdcdata-fval = 'RCM01-MATNR' .
APPEND iw_bdcdata TO it_bdcdata.
CLEAR iw_bdcdata. "bdc_field
iw_bdcdata-fnam = 'BDC_OKCODE'.
iw_bdcdata-fval = '=BU' .
APPEND iw_bdcdata TO it_bdcdata. "保存退出

CALL TRANSACTION 'CA02' USING it_bdcdata
MODE 'N' UPDATE 'S' MESSAGES INTO it_message.来自:求助得到的回答
声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com
做过两次人流到现在都三四年了,现在可以再做人流吗?如果做可以不告诉医... 劳荣枝被执行死刑,死刑是如何执行的? 怎樣才能最快最好的去除黑眼圈? G-LOC是指什么? ...Information Service”缩写,其在民航领域的应用及创新变革 "EEBA"缩写代表的紧急逃生呼吸器在航空领域中的应用如何? 全屋整装与全屋定制有什么区别?如果想加盟选哪一种比较好呢? 本人想做开家医疗器械店,请问中国较大的医疗器械批发市场在哪里?_百度... ...我是跑销售的(医疗器械类) 我跟的一家医院里部分管事的人员职务有... 上次我去北园大街的时候看见一家医疗器械正在搞活动,槐荫区这边不知有... 红烧肉怎么云才不会发硬? 如何自制馄饨皮? 怎么查询有没有进联通黑名单 怎么查自己是不是联通黑名单? 考研一定需要过六级吗?没过六级怎么办? 考研对六级有要求吗 研究生必须要过六级吗 考研前一定要考六级吗? 藏红花可以和大枣、枸杞一起泡水喝吗?有什么功效? 哪里有佛山不锈钢制品加工厂 广东佛山门窗厂家哪家质量比较好? 佛山比较出名的不锈钢管厂家有哪些? 佛山门窗厂家很多,哪一家门窗比较好,求推荐! 佛山门窗厂家有哪些? 佛山门窗厂家那么多,有哪些品牌做得比较好?准备开一家门窗店 佛山有哪些高端品牌门窗定制厂家?求推荐。 飞机是怎样调整飞行高度的 佛山做不锈钢的厂家,哪一家的质量好,有信誉 佛山不锈钢门厂家哪家好? 门窗加盟哪个厂家有实力? 怎样制作win PEu盘启动 windows peU盘启动 大神指点一下,如何设置U盘启动? 进u盘启动的pe里装系统有几种方式,方法 对于老大的称呼还有哪些?不要常见的,什么首领、BOSS、这主那主这类的,都太高端了... 为什么要称呼自己信仰的神为“主”,这主有什么意思么?如“主人”等,还是语气词,无意? 赵子龙骑马救主,这主讲的是谁 在短暂的从政生涯结束以后,孔子曾带领弟子周游列国,向各国诸侯宣传自己的*主张,但却没被接纳。这主 男朋友变心和我分手了怎么办 农行四十个严禁原文 19世纪法国*思想家托克维尔说美国“既像一个小国那样自由和幸福,又像一个大国那样光荣和强大。”这主 农行员工违法报销 男朋友变心后,和我分手? 在4、9、2、11、16、7、21、35这主数据中中位数是? 农业银行职工违法违纪该向哪里举报? 谁知道快手上的视频在外面看一张图片一进去就是视频还是剪辑过得,谁知道怎么弄得 英国工业*被誉为“被解放了的普罗米修斯”,在人类历史上首次创造了一幅烟囱多于教堂尖顶的图景。这主 与男友相恋5年,现在他变心了,自己该装不知道还是果断分手呢? 这个主述怎么写 农行沈阳分行遭罚50万,严查违规人商品房贷款是为什么?