Beruflich Dokumente
Kultur Dokumente
Integration framework
for SAP Business One
Guide 06
APIs
-1-
Content
1. API Call........................................................................................................3 1.1 JobCreator..............................................................................................4 1.2 B1ifAPI ...................................................................................................6 2. SLD Entry ....................................................................................................7 2.1 Create, Update, Delete an SLD entry.....................................................7 2.2 Generate a new SLD entry ...................................................................12 3. Scenario APIs ............................................................................................14 3.1 Scenario Refresh..................................................................................14 3.2 Scenario Activation/Deactivation ..........................................................15 3.3 Add a System to an existing Scenario Package ...................................16 3.4 Generate/Add a System to an existing Scenario Package ...................17 3.5 Delete a System in an existing Scenario Package ...............................19 Copyrights, Trademarks, and Disclaimers .....................................................20
-2-
1. API Call
The APIs in the Integration framework are bizflows. There are multiple ways how to call them. You can call the APIs synchronously via the Include atom inside your processing flow. How to call them in an asynchronous manner, please check the following graphic which depicts the the API infrastructure.
APIs gets called asynchronous via jobs. The setup routine of B1if is calling the JobCreator which is adding a new job into the internal jobqueue document. You can also us this mechanism during the processing flow via the Include atom to call the JobCreator. Whenever you start/re-start the B1if server, the JobExecutor is triggered. The JobExecutor retrieves all jobs from the internal jobqueue document and stored API jobs into the internal Job Queue. You can also use the atom Put To Internal Queue during an processing flow to add new jobs directly to this queue. The name of the queue is Q.JobQueue and the name of the stream is S.Job. You can also call via http the API inbound B1ifAPI to store a job into the internal Job Queue. The APICaller is triggered by entries in the internal Job Queue and will call the appropriate API. APICaller is following strictly the order of the jobs. The result of this asynchronous calls you can find in the internal job execution document .
-3-
1.1 JobCreator
Creates a job in the job queue document for the JobExecutor. JobCreator is used for Bizflow calls which are using xcellerator functionality in case the excellerator is not available (e.g. during installation) or in case asynchronous processing is intended. Bizflow: /com.sap.b1i.vplatform.system/bfd/JobCreator.bfd Parameter: The JobCreator has one parameter (bfd) to specify the bizflow to call and covers in addition all typical parameters of all B1ifAPI call. Please refer to the particular chapter of the call for the semantics of the parameters. bfd name of the bizflow to call (full Bizstore URI) in syntax /ds/grp/x.bfd
Result: The bizflow returns a 3-digit code in text format. In case the return code is not 000, there is no job created. - 000 - 001 (Bizflow is empty)
Job Executor Retrieves all jobs from the job queue document and calls the referred bizflow. The JobExecutor is called on start of B1iP. Bizflow: /com.sap.b1i.vplatform.system/bfd/JobExecutor.bfd
-4-
Job Queue Document: /com.sap.b1i.vplatform.system/job/jobqueue.xml The JobExecutor maintains a result document: /com.sap.b1i.vplatform.system/job/jobexecution.xml The entries will get inserted in a ring buffer with max entries of 100.
<jobexecution> <job bfd="bizflow" jobid="guid" created="ts" executed="ts" result="result"> <par name="name" value="value"/> ... </job> ... <job bfd="bizflow" jobid="guid" created="ts" executed="ts" result="result"> <par name="name" value="value"/> ... </job> </jobexecution>
-5-
1.2 B1ifAPI
Creates a job in the job queue (internal queue) for the JobExecutor. JobCreator (via HTTP call) is used to call an B1if API function via HTTP. URL: http://<ipaddress>:8080/B1iXcellerator/exec/ipo/vPlatformIDE/com.sap.b1i.vpl atform.ide/ipo/vPlatform.ide.ipo/B1ifAPI?bfd=<bfd>
Parameter: <ipaddress>: ip address or logical name of the B1if server <bfd>: The JobCreator has one parameter (bfd) to specify the bizflow to call and covers in addition all parameters of all B1ifAPI calls. Please refer to the particular chapter of the call for the semantics of the parameters.
Result:
<result status="status"> <job bfd="bizflow" jobid="id" created="ts" par="parstring" /> </result>
status: status of the job creation: 000 if successful, 001 if error jobid: identifier of this job, can be used to check the job result after processing created: timestamp of job creation par: all parameter with values
-6-
2. SLD Entry
There are two APIs available to manipulate an entry in the System Landscape Directory (SLD). You use the API SLDCreateSysId (chapter 3.1) to create, update or delete an SLD entry with a known SysId (SLD entry identifier). In case you want to create a new SLD entry and you want the API to generate a new SysId, you can use the API GenSystemToSLD (chapter 3.2).
Parameter: action, sysid, systype, crypt, par0, ..., par28 Mandatory parameters: for delete: action=delete, sysid=sysid for update: sysid=sysid,systype=systype
Parameter: action
empty Mode is create in case the entry does not exist, Mode switches to update in case the entry exists already. insert Mode is create in case the entry does not exist, Mode switches to update in case the entry exists already. update Mode is create in case the entry does not exist, Mode switches to update in
-7-
Integration framework for SAP Business One 06 APIs case the entry exists already. delete Mode is delete. In case (Mode=create) and some of the parameters par0 par20 are not handed over, the fix default values will be used. In case (Mode=update) and some of the parameters par0 par20 are not handed over, the existing values will be used.
Parameter: sysid
a 10-digit SysId, following the syntax 001xxxxxxx SAP allows you to define unique identifier (Sysids) for the systems in the SLD (System Landscape Directory). The vendor is responsible for uniqueness. The syntax is 001xxx0001. xxx = Vendor namespace. This is the unique vendor abbreviation, provided by SAP.
Parameter: systype
B1.2004 B1.2005 B1.2007 B1.8.8 ECC6.0 R3.46C R3.47.100 R3.47.200 F.AnySystem H.AnySystem J.AnySystem W.AnySystem (T.AnySystem SAP Business One 2004 SAP Business One 2005 SAP Business One 2007 SAP Business One 8.8 SAP ERP ECC 6.0 SAP ERP R/3 4.6 C SAPERP R/3 4.7 100 SAPERP R/3 4.7 200 File System HTTP Database Web Service FTP not yet supported)
Parameter: crypt
true false all passwords will be encrypted (default in case parameter is not handed over) all passwords will be stored in plain text
Return Code
<result jobid="" sysid=""> <result>3 digit number</result> </result>
result returns a 3-digit code, optional with additional information. In case the return code is not 000, there is no change in the SLD. - 000 - 001 (SysId is empty) - 002 (length of SysId is not 10) - 003 (SysId does not start with '001')
-8-
- 004 (SysType is empty) - 005 (wrong SysType systype) - 006 (not correct systype currentsystype - systype) - 007 (nothing to delete) - 008 (sequence number wrong) - 009 (sequence number overflow) jobid is the job id in case the task is triggered via the JobCreator (chapter 1) sysid is the identifier of the created/modified/deleted SLD entry
par15
par16 par17
-9-
Integration framework for SAP Business One 06 APIs par4 par5 par6 par7 par8 par9 par10 par11 par12 par13 destPath (default: empty) query (default: empty) proxyHost (default: empty) proxyPort (default: empty) authentication (default: basic) user (default: empty) password (default: empty) sslTruststorePath (default: empty) sslTruststorePassword (default: empty) associatedSrvIP (default: empty)
- 10 -
Integration framework for SAP Business One 06 APIs par4 DB password (default: sa)
- 11 -
sldref Instead of handing over all the parameters to specify the new SLD entry, you can handover the parameter sldref to specify a reference system in the SLD from which the values will be taken for all parameters which are not explicitly handed over. This is helpful in case you want to add a new SLD entry for a new added company database of an SAP Business One system and there is already an entry in the SLD for another company database. The parameter sldref is optional and can be a SysId, a SysType or a b1server address. First the API will search for a matching SysId. If it fails it will take the value of the sldref parameter as a SysType and will pick up the first SLD entry of this type. If it fails as well it will take the value of the sldref parameter as a b1server and will pick up the first SLD entry that has this value in the parameter b1server. If this fails as well, there is no SLD reference and the handed over parameters will be used, resp. the default values of the API SLDCreateSysId (chapter 3). par Please refer to the parameters, defined in chapter 2.1.
Return Code
<call jobid=""> <sysid>0010000180</sysid> <result>000</result> <operation status="000" jobid="" systype="B1.8.8" sldref="0010000112" vpac=""> <biulist /> <SLDParams>parameter ...</SLDParams> </operation> </call>
result returns a 3-digit code, optional with additional information. In case the return code is not 000, there is no change in the SLD.
- 12 -
- 000 - 008 (sequence number wrong) - 009 (sequence number overflow) jobid is the job id in case the task is triggered via the JobCreator (chapter 1). The element sysid (in the above example 0010000180) is the generated SysId.
- 13 -
3. Scenario APIs
3.1 Scenario Refresh
This service will run through all Scenario Steps of a particular Scenario Package. For each Scenario Step it will re-generate all xsl documents and Bizflow definition based on the definitions to guarantee a consistent status. Its strongly recommended to run this service before activation of a Scenario Package via an API. Bizflow: /com.sap.b1i.vplatform.system/bfd/vPacRefresh.bfd You can call this bizflow directly from your Bizflow, from external or in-direct via JobCreator. Parameter: id, mode id Name of the Scenario Package mode Working mode of the service. The value ALLBFDXSLVAR is regenerating all involved documents.
result 000 001 (Parameter id is not defined) 002 (Parameter id is empty) 003 (Scenario Package does not exist)
- 14 -
Bizflow: /com.sap.b1i.vplatform.system/bfd/vPacActivate.bfd You can call this bizflow directly from your Bizflow, from external or in-direct via JobCreator. Parameter: id, mode id Name of the Scenario Package mode Working mode of the service. Set mode to activate will activate the Scenario Package. Set mode to deactivate will deactivate the Scenario Package.
result 000 001 (Parameter id is not defined) 002 (Parameter id is empty) 003 (Scenario Package does not exist) 004 (Parameter mode is not defined) 005 (Parameter mode is empty) 006 (Parameter mode has a wrong value (activate, deactivate)) 007 (Scenario Package is not setup)
- 15 -
Bizflow: /com.sap.b1i.vplatform.system/bfd/vPacAddSystem.bfd Mandatory Parameter sysid, vpac Parameter: sysid, vpac, sbiu, rbiu
sysid SLD Identifier (SysId) of the system, that should be added to the Scenario Package configuration. vpac Identifier of the Scenario Package for which you want to add the new system. This parameter is mandatory and the API will not do any changes in the setup of the Integration framework in case this parameter is not correct. sbiu This parameter is optional. By default the new system will be added as a sender system for all Scenario Steps of the Scenario Package (parameter vpac) where the inbound channel is the system type of the SysId. In case you want to add the new system as sender system for particular Scenario Steps only, you can list the relevant Scenario Steps in this parameter, separated by comma. If this parameter is handed over, the new system will be added as sender system only for Scenario Packages, that are listed here. rbiu This parameter is optional. By default the new system will be added as a receiver system for all Scenario Steps of the Scenario Package (parameter vpac) where the outbound channel is of the system type of the SysId. In case you want to add the new system as receiver system for particular Scenario Steps only, you can list the relevant Scenario Steps in this parameter, separated by comma. If this parameter is handed over, the new system will be added as receiver system only for Scenario Packages, that are listed here. Result 000 001 (sysid empty) 002 (vpac empty) 003 (wrong sysid)
- 16 -
Bizflow: /com.sap.b1i.vplatform.system/bfd/vPacGenAddSystem.bfd Mandatory Parameter vpac, [systype | sldref] Parameter: vpac, systype, sldref, sbiu, rbiu, par0, , par28
vpac Identifier of the Scenario Package for which you want to add the new system. This parameter is mandatory and the API will not do any changes in the setup of the Integration framework in case this parameter is not correct. systype This parameter is mandatory if no parameter sldref is specified. Here you specify the type of system you want to add to the Scenario Package. If you are using the parameter sldref, the systype is determinate by the SysType of the referred SLD entry. sldref Instead of handing over all the parameters to specify the new SLD entry, you can handover the parameter sldref to specify a reference system in the SLD from which the values will be taken for all parameters which are not explicitly handed over. This is helpful in case you want to add a new SLD entry for a new added company database of an SAP Business One system and there is already an entry in the SLD for another company database. The parameter sldref is optional and can be a SysId, a SysType or a b1server address. First the API will search for a matching SysId. If it fails it will take the value of the sldref parameter as a SysType and will pick up the first SLD entry of this type. If it fails as well it will take the value of the sldref parameter as a b1server and will pick up the first SLD entry that has this value in the parameter b1server. If this fails as well, there is no SLD reference and the handed over parameters will be used, resp. the default values of the API SLDCreateSysId (chapter 3). sbiu This parameter is optional. By default the new system will be added as a sender system for all Scenario Steps of the Scenario Package (parameter vpac) where the inbound channel is of the system type, specified by the parameter systype. In case you want to add the new system as sender system for particular Scenario Steps only, you can list the relevant Scenario - 17 -
Steps in this parameter, separated by comma. If this parameter is handed over, the new system will be added as sender system only for Scenario Packages, that are listed here. rbiu This parameter is optional. By default the new system will be added as a receiver system for all Scenario Steps of the Scenario Package (parameter vpac) where the outbound channel is of the system type, specified by the parameter systype. In case you want to add the new system as receiver system for particular Scenario Steps only, you can list the relevant Scenario Steps in this parameter, separated by comma. If this parameter is handed over, the new system will be added as receiver system only for Scenario Packages, that are listed here. par0, par28 The semantic of these parameter is related to the system type you want to add. Please refer to the chapter 3.
Result 000 001 (scenario package identifier missing) 002 (systype identifier missing) 003 (unknown systype) 004 (scenario package identifier is wrong)
Example if you want to call this function to add a new B1 company database to the package sap.Xcelsius. http://localhost:8080/B1iXcellerator/exec/ipo/vPlatformIDE/com.sap.b1i.vplatfo rm.ide/ipo/vPlatform.ide.ipo/B1ifAPI?bfd=vPacGenAddSystem&vpac=sap.Xce lsius&sldref=001sap0001&par0=entryname&par3=newcompany
- 18 -
vpac Identifier of the Scenario Package in which you want to remove the system. This parameter is mandatory and the API will not do any changes in the setup of the Integration framework in case this parameter is not correct. sysid This parameter is mandatory and specifies the SLD identifier (SysId) of the system you want to remove. sld This parameter is optional, default is false. If set to true, the system will be removed also from the System Landscape Directory (SLD).
Result 000 001 (scenario package identifier missing) 002 (sysid missing) 003 (sysid is wrong) 004 (scenario package identifier is wrong)
Example if you want to call this function to remove the system 0010000555 from the package sap.Xcelsius and from the SLD. http://localhost:8080/B1iXcellerator/exec/ipo/vPlatformIDE/com.sap.b1i.vplatfo rm.ide/ipo/vPlatform.ide.ipo/B1ifAPI?bfd=vPacDelSystem&vpac=sap.Xcelsius &sysid=0010000555&sld=true
- 19 -
- 20 -