MessageBox.Show("开始导入!请稍等")
DataTables("SAP领料数据2").DeleteFor("")
Dim DD1 As String
= e.Form.Controls("textbox1").VALUE
Dim DD2 As String =
e.Form.Controls("textbox2").VALUE
Dim v = New
ClassLibrary1.Class4().getvalue(dd1,dd2)
If v.Length > 0 Then
For i As Integer = 0 To v.Length -1
Dim dr As DataRow
dr = DataTables("SAP领料数据2").AddNew()
If v(i).MATNR = "" Then
dr("物料编号") =
v(i).MATNR
Else If v(i).MATNR.Length >0 Then
dr("物料编号") =
v(i).MATNR.Substring(v(i).MATNR.length - 8)
End If
dr("物料描述") =
v(i).MAKTX
dr("单位") =
v(i).MEINS
dr("数量") =
v(i).MENGE
dr("单价") =
v(i).NETPR
dr("总金额") =
v(i).DMBTR
dr("借贷方标识") =
v(i).SHKZG
dr("库存地点") = v(i).LGORT
dr("库存地点描述") = v(i).LGOBE
dr("所属部门") = v(i).LGOBE
dr("过账日期") = v(i).BUDAT
'输入日期是字符型
dr("输入日期")
=v(i).CPUDT.Substring(5,2)&"/"&v(i).CPUDT.Substring(8,2)&"/"&v(i).CPUDT.Substring(2,2)
dr("输入时间") = v(i).CPUTM
dr("员工姓名") = v(i).NAME
dr("项目编号") = v(i).ZWRXM
dr("项目名称") = v(i).ZWRXMMC
dr("物料凭证编号") = v(i).MBLNR
dr("物料凭证年度") = v(i).MJAHR
dr("物料凭证项目号") = v(i).ZEILE
dr("成本中心") = v(i).KOSTL
dr("成本中心描述") =
v(i).KTEXT
dr("移动类型") =
v(i).BWART
dr("抬头文本") =
v(i).BKTXT
dr("项目文本") =
v(i).SGTXT
dr("发货单编号") =
v(i).XABLN
dr("接收方") =
v(i).WEMPF
dr("导入日期")
=Date.Today()
dr("导入时间")
=Date.Now
dr("会计科目借方") =
v(i).HKONT
dr("会计科目贷方") =
v(i).HKONT1
dr("借方描述") =
v(i).TXT50
dr("贷方描述") =
v(i).TXT501
dr("月份") =
v(i).BUDAT.Substring(2,2)&"年"&v(i).BUDAT.Substring(5,2)&"月"
dr("发货实际金额") =
v(i).GI_PHY
dr("发货差异") =
v(i).GI_DIF
Next
endif