0% found this document useful (0 votes)
330 views

Sap Pi Salesforce Bulk API

1. The document discusses how to use the Salesforce Bulk API in SAP PI to perform bulk data operations in Salesforce. It involves creating a job, adding data to the job in batches, and closing the job. 2. A CCBPM process is used to call the Bulk API asynchronously in four steps - login, create job, add data to job, and close job. 3. Session ID and URL details are passed dynamically between steps using export/import parameters and SOAP lookups. This allows bulk insertion of thousands of records from PI into Salesforce.

Uploaded by

sukande
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
330 views

Sap Pi Salesforce Bulk API

1. The document discusses how to use the Salesforce Bulk API in SAP PI to perform bulk data operations in Salesforce. It involves creating a job, adding data to the job in batches, and closing the job. 2. A CCBPM process is used to call the Bulk API asynchronously in four steps - login, create job, add data to job, and close job. 3. Session ID and URL details are passed dynamically between steps using export/import parameters and SOAP lookups. This allows bulk insertion of thousands of records from PI into Salesforce.

Uploaded by

sukande
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

SAP PI SALESFORCE BULK API

InthisblogImgoingtogiveanideahowwecanachievebulkAPIusingSOAPadapterandCCBPMinPI.
SalesforcesupportsthreeAPIsfordataintegration.1.SOAPAPI(Synchronous)Itsupportonly200records
foranyoperationslikeinsert/updateanddelete.2.RESTAPI(Synchronous)Italsosupportonly200records
foranyoperations3.BULKAPI(Asynchronous)Itsupport10,000recordspermessage.SOAPAPIalready
wellexplainedinthislinkbyPrasanna,ItriedBULKAPIbyusingSOAPadapterwithCCBPMinPI.

BULK API
Itisusefulwhenyouaretryingtobulkinsert,updateandupsertinsalesforce.Ifyourinterfaceperformsbelow
threeoperationsforsalesforcethenitperformtheBULKAPI.
1.CreateJob
2.AddJob
3.CloseJob

LogicalFlow:

Pleasecheckthelinkformoreinformation
https://www.salesforce.com/us/developer/docs/api_asynch/index_Left.htm#CSHID=asynch_api_quickstart_req
uests_intro.htm|StartTopic=Content%2Fasynch_api_quickstart_requests_intro.htm|SkinName=webhelpforbulk
API.SampleexampleprovidedinlinktoloaddatausingCURL,hereItriedtocomparetheCURLexample
withmydevelopmentinPI.

ToPerformabovestepsweneedBPMtoachieve.HereiusedCCBPMtofollowthestepsinsingleinterface.

CCBPMforBulkAPI:

Step1SalesforceLogin:
ForthiswecanuseSOAPLookupinmessagemappingtologinintosalesforcetogettheSessionIdand
ServerURL.Pleasechecklinkhttp://scn.sap.com/community/piandsoa
middleware/blog/2006/11/20/webservicecallsfromauserdefinedfunctionforSOAPLookup.

Step2CreateJob:
Beforeyousendthedatatoperformsomeoperationinsaleforce,youneedtopreparethejobbyproviding
whichoperationyouaregoingtoperformforobject.ForthatyouneedtoprepareJobxmltorequestto
salesforce.Onceyourequestsalesforce,itwillpreparethejobandprovideyoutheresponsemessagewithjobid,
byusingthisjobidyoucansendbulkdatatoperformoperationinslaesforce.

CreaterequestmappingforpreparingJob.xmlwithsoaplookupUDFtogetsessionidandassignit
dynamicallyinhttpheadersforthesoapadapter.

UDFSnippets:(Assignsessionidandcontenttypetotheheaders)

CommunicationChannel:
ChanneltosendJob.xmltosalesforce:
Httpurlhttps://instance.salesforce.com/services/async/30.0/job
HttpheadersXSFDCSessionandContentType

UseVariabletransportbindingfordynamicsessionandcontenttypeinhttpheaderswhichweassignedinUDF
(XHeaderName1&XHeaderName2).

TheresponseofthismessagewillcontainJobid,assignthisidtoBPMbyusingexportparameterizedmapping
fortheresponsemessage.
Responsemessagemapping:

UseUDFtoassignjobidtoexportparameterforCCBPM.

CreateExportparameterinmapping.

Step3AddJob:
Onceyoucompletedthestep2(createjob)inPI,youwillhavethejobidinCCBPMtosenddatatoperform
bulkoperationinsalesforce.Youneedtopreparetheaddjoburlbyappendingurlwithjobid/batch.Herewe
cansendXMLdatatoperformoperationinsalesforceobject.
CreateRequestmapping:

CCBPM:ImportParameter:

UDFSnippets:(Assignsessionid,contenttypeandhttpurltotheheaders)

CommunicationChannel:
ChanneltosendJob.xmltosalesforce:
HttpurlTServerLocation
HttpheadersXSFDCSessionandContentType

UseVariabletransportbindingfordynamicURL,sessionandcontenttypeinhttpheaderswhichweassignedin
UDF(XHeaderName1,XHeaderName2&XHeaderName3).

Step4CloseJob:
Onceabovestepscompletedwecanclosethejobusingthesamejobid.Hereweneedtopassthexmldatawith
statusclosedtosalesforceusingtheurlwithjobidtoclosethejob.

CCBPM:ImportParameter

UDFSnippets:(Assignsessionid,contenttypeandhttpurltotheheaders)

CommunicationChannel:
ChanneltosendJob.xmltosalesforce:
HttpurlTServerLocation
HttpheadersXSFDCSessionandContentType

UseVariabletransportbindingfordynamicURL,sessionandcontenttypeinhttpheaderswhichweassignedin
UDFfor(XHeaderName1,XHeaderName2&XHeaderName3).

ThisblogistojustgivingideathatSalesforcebulkAPIispossibleinPIbyusingSOAPadapter,Parameterized
mapping,BPMandvariabletransportbinding.InNextblogIwilltrytocoverstepbystepproceduretousebulk
APIinPI.
Thisismyfirstblog,Pleaseshareyourthoughts/feedbackandyoursolutiontoachieveSalesforceBULKAPI.

You might also like