日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

工单更改历史记录

發(fā)布時間:2025/3/20 编程问答 43 豆豆
生活随笔 收集整理的這篇文章主要介紹了 工单更改历史记录 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

一、自定義表結(jié)構(gòu)

二、生產(chǎn)工單出口增強

三、查詢報表

一、自定義表結(jié)構(gòu)

表ZPCO02

MANDT?MANDT?CLNT?3?0?客戶端
AUFNR?AUFNR?CHAR?12?0?訂單號
MATNR?MATNR?CHAR?18?0?物料號
FILED?FIELDNAME?CHAR?30?0?字段名
AENAM?AENAM?CHAR?12?0?對象更改人員的名稱
LAEDA?LAEDA?DATS?8?0?上次更改的日期
TCODE?TCODE?CHAR?20?0?事務(wù)代碼
CHNID?CDCHNGIND?CHAR?1?0?修改類型 (U, I, E, D)
HOSTIP?CHAR20?CHAR?20?0?字符 20
HOST?MSHOST2?CHAR?32?0?Name of Application Server
VALUE_OLD?CHAR20?CHAR?20?0?字符 20
VALUE_NEW?CHAR20?CHAR?20?0?字符 20
TIMES?CDUZEIT?TIMS?6?0?時間已更改
LOOPID?SYTABIX?INT4?10?0????????????????????????????????????????????????????????????
ALPOS?ALPOS?CHAR?1?0?指示符:替代項目
STTXT?CO_STTXT?CHAR?40?0?系統(tǒng)狀態(tài)

BDMNG?BDMNG?QUAN?13?3?需求量

二、生產(chǎn)工單出口增強

PPCO0001

EXIT_SAPLCOBT_001

ZXCO1U01

check sy-tcode ne 'CO01'.

*&保存工單更改的歷史記錄
tables:caufv,resb.
data: begin of old_resb? occurs 0,? "更改后未保存之RESB.
???????? aufnr like resb-aufnr,
???????? posnr like resb-posnr,
???????? matnr like resb-matnr,
???????? rsnum like resb-rsnum,
???????? rspos like resb-rspos,
???????? xloek like resb-xloek,
???????? bdmng like resb-bdmng,
???????? objnr like resb-objnr,
???????? lgort like resb-lgort,
???????? end of old_resb.

data: begin of new_resb occurs 0.? "數(shù)據(jù)庫中的RESB.
??????? include structure old_resb.
data: end of new_resb.
data: begin of obj_resb occurs 0.? "插入的RESB
??????? include structure old_resb.
data: end of obj_resb.

data: i_zpco02 like zpco02 occurs 0 with header line.
data: i_temp?? like zpco02 occurs 0 with header line.

data: iporg like msxxlist-hostadr,
????? ipdec(16) type c,
????? host(18)? type c.
data: char1(20) type c,
????? char2(20) type c.


data: licl type c.

data: inst_flg type c value 'N',
????? chan_had type c value 'N'.
*????? teco_flg TYPE c VALUE 'N',
*????? read_flg TYPE c .
data: l_str type string.

data: i_msgty like sy-msgty.
data: tabix like sy-tabix.

*BREAK-POINT.

clear: i_temp, iporg, ipdec, host.
**? Get user IP,hostname
call function 'TH_USER_INFO'??? " Get user IP,hostname
? exporting
??? client?? = sy-mandt
??? user???? = sy-uname
? importing
??? hostaddr = iporg
??? terminal = host
? exceptions
??? others?? = 1.

**"Conv.IP addr to format 'xxx.xxx.xxx.xxx'
call function 'GWY_IPADR2STRING'? "Conv.IP addr
? exporting
??? ipadr?? = iporg
? importing
??? string? = ipdec.

***Common var.
move: sy-mandt to i_temp-mandt,
????? sy-uname to i_temp-aenam,
????? sy-datum to i_temp-laeda,
????? sy-uzeit to i_temp-times,
????? sy-tcode to i_temp-tcode,
???????? ipdec to i_temp-hostip,
????????? host to i_temp-host,
* { INCERT
????????? header_table-sttxt to i_temp-sttxt,? "工單狀態(tài)
* INCERT } DEVK905414 ADD:工單狀態(tài)取值
????????? header_table-aufnr to i_temp-aufnr.


