Skip to Content
Sep 28, 2018 at 02:07 PM

It's possible to change an Activity (OCLG) object from one Service Call (OSCL) object to another?

143 Views Last edit Sep 28, 2018 at 07:50 PM 3 rev


I am developing an api restful in C# which receives a JSON object and inserts it into SAP, my problem is transfer this Activity (OCLG) object from one Service Call (OSCL) object to another if the operator was wrong.

Example Code:

// Connection to SAP... oCompany object....

CompanyService oCompanyService = oCompany.GetCompanyService();

ServiceCalls oServiceCalls = (ServiceCalls)oCompany.GetBusinessObject(BoObjectTypes.oServiceCalls);

ActivitiesService oActivitiesService = (ActivitiesService)oCompanyService.GetBusinessService(ServiceTypes.ActivitiesService);

Activity oActivity = oActivitiesService.GetDataInterface(ActivitiesServiceDataInterfaces.asActivity);

// variable assignment ...

ActivityParams oActivityParams = oActivitiesService.AddActivity(oActivity);

int oActivityCode = oActivityParams.ActivityCode;


oServiceCalls.Activities.SetCurrentLine(oServiceCalls.Activities.Count - 1);

oServiceCalls.Activities.ActivityCode = oActivityCode;


How can I change the activity of the call service? // SCL5 relationship.


through a query would be:

UPDATE SCL5 SET SrvcCallId = new_service_call_id WHERE SrvcCallId = old_service_call_id AND ClgID = object_id