ts znasdiv2.0銷售訂單行項(xiàng)目接口_第1頁
ts znasdiv2.0銷售訂單行項(xiàng)目接口_第2頁
ts znasdiv2.0銷售訂單行項(xiàng)目接口_第3頁
ts znasdiv2.0銷售訂單行項(xiàng)目接口_第4頁
ts znasdiv2.0銷售訂單行項(xiàng)目接口_第5頁
已閱讀5頁,還剩16頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

總體信 TS_ZNASDI08_V1.0銷售訂單行項(xiàng)目接口 FS_SD08_V1.0價格主數(shù)據(jù)接口.doc作者 夏最后修改日期 開發(fā)對象類型 報(bào) 負(fù)責(zé)該技術(shù)說明書顧問 文檔修改歷未解決Issue一、報(bào)表簡單說1SAP中手工,然后下來并更新到E3S系統(tǒng)中,這樣保持23456無78二、輸入頁三、輸出頁四、數(shù)據(jù)源說程序中使用的表?xiàng)l件(事務(wù)數(shù)據(jù)五、程序流A1在程序初始化中設(shè)置接口名參數(shù)為不可修改狀態(tài)A2調(diào)用子程序frm_procure_datavbakvbap中取數(shù)據(jù),放在gt_vbak中,從gt_vbak提取數(shù)據(jù)傳到到gt_out中.A3frm_cust_tablezna_t_sd02A4調(diào)用子程序frm_process_data,將所需數(shù)據(jù)傳到gt_final中,把需要上傳的內(nèi)容以文件形式備份到應(yīng)該服務(wù)器的BACKUP 下,同時輸出到OUTBOUND A5frm_write_logA5frm_show_data.ALV六、程序規(guī)1.SAP..ALV七、虛擬代碼(Virtual ProgramID/Name: Datewritten:2008-09-Author's LastProgram Project Corr. *|||只傳采購訂單編號前2個字為“CG”*|||增加采購訂單編號前2個字為“XT”的數(shù)據(jù)*|||采購單前兩位為‘XT’異REPORTznasdi08MESSAGE-IDznasd01.INCLUDEznaca000formDATA:BEGINOFgt_vbakOCCURSvbelnLIKEvbak-vbeln, posnrLIKEvbap-posnr, matnrLIKEvbap-matnr, werksLIKEvbap-werks, audatLIKEvbak-audat, kunnrLIKEvbak-kunnr, objnrLIKEvbak-objnr, auartLIKEvbak-auart, kwmengLIKEvbap-kwmeng,"定單數(shù)量kbmengLIKEvbap-kbmeng,"銷售定單中的銷售數(shù)量knumvLIKEvbak-knumv, abgruLIKEvbap- "原spartLIKEvbak-spart, "useMARA-SPARTfirstkkberLIKEvbak-kkber, knkliLIKEvbak-knkli, vtwegLIKEvbak-vtweg, "分銷bstkdLIKEvbkd-bstkd, bzirkLIKEvbkd-bzirk, bztxtLIKEt171t-bztxt, prdhaLIKEmara-prdha, "車系extwgLIKEmara-extwg, "車型stdpdLIKEmarc-stdpd, "可配置物料cuobjLIKEmarc-cuobj, "內(nèi)部對象vtextLIKEt179t-vtext, "車系層次描述ccxdh(30), "車型號i_clr(30) c_clr(30) "ZL2007-11-20hylxwb(255)TYPE ZL2008-1-24xsgjsj(125)TYPEc, "海外訂單文本-銷售國家數(shù)據(jù)"ZL2008-03-18ADDerdatLIKEvbap-erdat, ENDOFDATA:BEGINOFgt_vbfaOCCURSvbelvLIKEvbfa-vbelv,posnvLIKEvbfa-posnv,vbelnLIKEvbfa-vbeln,posnnLIKEvbfa-vbtyp_nLIKEvbfa-vbtyp_n,BOEO

vbtyp_vLIKEvbfa-vbtyp_v,"先期SD憑證的憑證類別fktypLIKEvbfa-fktyp, "出具類別rfmngLIKEvbfa- ENDOFDATA:BEGINOFgt_vbfa_sOCCURS0,vbelvLIKEvbfa-vbelv,posnvLIKEvbfa-posnv,ofmngLIKEvbfa-rfmng, ffmngLIKEvbfa-rfmng, qfmngLIKEvbfa-rfmng, "已確定庫存數(shù)量,未排產(chǎn)計(jì)劃數(shù)量(滯留交貨單數(shù)量)pfmngLIKEvbfa-rfmng, "已經(jīng)出具數(shù)量ZL2008-05-09ADDcgddhLIKEvbfa-vbeln,"采購訂單號cgddxLIKEvbfa-posnn,"采購訂單項(xiàng)目號ZL2008-05-09ADDENDOFDATA:BEGINOFgt_tvagtOCCURSabgruLIKEtvagt-abgru,bezeiLIKEtvagt-ENDOFDATA:BEGINOFvbelnLIKEvbak-vbeln, bstkdLIKEvbkd-bstkd, posnrLIKEvbap-posnr, kunnrLIKEvbak-kunnr, bzirkLIKEvbkd-bzirk, xssp(6)TYPEc, "銷售訂單kczt(6)TYPE xyzt(1)TYPEc, bztxtLIKEt171t-bztxt, ofmngLIKEvbfa- ffmngLIKEvbfa- wjmngLIKEvbfa-rfmng, qfmngLIKEvbfa-rfmng, "已確定庫存數(shù)量,未排產(chǎn)計(jì)劃數(shù)量(滯留交貨單數(shù)量)kfmngLIKEvbfa-rfmng, dcmngLIKEvbfa-rfmng, scmngLIKEvbfa- pfmngLIKEvbfa-rfmng, "已經(jīng)出具數(shù)量 audatLIKEvbak-audat, auartLIKEvbak-auart, kwmengLIKEvbap-kwmeng,kbmengLIKEvbap-kbmeng,"銷售定單中的銷售數(shù)量kunnoLIKElfa1-kunnr, name1LIKEkna1-name1, name2LIKEkna1- LIKEkonv- aufnr_txt(50TYPE LIKEaufk-aufnrbezeiLIKEtvagt-bezei, "原因,vbap-ABGRUprdhaLIKEmara-prdha, "產(chǎn)品層次prdha1(3)TYPE prdha3(3)TYPE mara-prdha3klimkLIKEknkk-klimk, spartLIKEmara-spart, gdmengLIKEvbbe-vmeng, cwcqk(4)TYPEc, xsdzt(4)TYPE erdatLIKEvbak-erdat, ENDOFgw_out.DATA:BEGINOFbstkdLIKEvbkd- vbelnLIKEvbak- qfmng(15)TYPEc, "已確定庫存數(shù)量,未排產(chǎn)計(jì)劃數(shù)量(滯留交貨單數(shù)量)ofmng(15)TYPEc, ffmng(15)TYPE wjmng(15TYPE pfmng(15)TYPEc, "已經(jīng)出具數(shù)量 cwcqk(2)TYPEc, xsdzt(2)TYPE erdatLIKEvbak-erdat, ENDOFgw_content.DATA:BEGINOFbstkdLIKEvbkd- vbelnLIKEvbak- qfmng(15)TYPEc, "已確定庫存數(shù)量,未排產(chǎn)計(jì)劃數(shù)量(滯留交貨單數(shù)量)ofmng(15)TYPEc, ffmng(15)TYPE wjmng(15TYPE pfmng(15)TYPE "已經(jīng)出具數(shù) cwcqk(2)TYPExsdzt(2)TYPEENDOFDATA:gt_outLIKETABLEOFgw_outWITHHEADERLINEgt_contentLIKETABLEOFDATA:gt_err_fileLIKETABLEOFgw_contentWITHHEADERLINE.TYPE-POOLS:slis.CONSTANTS:c_filename(6)VALUE'ZNSD08'.CONSTANTS:c_inf_(1)TYPEcVALUE'I'.CONSTANTS:c_war_(1)TYPEcVALUE'W'.CONSTANTS:c_err_(1)TYPEcVALUE'E'.CONSTANTS:c_succ_(1)TYPEcVALUEDATA:gt_finalLIKETABLEOFgw_finalWITHHEADERLINE.DATA:g_back_filename(32)TYPEc.DATA:g_message(255)TYPEDATA:gt_show_logLIKElineOCCURS0WITHHEADERDATA:wg_indexLIKEsy-tabix,i_flag(1).TABLES:SELECTION-SCREENBEGINOFBLOCKb1WITHFRAMETITLEtext-001.PARAMETER:p_fname(6)TYPEcDEFAULT'ZNSD08'MODIFIDSELECT-OPTIONS:s_datumFORvbak-erdat. SELECTION-SCREENENDOFBLOCKb1.CLEARs_datum-low=sy-datum-180.s_datum-high=sy-datum.s_datum-option='BT'.s_datum-sign='I'.APPENDPERFORMPERFORMfrm_procure_data.PERFORMPERFORMfrm_cust_tableTABLESgt_content.PERFORMfrm_translate_data.g_filename=c_filename."SettingthefilenameoflogfilePERFORMfrm_write_log.PERFORM Form FORMfrm_init_dataLOOPATSCREENIFscreen-group1='FNM'.screen-input=''.MODIFYMOVEp_fnameTO " Form FORMfrm_translate_dataDATA:l_subrcLIKEsy-subrc.DATA:l_file(200)TYPEc.IFgt_final[]ISNOT*WriteinternaltableintothespecificfolderofapplicationserverPERFORMfrm_outback_fileTABLES CHANGINGl_subrcl_file.IFl_subrcISPERFORMfrm_append_logUSINGc_succ_'270''frm_get_sapdata'"成功提取數(shù)''''''CHANGINGPERFORMfrm_append_logUSINGc_inf_'271''frm_get_sapdata'"沒有產(chǎn)生變''''''CHANGING*PutoutaPERFORMfrm_append_logUSINGc_inf_'271'''''''CHANGING " Form FORMfrm_cust_tableTABLESpt_finalSTRUCTUREgw_contentDATA:lt_sd08TYPETABLEOFzna_t_sd08WITHHEADERLINEDATA:lt_sd08_insertTYPETABLEOFzna_t_sd08WITHHEADERLINE.DATA:l_dateLIKEsy-datum.l_date=sy-datum-*RetrievealltheentriesfromSELECT*INTOCORRESPONDINGFIELDSOFTABLEFROMzna_t_sd08LOOPATREADTABLEWITHKEYbstkd=pt_final-bstkdvbeln=pt_final-vbelnqfmng=pt_final-qfmngofmng=pt_final-ofmngffmng=pt_final-ffmngwjmng=pt_final-wjmngpfmng=pt_final-pfmngcwcqk=pt_final-cwcqkxsdzt=pt_final-IFsy-subrcEQDELETEpt_finalWHEREbstkd=pt_final-bstkdANDvbeln=pt_final-*Modifytheidenticallineintocustomizingtablelt_sd08_insert-mandt=sy-mandt.MOVE-CORRESPONDINGpt_finalTOlt_sd08_insert.APPENDlt_sd08_insert.CLEAR:*ModifythenewlinesintocustomizingDELETEFROMzna_t_sd08WHEREerdat<l_date.MODIFYzna_t_sd08FROMTABLElt_sd08_insert.IFsy-subrc=0.COMMITROLLBACKPERFORMfrm_append_logUSINGc_err_'273'''''''CHANGING*Copytheentriestothetransfertablegt_finalCLEAR:gt_final,gt_final[].LOOPATMOVE-CORRESPONDINGlt_sd08_insertTOgt_final.APPENDgt_final.CLEAR:gt_final, Form *&功能說明:將處理記錄的結(jié)果信息寫入日志表 FORMfrm_append_logUSINGp_msgtypep_msgno p_parm2p_parm3 CHANGINGp_message.DATA:l_msg(255)TYPEPERFORMfrm_build_msgUSINGc_msg_cls_sdp_msgnoCHANGINGPERFORMfrm_add_logUSINGp_msgtypesy-datumsy-p_frmname "******--*<-**FORMfrm_procure_dataREFRESH:SELECTINTOCORRESPONDINGFIELDSOFTABLEFROMvbakASINNERJOINvbapASbONa~vbeln=b~vbelna~erdatINs_datum(a~auart='ZSOR'ORa~auart='ZDOR'ORa~auart='ZRE')."C- 的auart為'ZRE'.IFgt_vbak[]ISMESSAGEs203DISYLIKE MESSAGEs032WITHSORTgt_vbakBYvbelnSELECTa~vbelva~posnva~vbelna~posnna~vbtyp_na~rfmnga~vbtyp_va~fktypINTOCORRESPONDINGFIELDSOFTABLEFROMvbfaASFORALLENTRIESINWHEREa~vbelv=gt_vbak-vbelnANDa~posnv=gt_vbak-posnr.SELECTabgrubezeiINTOTABLEgt_tvagtFROMtvagtWHEREspras=sy-langu.SORTgt_tvagtBY " Form --> <-- FORMfrm_process_dataDATA:BEGINOFig_konvOCCURSknumvLIKEkonv-knumv,kposnLIKEkonv-kposn,stunrLIKEkonv-stunr,zaehkLIKEkonv-kschlLIKEkonv-kschl,"憑證類型kbetrLIKEkonv-kbetr,"價格waersLIKEkonv-waers,ENDOFDATA:wl_kwedjLIKEkonv-kbetr, wl_kwerxLIKEkonv-kbetr, wl_kwercLIKEkonv-kbetr, wl_kwerpLIKEkonv-kbetr, wl_kwehyLIKEkonv-kbetr, wl_kweroLIKEkonv-kbetr."單價合計(jì)DATA:BEGINOFl_msegOCCURS0aufnrLIKEafpo-aufnr,matnrLIKEafpo-matnr,mengeLIKEmseg-menge,budatLIKEmkpf-budat,ENDOFl_msegDATA:il_msegLIKEl_mseg.DATA:il_numTYPEi.DATA:wl_a2LIKEvbfa-rfmngwl_a3LIKEvbfa-rfmngwl_a4LIKEvbfa-rfmng,"wl_a6_1LIKEvbfa-rfmng,"已經(jīng)出具數(shù)量1wl_a6_2LIKEvbfa-rfmng."已經(jīng)出具數(shù)量*ZL2008-05-09ADDDATA:wl_a7_1LIKEvbfa-vbeln,"采購憑證wl_a7_2LIKEvbfa-posnn.*ZL2008-05-09ADDDATA:BEGINOFlt_afpoOCCURSaufnrLIKEafpo-aufnr,posnrLIKEafpo-ENDOFDATA:il_obtypLIKEjsto-obtyp,ll_stsmaLIKEjsto-stsma,il_stonrLIKEtj30-DATA:il_statusLIKESTANDARDTABLEOFjstatWITHHEADERDATAlw_vbupLIKEDATAl_cmgstLIKEvbuk-cmgst.DATAl_kalabLIKEmska-DATAl_delivery_qtyLIKEvbbe-vmeng.DATAl_curr_stockLIKEmard-labst.DATA:l_bstkdLIKEvbkd-bstkd,l_bzirkLIKEvbkd-bzirk,l_bztxtLIKEt171t-DATAl_yanse(3)TYPEDATAl_spartLIKEmara-spart.DATAl_fmengLIKEgt_out-ffmng.LOOPATgt_vbak.wg_index=sy-ATNEWModifybywyk2008-12-CLEAR:SELECTSINGLEbstkdINTOFROMvbkdWHEREvbeln=gt_vbak-vbelnANDbstkdLIKEFROMvbkdWHEREvbeln=gt_vbak-vbelnAND(bstkdLIKE'CG%'ORbstkdLIKE'XT%')."C-IFsy-subrcNEDELETEgt_vbakWHEREvbeln=gt_vbak-vbeln.gt_vbak-bstkd=CLEARSELECTSINGLEprdhaextwgspartINTO(gt_vbak-prdha,gt_vbak-extwg,l_spart)FROMmaraWHEREmatnr=gt_vbak-matnr.IFNOTl_spartISINITIAL.gt_vbak-spart=MODIFYgt_vbakINDEXSORTgt_vbfaBYvbelvposnv.LOOPATgt_vbfa.ATNEW IFgt_vbfa-vbtyp_n=SELECTSINGLE*INTOlw_vbupFROMvbupWHEREvbeln=gt_vbfa-vbelnANDposnr=gt_vbfa- IFlw_vbup-gbsta'AADDgt_vbfa-rfmngTOwl_a4.IFlw_vbup-gbsta'B'ANDlw_vbup-wbstaAORlw_vbup-wbstaB'ADDgt_vbfa-rfmngTOwl_a2.IFlw_vbup-gbstaB'ORlw_vbup-gbsta'C'ANDlw_vbup-wbsta='C'. ADDgt_vbfa-rfmngTO已經(jīng)出具數(shù)IFgt_vbfa-vbtyp_n=ADDgt_vbfa-rfmngTOIFgt_vbfa-vbtyp_n=ADDgt_vbfa-rfmngTOBOIFgt_vbfa-vbtyp_n=SELECTSINGLE*INTOlw_vbupFROMvbupWHEREvbeln=gt_vbfa-vbelnANDposnr=gt_vbfa-IFlw_vbup-gbsta'A'ANDlw_vbup-wbstaA'.ADDgt_vbfa-rfmngTOwl_a2.IFlw_vbup-gbstaB'ORlw_vbup-gbsta'C'ANDlw_vbup-wbsta='C'. ADDgt_vbfa-rfmngTOIFgt_vbfa-vbtyp_n='O'ANDgt_vbfa-vbtyp_v=ADDgt_vbfa-rfmngTOIF(gt_vbfa-vbtyp_n='S'ANDgt_vbfa-vbtyp_v='H')OR(gt_vbfa-vbtyp_n='S'ANDgt_vbfa-vbtyp_v='O'ANDgt_vbfa-fktyp='L').ADDgt_vbfa-rfmngTOwl_a6_2.EOATENDOF CLEARgt_vbfa_s-vbelv=gt_vbfa-vbelv.gt_vbfa_s-posnv=gt_vbfa-posnv.gt_vbfa_s-ofmng=wl_a2.gt_vbfa_s-ffmng=wl_a3.gt_vbfa_s-qfmng=wl_a4.gt_vbfa_s-pfmng=wl_a6_1-APPENDCOLLECT CLEARlw_vbup.SORTgt_vbfa_sBYvbelvposnv.LOOPATgt_vbak.CLEARREFRESHSELECTp~aufnrp~posnrINTOTABLElt_afpoFROMafpoASpINNERJOINaufkASkONk~aufnr=p~aufnrWHEREp~kdauf=gt_vbak-ANDp~kdpos=gt_vbak-ANDk~loekz=''. "NotdeletedLOOPATlt_afpo.IFsy-tabix=gt_out-aufnr_txt=lt_afpo-CONCATENATEgt_out-aufnr_txt','lt_afpo-aufnrINTOgt_out-MOVE-CORRESPONDINGgt_vbakTOgt_out.REFRESHig_konv.SELECTknumvkposnstunrzaehkkschlkbetrwaersINTOTABLEig_konvFROMkonvWHEREknumv=gt_vbak-knumvANDkposn=gt_vbak-posnr.LOOPATCASEig_konv-WHEN'ZPR1'.wl_kwedj=ig_konv-WHEN'ZK01'.wl_kwerx=ig_konv-WHEN'ZK04'.wl_kwerc=ig_konv-WHEN wl_kwerp=ig_konv-WHEN'ZK05'. wl_kwehy=ig_konv-kbetr.WHEN wl_kwero=ig_konv-gt_out-hj=gt_vbak-kwmeng*(wl_kwedj+wl_kwerx+wl_kwerc+wl_kwerp+wl_kwehy+wl_kwero).CLEAR:il_obtyp,ll_stsma,il_stonr.REFRESHil_status.CALLFUNCTION'STATUS_READ'=sy-mandt =gt_vbak- ='X' = = =il_stonr =il_statusobject_not_found= =READTABLEil_statusWITHKEYstat='E0002'.IFsy-subrc=0.gt_out-xssp='已'.gt_out-kcztgt_out-xssp='未READTABLEil_statusWITHKEYstat='E0001'.IFsy-subrc=0.gt_out-kcztREADTABLEgt_vbfa_sWITHKEYvbelv=gt_vbak-posnv=gt_vbak-posnrBINARYIFsy-subrc=MOVE-CORRESPONDINGgt_vbfa_sTO有車未做交貨單的數(shù)量=-有交貨單的數(shù)量gt_out-wjmng=gt_out-kbmeng-gt_out-ofmng-gt_out-ffmng-gt_out-gt_out-kfmng=gt_out-kwmeng-gt_out-DATAquan_wLIKEgt_out-quan_w=gt_out-pfmng-gt_out-IFquan_w=gt_out-cwcqk=ELSEIFquan_w<gt_out-cwcqk=IFgt_out-auartNE'ZSORCLEARSELECTSUM(kalab)INTOl_kalabFROMmskaWHEREvbeln=gt_vbak-ANDposnr=gt_vbak-gt_out-dcmng=l_kalab-gt_out-qfmng-gt_out-APPENDMOVE-CORRESPONDINGgt_outTOAPPENDgw_contentTOSORTgt_outBYvbelnDATA:l_qfmngLIKEgt_out-qfmng, l_ofmngLIKEgt_out-ofmng, l_ffmngLIKEgt_out-ffmng, l_wjmngLIKEgt_out-wjmng, l_pfmngLIKEgt_out-pfmng, l_kwmengLIKEgt_out- LOOPATl_qfmng=l_qfmng+gt_out-qfmng.l_ofmng=l_ofmng+gt_out-ofmng.l_ffmng=l_ffmng+gt_out-ffmng.l_wjmng=l_wjmng+gt_out-wjmng.l_pfmng=l_pfmng+gt_out-pfmng.l_kwmeng=l_kwmeng+gt_ou

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論