***Check M/O header
select single gamng gltrp gstrp into (caufv-gamng, caufv-gltrp,caufv-gstrp)
???????? from caufv where aufnr eq header_table-aufnr.
**qty
if header_table-gamng ne caufv-gamng.
? move: caufv-gamng to char1, header_table-gamng to char2.
? move-corresponding i_temp to i_zpco02.
? move: '更改工單總數(shù)' to i_zpco02-filed,
??????? 'U'??????????? to i_zpco02-chnid,
??????? char1????????? to i_zpco02-value_old,
??????? char2????????? to i_zpco02-value_new.
? append i_zpco02.
? inst_flg = 'Y'.
? chan_had = 'Y'.
endif.
**增加開始日期修改記錄(MODIFY BY LU.X 2010.09.26)
if header_table-gstrp ne caufv-gstrp.
? move-corresponding i_temp to i_zpco02.
? move: '更改開始時間' to i_zpco02-filed,
??????? 'U'??????? to i_zpco02-chnid,
??????? caufv-gstrp??????? to i_zpco02-value_old,
??????? header_table-gstrp to i_zpco02-value_new.
? append i_zpco02.
? inst_flg = 'Y'.
endif.

if header_table-gltrp ne caufv-gltrp.
? move-corresponding i_temp to i_zpco02.
? move: '更改完成時間' to i_zpco02-filed,
??????? 'U'??????? to i_zpco02-chnid,
??????? caufv-gltrp??????? to i_zpco02-value_old,
??????? header_table-gltrp to i_zpco02-value_new.
? append i_zpco02.
? inst_flg = 'Y'.
endif.

?


if inst_flg = 'Y'.
? insert zpco02 from table i_zpco02 accepting duplicate keys.
? inst_flg = 'N'.
endif.

loop at component_table where vbkz eq 'U'
?????????????????????????? or vbkz eq 'I'
?????????????????????????? or vbkz eq 'D'.
? clear licl.
? case component_table-vbkz.
??? when 'I'.
????? move-corresponding i_temp to i_zpco02.
????? move: '新增組件' to i_zpco02-filed,
??????????? 'I'??????? to i_zpco02-chnid,
??????????? ''???????? to i_zpco02-value_old, "old_resb-matnr
??????????? component_table-matnr to i_zpco02-value_new,
??????????? '新增的組件'?? to i_zpco02-matnr,
*?????????? read_flg?????? TO i_zpco02-readf,
??????????? component_table-alpos to i_zpco02-alpos,
??????????? component_table-bdmng to i_zpco02-bdmng,
??????????? sy-tabix?????? to i_zpco02-loopid.
????? append i_zpco02.
????? inst_flg = 'Y'.

??? when 'D'.
????? move-corresponding i_temp to i_zpco02.
????? move: '刪除組件' to i_zpco02-filed,
??????????? 'D'??????? to i_zpco02-chnid,
??????????? resb-xloek to i_zpco02-value_old,
??????????? component_table-xloek to i_zpco02-value_new,
??????????? component_table-matnr to i_zpco02-matnr,
*??????????? read_flg?????? TO i_zpco02-readf,
??????????? component_table-alpos to i_zpco02-alpos,
??????????? sy-tabix?????? to i_zpco02-loopid.
????? append i_zpco02.
????? inst_flg = 'Y'.


??? when 'U'.
* { INCERT
????? if component_table-xloek is not initial.
* { INCERT
??????? search i_temp-sttxt for 'TECO'.
??????? case sy-subrc.
????????? when 4.
* } DEVK910121
??????????? move-corresponding i_temp to i_zpco02.
??????????? move: '刪除組件' to i_zpco02-filed,
????????????????? 'D'??????? to i_zpco02-chnid,
????????????????? resb-xloek to i_zpco02-value_old,
????????????????? component_table-xloek to i_zpco02-value_new,
????????????????? component_table-matnr to i_zpco02-matnr,
*??????????? read_flg?????? TO i_zpco02-readf,
????????????????? component_table-alpos to i_zpco02-alpos,
????????????????? sy-tabix?????? to i_zpco02-loopid.
??????????? append i_zpco02.
??????????? inst_flg = 'Y'.
* { INCERT
??????? endcase.
* } DEVK910121 忽略由工單關(guān)閉引起的組件刪除
????? else.
* INCERT } DEVK905414 FIX BUG:刪除組件無記錄
??????? select single matnr bdmng lgort into? (resb-matnr, resb-bdmng,resb-lgort)
???????????????? from resb? where aufnr eq component_table-aufnr
????????????????????????????? and posnr eq component_table-posnr
????????????????????????????? and matnr eq component_table-matnr
????????????????????????????? and rsnum eq component_table-rsnum
????????????????????????????? and rspos eq component_table-rspos.
??????? if component_table-matnr ne resb-matnr.
????????? move-corresponding i_temp to i_zpco02.
????????? move: '更改組件' to i_zpco02-filed,
??????????????? 'U'??????? to i_zpco02-chnid,
??????????????? resb-matnr to i_zpco02-value_old,
??????????????? component_table-matnr to i_zpco02-value_new,
??????????????? '更改的工單組件' to i_zpco02-matnr,
*???????????? read_flg?????? TO i_zpco02-readf,
??????????????? component_table-alpos to i_zpco02-alpos,
????????????????? sy-tabix?????? to i_zpco02-loopid.
????????? append i_zpco02.
????????? inst_flg = 'Y'.

??????? elseif component_table-bdmng ne resb-bdmng.
* { DELETE
*????????? CHECK chan_had NE 'Y'.
* DELETE } DEVK905414 FIX BUG:抬頭數(shù)量修改引起的組件數(shù)量修改無記錄
????????? move: component_table-bdmng to char1, resb-bdmng to char2.
????????? move-corresponding i_temp to i_zpco02.
????????? move: '需求數(shù)量' to i_zpco02-filed,
????????? 'U'?? to i_zpco02-chnid,
????????? char2 to i_zpco02-value_old,
????????? char1 to i_zpco02-value_new,
????????? component_table-matnr to i_zpco02-matnr,
*????? read_flg?????? TO i_zpco02-readf,
????????? component_table-alpos to i_zpco02-alpos,
????????? sy-tabix?????? to i_zpco02-loopid.
????????? append i_zpco02.
????????? inst_flg = 'Y'.
*????? wangkai 發(fā)料倉庫變更的記錄
??????? elseif component_table-lgort ne resb-lgort .
????????? move: component_table-lgort to char1, resb-lgort to char2.
????????? move-corresponding i_temp to i_zpco02.
????????? move: '發(fā)料倉庫' to i_zpco02-filed,
?????????? 'U'?? to i_zpco02-chnid,
?????????? char2 to i_zpco02-value_old,
?????????? char1 to i_zpco02-value_new,
?????????? component_table-matnr to i_zpco02-matnr,
*????? read_flg?????? TO i_zpco02-readf,
?????????? component_table-alpos to i_zpco02-alpos,
?????????? sy-tabix?????? to i_zpco02-loopid.
????????? append i_zpco02.
????????? inst_flg = 'Y'.
* { INCERT
??????? endif.
* INCERT } DEVK905414
????? endif.
? endcase.

endloop.

if inst_flg = 'Y'.
? insert zpco02 from table i_zpco02 accepting duplicate keys.
? if sy-subrc eq 0.
??? inst_flg = 'N'.
??? chan_had = 'N'.
??? free: i_zpco02.
??? clear: i_temp.
? endif.
endif.

三、查詢報表

REPORT? ZCOHS.
tables: zpco02, afko.
data: i_zpco02 like zpco02 occurs 0 with header line.
data: i_clear? like zpco02 occurs 0 with header line.
*data: i_aufnr
selection-screen begin of block block1 with frame. title text-001 .
select-options s_aufnr for? afko-aufnr."生產(chǎn)訂單
*SELECT-OPTIONS s_matnr FOR ZPCO02-MATNR.
select-options s_aenam for zpco02-aenam."更改者
select-options s_laeda for zpco02-laeda modif id gp2."修改日期
"PARAMETERS:??? p_clear AS CHECKBOX MODIF ID gp1.
selection-screen end of block block1 .

?

top-of-page.
? perform. write_header.

at selection-screen output.
? loop at screen.
??? if screen-group1 = 'GP1'.
????? screen-intensified = '1'.
????? modify screen.
????? continue.
??? endif.
? endloop.

*&---------------------------------------------------------------------*
*&?? Event START-OF-SELECTION
*&---------------------------------------------------------------------*
start-of-selection.

? perform. get_data.
*&---------------------------------------------------------------------*
*&?? Event END-OF-SELECTION
*&---------------------------------------------------------------------*
end-of-selection.
? perform. report_output.

?form. get_data .
? select zpco02~mandt zpco02~aufnr zpco02~matnr zpco02~filed zpco02~aenam zpco02~laeda zpco02~tcode
???????? zpco02~chnid zpco02~hostip zpco02~host zpco02~value_old zpco02~value_new zpco02~times zpco02~loopid
???????? zpco02~alpos zpco02~sttxt zpco02~bdmng
??? into corresponding fields of table i_zpco02
??? from zpco02
??? inner join afpo on zpco02~aufnr = afpo~aufnr
??? where? afpo~posnr = 1
????? and? afpo~elikz = ''
????? and? zpco02~aufnr in s_aufnr
????? and? zpco02~aenam in s_aenam
????? and? zpco02~laeda in s_laeda
????? .

? check i_zpco02[] is initial or sy-subrc eq 4.
? message id 'ZX' type 'S'
????????? number '000' with '沒有找到數(shù)據(jù)'.

endform.??????????????????? " get_data
*&---------------------------------------------------------------------*
*&????? Form? write_header
*&---------------------------------------------------------------------*
form. write_header .
? data: l_pos1 type i,
??????? l_pos2 type i,
??????? l_pos3 type i,
??????? l_title(33) type c value '工單更改歷史記錄'.
*?? CONCATENATE l_title v_bom_til INTO l_title.

? l_pos1 = sy-linsz / 2 - 15.
? l_pos2 = sy-linsz - 15.
? l_pos3 = l_pos2 + 6.
? skip 2.
? write /l_pos1 l_title.
? uline at /l_pos1(16).
? skip.
? write at: /(11) '生產(chǎn)訂單',
???????????? (16) '組件/表頭',
???????????? (16) '更改動作',
???????????? (20) '新字段值',
???????????? (20) '舊字段值',
???????????? (08) '替代',
???????????? (08) '需求數(shù)',
???????????? (08) '更改帳號',
???????????? (15) '更改者IP',
???????????? (10) '更改者PC',
???????????? (10) '更改日期',
???????????? (10) '更改時間',
* { INCERT
???????????? (35) '工單狀態(tài)'.
* INCERT } DEVK910078

? uline.
endform.??????????????????? " write_header
*&---------------------------------------------------------------------*
*&????? Form? report_output
*&---------------------------------------------------------------------*
*?????? text
*----------------------------------------------------------------------*
form. report_output .
* { REPLACE
*? SORT i_zpco02 BY aufnr aenam laeda.
? sort i_zpco02 by aufnr laeda times matnr.
* REPLACE } DEVK910078
? data qty(13) type c .
? loop at i_zpco02.
??? write at: /(11) i_zpco02-aufnr ,? " '生產(chǎn)訂單',
?????????????? (16) i_zpco02-matnr ,? "? '物料號碼',
?????????????? (16) i_zpco02-filed .? "? '更改動作',
* { INCERT
??? set left scroll-boundary.
* INCERT } DEVK910078
??? if i_zpco02-filed = '新增組件' .
????? qty = i_zpco02-bdmng .
??? else .
????? qty = ''.
?? endif .
????? write at:? (20) i_zpco02-value_new
????????????????????? color 2,? "? '新字段值',
???????????????? (20) i_zpco02-value_old
????????????????????? color 3,? "? '舊字段值',
???????????????? (08) i_zpco02-alpos
????????????????????? color 4,
???????????????? (08) qty
????????????????????? color 5,????????? "? '需求數(shù)'
???????????????? (08) i_zpco02-aenam ,? "? '更改帳號',
???????????????? (15) i_zpco02-hostip , "? '更改者IP',
???????????????? (10) i_zpco02-host ,?? "? '更改者PC',
???????????????? (10) i_zpco02-laeda ,? "? '更改日期',
???????????????? (10) i_zpco02-times ,? "? '更改時間'.
???????????????? (35) i_zpco02-sttxt.? "'工單狀態(tài)'.

??? endloop.

? endform.??????????????????? " report_output 與50位技術(shù)專家面對面20年技術(shù)見證,附贈技術(shù)全景圖

總結(jié)

以上是生活随笔為你收集整理的工单更改历史记录的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 美腿丝袜亚洲色图 | 一级黄色短片 | 久久色网站 | 国产视频福利在线 | 久久成人午夜 | 久久在线视频精品 | 亚洲国产精品一区二区久久hs | 国产精品久久久久久久久久久久久久久久久久 | 欧美毛片基地 | 国产日韩一区二区三区在线观看 | 一极毛片 | 麻豆短视频在线观看 | 香蕉视频免费网站 | 麻豆人妻少妇精品无码专区 | 国产深夜视频 | 成人精品视频一区二区三区尤物 | 五月激情丁香婷婷 | 三级全黄做爰在线观看 | 日本a√在线观看 | 色呦呦视频在线 | 岛国片在线播放 | 波多野结衣在线视频免费观看 | 99免费看| 欧美黄色免费看 | 最好看的2019年中文在线观看 | 美女网站全黄 | 午夜在线观看免费视频 | 日韩av在线天堂 | 日韩大片一区二区 | 免费看又黄又无码的网站 | 国产精品xx| 成人三区 | 亚洲三级影院 | 欧美片在线观看 | 99re这里只有精品首页 | 极品少妇一区二区三区 | 久久久精品在线观看 | 成人漫画网站 | 亚洲国产精品视频一区二区 | 北条麻妃一区二区三区四区五区 | 国产日韩欧美精品一区二区 | 日韩久久电影 | 日韩aⅴ视频 | 男人天堂av网站 | 中文字幕视频一区 | 欧美性啪啪 | 亚洲国产成人在线视频 | 先锋av资源网站 | 国产女优在线播放 | 欧美精品久久天天躁 | 欧美成人午夜精品免费 | 成人在线毛片 | 亚洲精品乱码久久久久久日本蜜臀 | 在线看片你懂的 | 九色网站在线观看 | 午夜不卡影院 | 免费无码av片在线观看 | 日韩欧美在线观看免费 | 日本天堂网在线观看 | 亚洲色p| 一道本一区| 免费黄色入口 | 欧美一级片网址 | 国产又粗又猛又爽又黄的视频在线观看动漫 | 日韩一级网站 | 另类国产 | 国产一区二区三区四区五区在线 | 黑人巨茎大战欧美白妇 | 露出调教羞耻91九色 | 国产精品视频你懂的 | 不卡中文字幕在线观看 | 中文字幕人妻一区二区 | 日本不卡在线视频 | 国产xxxx做受视频 | 男男免费视频 | 蜜桃臀aⅴ精品一区二区三区 | 久草视频福利在线 | 欧美日韩黄色片 | 日韩精品亚洲一区 | 中文字字幕第183页 欧美特级一级片 | 韩国三级国产 | 成人黄性视频 | 四虎福利 | 一级片免费| 在线污视频 | av网址观看 | 亚洲欧美日韩一区二区三区在线观看 | 天天操天天爽天天干 | 国产xxxxx视频 | 欧洲精品久久久久毛片完整版 | 成年人免费在线看 | 欧美丰满一区二区免费视频 | 国产绿帽一区二区三区 | 999在线观看视频 | 免费看又黄又无码的网站 | 成人免费观看视频 | 黄色生活毛片 | 香蕉久久夜色精品 | 无码人妻一区二区三区免费n鬼沢 |