Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

DI Services

I am Using the following code in Visual Basic 6.0 :

Dim oCmpSrv As SAPbobsCOM.CompanyService

Dim oReportLayoutService As ReportLayoutsService

Dim oReportLayout As ReportLayout

Dim oReportParam As ReportParams

'get company service

Set oCmpSrv = oCompany.GetCompanyService

'get report layout service

Set oReportLayoutService = oCmpSrv.GetBusinessService(ServiceTypes.ReportLayoutsService)

'get report params

Set oReportParam = oReportLayoutService.GetDataInterface(ReportLayoutsServiceDataInterfaces.rlsdiReportParams)

'report code is the document type code (POR2=PurchaseOrder)

oReportParam.CardCode = "POR2"

'get the default layout of the specific document

Set oReportLayout = oReportLayoutService.GetDefaultReportLayout(oReportParam)

'set the new layout name

oReportLayout.Name = "My layout"

'set the new author name

oReportLayout.Author = "My Author"

'add the new layout to the specific document

oReportLayoutService.AddReportLayout (oReportLayout)

Then the system show the error : "run-time error'-2028"

when is executing the step : 'get the default layout of the specific document

Not what you were looking for? View more on this topic or Ask a question