Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' ProcessData Function
- '
- Function Run_VB_Script()
- Dim oCmpSrv
- Dim PLIST
- Dim oPickListLines
- Dim lRet
- Dim lErrCode
- Dim sErrMsg
- Dim errCode
- Dim errDesc
- Dim transstate
- On Error Resume Next
- Set oCmpSrv = CreateObject("SAPbobsCOM.Company")
- oCmpSrv.Server = "SERVER02"
- oCmpSrv.CompanyDB = "SBO_IB_LIVE"
- oCmpSrv.UserName = "manager"
- oCmpSrv.Password = "1234"
- oCmpSrv.Language = 3
- oCmpSrv.UseTrusted = False
- oCmpSrv.DbServerType = 8
- oCmpSrv.DbUserName = "sa"
- oCmpSrv.DbPassword = "SAPB1Admin"
- 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
- Dim Doc
- Dim canceldoc
- Set doc = oCmpSrv.GetBusinessObject(13)
- doc.GetByKey(40425)
- Set cancelDoc = doc.CreateCancellationDocument()
- lret=cancelDoc.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