Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ProcessData Function
- '
- Function Run_VB_Script_Function()
- Dim oCmpSrv
- Dim PLIST
- Dim oPickListLines
- Dim lRet
- Dim lErrCode
- Dim sErrMsg
- Dim errCode
- Dim errDesc
- Dim transstate
- Dim i
- Dim j
- Dim k
- Dim l
- Dim Aux
- Dim Cn
- On Error Resume Next
- Set oCmpSrv = CreateObject("SAPbobsCOM.Company")
- oCmpSrv.Server = ""
- oCmpSrv.CompanyDB = "SBO_PA_UK_LIVE"
- oCmpSrv.UserName = "manager"
- oCmpSrv.Password = "ram"
- oCmpSrv.Language = 3
- oCmpSrv.UseTrusted = False
- oCmpSrv.DbServerType = 10
- oCmpSrv.DbUserName = "sa"
- oCmpSrv.DbPassword = ""
- oCmpSrv.SLDServer = "pal-sql01:40000"
- lRet = oCmpSrv.Connect
- If lRet <> 0 Then
- lErrCode = oCmpSrv.GetLastErrorCode
- sErrMsg = oCmpSrv.GetLastErrorDescription
- ThisStep.LogError sErrMsg
- 'Throw exception
- Err.Raise CLng(lErrCode), CStr(sErrMsg)
- Else
- Variables("sboCompany") = oCmpSrv
- ThisStep.LogInfo "STEP 0 - DATABASE CONNECTED "
- End If
- Set PLIST = oCmpSrv.GetBusinessObject(156)
- PLIST.Name = "test"
- PLIST.OwnerCode = 1
- PLIST.Lines.BaseObjectType = 202
- PLIST.Lines.OrderEntry = 2
- PLIST.Lines.OrderRowID = 0
- PLIST.Lines.ReleasedQuantity = 150
- 'PLIST.Lines.Add()
- ' PLIST.Lines.BaseObjectType = 202
- ' PLIST.Lines.OrderEntry = 2
- ' PLIST.Lines.OrderRowID = 1
- ' PLIST.Lines.ReleasedQuantity = 250
- lret=PLIST.Add()
- lErrCode = oCmpSrv.GetLastErrorCode
- sErrMsg = oCmpSrv.GetLastErrorDescription
- ThisStep.LogError sErrMsg
- ThisStep.LogInfo lret
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement