您好,欢迎访问三七文档
当前位置:首页 > 行业资料 > 其它行业文档 > SAP MM库存初始化以及批量扩充库位
SAPMM库存初始化和批量扩充物料仓位.分类:SAP-ALLABAP2011-12-1910:191418人阅读评论(0)收藏举报sapparametersheaderinsertpathuser库存初始化和批量扩充物料仓位这两个功能合在一个程序里。SAP刚上线时这两功能很管用。*&---------------------------------------------------------------------**&ReportZR_KTK_MM_0017*&*&---------------------------------------------------------------------**&*&*&---------------------------------------------------------------------*REPORTZR_KTK_MM_0017.TABLES:MKPF,RM07M,MSEG,T100,RM03M.DATA:BDCDATALIKEBDCDATAOCCURS0WITHHEADERLINE.*messagesofcalltransactionDATA:MESSTABLIKEBDCMSGCOLLOCCURS0WITHHEADERLINE.DATA:E_GROUP_OPENED,E_KEEP(1)TYPEC,SMALLLOG(1)TYPEC.DATA:BEGINOFRECORDOCCURS0,BLDATLIKEMKPF-BLDAT,创建日期BUDATLIKEMKPF-BUDAT,过账日期SOBKZLIKERM07M-SOBKZ,特殊库存WERKSLIKERM07M-WERKS,工厂LGORTLIKEMSEG-LGORT,仓码MATNRLIKEMSEG-MATNR,料号*ERFMGLIKEMSEG-ERFMG,数量ERFMG(13)typec,数量ERFMELIKEMSEG-ERFME,单位ENDOFRECORD.DATA:BEGINOFRECORD1OCCURS0,MATNRLIKERM03M-MATNR,料号WERKSLIKERM03M-WERKS,工厂LGORTLIKERM03M-LGORT,仓码ENDOFRECORD1.SELECTION-SCREENBEGINOFBLOCKBLOCK1WITHFRAME.******NAPARAMETERSCTUMODELIKECTU_PARAMS-DISMODEDEFAULT'N'NO-DISPLAY.*PARAMETERSCTUMODELIKECTU_PARAMS-DISMODEDEFAULT'P'.PARAMETERSCUPDATELIKECTU_PARAMS-UPDMODEDEFAULT'L'NO-DISPLAY.PARAMETERSE_GROUP(12)NO-DISPLAY.groupnameoferror-sessionPARAMETERS:E_USER(12)DEFAULTSY-UNAMENO-DISPLAY.userforerror-session*PARAMETERS:E_KEEPASCHECKBOX.''=deletesessioniffinished'X'=keepsessioniffinishedPARAMETERS:E_HDATELIKESY-DATUMNO-DISPLAY.*SELECTION-SCREENSKIP.PARAMETERS:NODATADEFAULT''LOWERCASENO-DISPLAY.nodata*PARAMETERS:SMALLLOGASCHECKBOX.''=logalltransactions'X'=notransactionloggingPARAMETERS:p_qtyRADIOBUTTONGROUPg1.PARAMETERS:p_matRADIOBUTTONGROUPg1.PARAMETERS:FILENAME(132)LOWERCASEDEFAULT'C:\data.xls'.SELECTION-SCREENENDOFBLOCKBLOCK1.*&------------------------------------------------------------------**&ATSELECTION-SCREENONVALUE-REQUESTFOR*&------------------------------------------------------------------*ATSELECTION-SCREENONVALUE-REQUESTFORFILENAME.CALLFUNCTION'WS_FILENAME_GET'EXPORTING*DEF_FILENAME='c:\test.xls'defaultselectedfileDEF_PATH='c:'Defaultpath*MASK=',*.txt,*.txt.'MASK=',*.xls,*.xls.'MODE='0'TITLE='Selectafiletoopen'IMPORTINGFILENAME=FILENAME*RC=EXCEPTIONSINV_WINSYS=1NO_BATCH=2SELECTION_CANCEL=3SELECTION_ERROR=4OTHERS=5.*&------------------------------------------------------------------*START-OF-SELECTION.IFP_QTY='X'.PERFORMINITIALIZE_QTY.ELSE.PERFORMINITIALIZE_MAT.ENDIF.PERFORMCLOSE_GROUP.END-OF-SELECTION.FORMINITIALIZE_QTY.DATA:FILENAME1LIKERLGRAP-FILENAME.FILENAME1=FILENAME.TYPE-POOLS:truxs.DATA:l_raw_dataTYPEtruxs_t_text_data.CALLFUNCTION'TEXT_CONVERT_XLS_TO_SAP'EXPORTING*I_FIELD_SEPERATOR=*I_LINE_HEADER=i_tab_raw_data=l_raw_datai_filename=filename1TABLESi_tab_converted_data=record*EXCEPTIONS*CONVERSION_FAILED=1*OTHERS=2.IFsy-subrc0.MESSAGEE398(00)WITH'数据在导入内表时出错!'.ENDIF.LOOPATRECORD.performbdc_dynprousing'SAPMM07M''0400'.performbdc_fieldusing'BDC_CURSOR''RM07M-WERKS'.performbdc_fieldusing'BDC_OKCODE''/00'.performbdc_fieldusing'MKPF-BLDAT'RECORD-BLDAT.performbdc_fieldusing'MKPF-BUDAT'RECORD-BUDAT.performbdc_fieldusing'RM07M-BWARTWA''561'.performbdc_fieldusing'RM07M-WERKS'RECORD-WERKS.performbdc_fieldusing'XFULL''X'.performbdc_fieldusing'RM07M-WVERS2''X'.performbdc_dynprousing'SAPMM07M''0421'.performbdc_fieldusing'BDC_CURSOR''MSEG-LGORT(01)'.performbdc_fieldusing'BDC_OKCODE''=BU'.performbdc_fieldusing'MSEG-MATNR(01)'RECORD-MATNR.performbdc_fieldusing'MSEG-ERFMG(01)'RECORD-ERFMG.performbdc_fieldusing'MSEG-ERFME(01)'RECORD-ERFME.performbdc_fieldusing'MSEG-LGORT(01)'RECORD-LGORT.performbdc_fieldusing'MSEG-WERKS(01)'RECORD-WERKS.performbdc_fieldusing'DKACB-FMORE''X'.performbdc_dynprousing'SAPLKACB''0002'.performbdc_fieldusing'BDC_OKCODE''=ENTE'.performbdc_dynprousing'SAPLKACB''0002'.performbdc_fieldusing'BDC_OKCODE''=ENTE'.performbdc_transactionusing'MB1C'.ENDLOOP.ENDFORM.FORMINITIALIZE_MAT.DATA:FILENAME1LIKERLGRAP-FILENAME.FILENAME1=FILENAME.TYPE-POOLS:truxs.DATA:l_raw_dataTYPEtruxs_t_text_data.CALLFUNCTION'TEXT_CONVERT_XLS_TO_SAP'EXPORTING*I_FIELD_SEPERATOR=*I_LINE_HEADER=i_tab_raw_data=l_raw_datai_filename=filename1TABLESi_tab_converted_data=record1*EXCEPTIONS*CONVERSION_FAILED=1*OTHERS=2.IFsy-subrc0.MESSAGEE398(00)WITH'数据在导入内表时出错!'.ENDIF.LOOPATRECORD1.performbdc_dynprousing'SAPMM03M''0105'.performbdc_fieldusing'BDC_CURSOR''RM03M-WERKS'.performbdc_fieldusing'BDC_OKCODE''/00'.performbdc_fieldusing'RM03M-MATNR'RECORD1-MATNR.performbdc_fieldusing'RM03M-WERKS'RECORD1-WERKS.performbdc_fieldusing'RM03M-LFLAG''X'.performbdc_dynprousing'SAPMM03M''0195'.performbdc_fieldusing'BDC_CURSOR''RM03M-LGORT(09)'.performbdc_fieldusing'BDC_OKCODE''=BU'.performbdc_fieldusing'RM03M-LGORT(09)'RECORD1-LGORT.performbdc_transactionusing'MMSC'.ENDLOOP.ENDFORM.*&---------------------------------------------------------------------**&FormBDC_TRANSACTION*&---------------------------------------------------------------------**----------------------------------------------------------------------**Startnewtransactionaccordingtoparameters**---------
本文标题:SAP MM库存初始化以及批量扩充库位
链接地址:https://www.777doc.com/doc-5158625 .html