Advertisement
Guest User

Untitled

a guest
Jun 20th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. ProcessData Function
  2. '
  3. Function Run_VB_Script_Function()
  4.  
  5. Dim oCmpSrv
  6. Dim PLIST
  7. Dim oPickListLines
  8. Dim lRet
  9. Dim lErrCode
  10. Dim sErrMsg
  11. Dim errCode
  12. Dim errDesc
  13. Dim transstate
  14. Dim i
  15. Dim j
  16. Dim k
  17. Dim l
  18. Dim Aux
  19. Dim Cn
  20.  
  21. On Error Resume Next
  22.  
  23. Set oCmpSrv = CreateObject("SAPbobsCOM.Company")
  24. oCmpSrv.Server = ""
  25. oCmpSrv.CompanyDB = "SBO_PA_UK_LIVE"
  26. oCmpSrv.UserName = "manager"
  27. oCmpSrv.Password = "ram"
  28. oCmpSrv.Language = 3
  29. oCmpSrv.UseTrusted = False
  30. oCmpSrv.DbServerType = 10
  31. oCmpSrv.DbUserName = "sa"
  32. oCmpSrv.DbPassword = ""
  33. oCmpSrv.SLDServer = "pal-sql01:40000"
  34.  
  35. lRet = oCmpSrv.Connect
  36. If lRet <> 0 Then
  37.  
  38. lErrCode = oCmpSrv.GetLastErrorCode
  39. sErrMsg = oCmpSrv.GetLastErrorDescription
  40.  
  41. ThisStep.LogError sErrMsg
  42.  
  43. 'Throw exception
  44. Err.Raise CLng(lErrCode), CStr(sErrMsg)
  45.  
  46. Else
  47. Variables("sboCompany") = oCmpSrv
  48. ThisStep.LogInfo "STEP 0 - DATABASE CONNECTED "
  49. End If
  50.  
  51. Set PLIST = oCmpSrv.GetBusinessObject(156)
  52.  
  53.  
  54. PLIST.Name = "test"
  55. PLIST.OwnerCode = 1
  56.  
  57. PLIST.Lines.BaseObjectType = 202
  58. PLIST.Lines.OrderEntry = 2
  59. PLIST.Lines.OrderRowID = 0
  60. PLIST.Lines.ReleasedQuantity = 150
  61.  
  62. 'PLIST.Lines.Add()
  63. ' PLIST.Lines.BaseObjectType = 202
  64. ' PLIST.Lines.OrderEntry = 2
  65. ' PLIST.Lines.OrderRowID = 1
  66. ' PLIST.Lines.ReleasedQuantity = 250
  67.  
  68. lret=PLIST.Add()
  69. lErrCode = oCmpSrv.GetLastErrorCode
  70. sErrMsg = oCmpSrv.GetLastErrorDescription
  71.  
  72. ThisStep.LogError sErrMsg
  73. ThisStep.LogInfo lret
  74.  
  75.  
  76.  
  77. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement