Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
A campaign is a complete, planned course of action formulated to achieve defined objectives in marketing, public relations, quality enhancement, revenue generation, safety standards etc.

In SAP Business One you can use the Campaign window to manage your marketing events information. You can perform the following tasks:

  • Viewing and Maintaining the Campaign Data.

  • Generating Sales Opportunities and Leads from a Campaign.


To access this window, from the SAP Business One Main Menu, choose

Business Partners → Campaign

You can refer to following link for further information on Campaign:

https://help.sap.com/saphelp_sbo92/helpdata/en/cf/91c40283a64949aa453ab51875bfef/content.htm

Using Campaign in SAP Business One SDK:


Campaign is exposed as a Service Type Object (CampaignsService) in SAP Business One SDK. You can use it following ways using DI API:

Create a Campaign Document using DI API:
SAPbobsCOM.CampaignsService oCampaignService = oCompany.GetCompanyService().GetBusinessService(SAPbobsCOM.ServiceTypes.CampaignsService);
SAPbobsCOM.Campaign oCampaign = oCampaignService.GetDataInterface(SAPbobsCOM.CampaignsServiceDataInterfaces.csCampaign);
SAPbobsCOM.CampaignParams oCampaignParams = (SAPbobsCOM.CampaignParams)oCampaignService.GetDataInterface(SAPbobsCOM.CampaignsServiceDataInterfaces.csCampaignParams);
oCampaign.TargetGroupType = SAPbobsCOM.TargetGroupTypeEnum.tgtCustomer;
oCampaign.StartDate = DateTime.Today;
oCampaign.FinishDate = DateTime.Today.AddYears(1);
oCampaign.Remarks = "This is a test for Campaign using DI API.";
oCampaign.CampaignName = "TEST Campaign";
oCampaign.CampaignBusinessPartners.Add().BPCode = "C20000";
oCampaign.CampaignItems.Add().ItemCode = "A00001";
oCampaign.AttachementsEntry = 2; // AbsEntry from the OATC Table
oCampaignService.Add(oCampaign);

Update a Campaign Document using DI API:
SAPbobsCOM.CampaignsService oCampaignService = oCompany.GetCompanyService().GetBusinessService(SAPbobsCOM.ServiceTypes.CampaignsService);
SAPbobsCOM.Campaign oCampaign = oCampaignService.GetDataInterface(SAPbobsCOM.CampaignsServiceDataInterfaces.csCampaign);
SAPbobsCOM.CampaignParams oCampaignParams = (SAPbobsCOM.CampaignParams)oCampaignService.GetDataInterface(SAPbobsCOM.CampaignsServiceDataInterfaces.csCampaignParams);
oCampaignParams.CampaignNumber = 2;
oCampaign = oCampaignService.Get(oCampaignParams);
oCampaign.CampaignItems.Add().ItemCode = "A00002";
oCampaignService.Update(oCampaign);

Cancel a Campaign Document using DI API:
SAPbobsCOM.CampaignsService oCampaignService = oCompany.GetCompanyService().GetBusinessService(SAPbobsCOM.ServiceTypes.CampaignsService);
SAPbobsCOM.Campaign oCampaign = oCampaignService.GetDataInterface(SAPbobsCOM.CampaignsServiceDataInterfaces.csCampaign);
SAPbobsCOM.CampaignParams oCampaignParams = (SAPbobsCOM.CampaignParams)oCampaignService.GetDataInterface(SAPbobsCOM.CampaignsServiceDataInterfaces.csCampaignParams);
oCampaignParams.CampaignNumber = 3;
oCampaignService.Cancel(oCampaignParams);

Remove/Delete a Campaign Document using DI API:
SAPbobsCOM.CampaignsService oCampaignService = oCompany.GetCompanyService().GetBusinessService(SAPbobsCOM.ServiceTypes.CampaignsService);
SAPbobsCOM.Campaign oCampaign = oCampaignService.GetDataInterface(SAPbobsCOM.CampaignsServiceDataInterfaces.csCampaign);
SAPbobsCOM.CampaignParams oCampaignParams = (SAPbobsCOM.CampaignParams)oCampaignService.GetDataInterface(SAPbobsCOM.CampaignsServiceDataInterfaces.csCampaignParams);
oCampaignParams.CampaignNumber = 3;
oCampaignService.Delete(oCampaignParams);