ts znasdiv2.0销售订单行项目接口_第1页
ts znasdiv2.0销售订单行项目接口_第2页
ts znasdiv2.0销售订单行项目接口_第3页
ts znasdiv2.0销售订单行项目接口_第4页
ts znasdiv2.0销售订单行项目接口_第5页
已阅读5页,还剩16页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

总体信 TS_ZNASDI08_V1.0销售订单行项目接口 FS_SD08_V1.0价格主数据接口.doc作者 夏最后修改日期 开发对象类型 报 负责该技术说明书顾问 文档修改历未解决Issue一、报表简单说1SAP中手工,然后下来并更新到E3S系统中,这样保持23456无78二、输入页三、输出页四、数据源说程序中使用的表条件(事务数据五、程序流A1在程序初始化中设置接口名参数为不可修改状态A2调用子程序frm_procure_datavbakvbap中取数据,放在gt_vbak中,从gt_vbak提取数据传到到gt_out中.A3frm_cust_tablezna_t_sd02A4调用子程序frm_process_data,将所需数据传到gt_final中,把需要上传的内容以文件形式备份到应该服务器的BACKUP 下,同时输出到OUTBOUND A5frm_write_logA5frm_show_data.ALV六、程序规1.SAP..ALV七、虚拟代码(Virtual ProgramID/Name: Datewritten:2008-09-Author's LastProgram Project Corr. *|||只传采购订单编号前2个字为“CG”*|||增加采购订单编号前2个字为“XT”的数据*|||采购单前两位为‘XT’异REPORTznasdi08MESSAGE-IDznasd01.INCLUDEznaca000formDATA:BEGINOFgt_vbakOCCURSvbelnLIKEvbak-vbeln, posnrLIKEvbap-posnr, matnrLIKEvbap-matnr, werksLIKEvbap-werks, audatLIKEvbak-audat, kunnrLIKEvbak-kunnr, objnrLIKEvbak-objnr, auartLIKEvbak-auart, kwmengLIKEvbap-kwmeng,"定单数量kbmengLIKEvbap-kbmeng,"销售定单中的销售数量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, "内部对象vtextLIKEt179t-vtext, "车系层次描述ccxdh(30), "车型号i_clr(30) c_clr(30) "ZL2007-11-20hylxwb(255)TYPE ZL2008-1-24xsgjsj(125)TYPEc, "海外订单文本-销售国家数据"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, "已确定库存数量,未排产计划数量(滞留交货单数量)pfmngLIKEvbfa-rfmng, "已经出具数量ZL2008-05-09ADDcgddhLIKEvbfa-vbeln,"采购订单号cgddxLIKEvbfa-posnn,"采购订单项目号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, "已确定库存数量,未排产计划数量(滞留交货单数量)kfmngLIKEvbfa-rfmng, dcmngLIKEvbfa-rfmng, scmngLIKEvbfa- pfmngLIKEvbfa-rfmng, "已经出具数量 audatLIKEvbak-audat, auartLIKEvbak-auart, kwmengLIKEvbap-kwmeng,kbmengLIKEvbap-kbmeng,"销售定单中的销售数量kunnoLIKElfa1-kunnr, name1LIKEkna1-name1, name2LIKEkna1- LIKEkonv- aufnr_txt(50TYPE LIKEaufk-aufnrbezeiLIKEtvagt-bezei, "原因,vbap-ABGRUprdhaLIKEmara-prdha, "产品层次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, "已确定库存数量,未排产计划数量(滞留交货单数量)ofmng(15)TYPEc, ffmng(15)TYPE wjmng(15TYPE pfmng(15)TYPEc, "已经出具数量 cwcqk(2)TYPEc, xsdzt(2)TYPE erdatLIKEvbak-erdat, ENDOFgw_content.DATA:BEGINOFbstkdLIKEvbkd- vbelnLIKEvbak- qfmng(15)TYPEc, "已确定库存数量,未排产计划数量(滞留交货单数量)ofmng(15)TYPEc, ffmng(15)TYPE wjmng(15TYPE pfmng(15)TYPE "已经出具数 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'"成功提取数''''''CHANGINGPERFORMfrm_append_logUSINGc_inf_'271''frm_get_sapdata'"没有产生变''''''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 *&功能说明:将处理记录的结果信息写入日志表 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."单价合计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,"已经出具数量1wl_a6_2LIKEvbfa-rfmng."已经出具数量*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已经出具数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有车未做交货单的数量=-有交货单的数量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. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论