Working with SAP Business One SDK - Data Interface API
The SAP Business One DI API provides a programmatic interface to SAP Business One through a set of fully functional business objects. The DI API provides access to the business logic and data-access layers of SAP Business One.
A BeasScript object allow you to use most of functions and methods from SAP SDK - Data Interface API
Note: Please use Beas Service Layer if possible. This is the new interface for creating documents and support all Beas Rules.
The complete interface to the SAP DI-API is inside BeasScript object ue_di_api
BeasScript: declare=[objektname]=ue_api_sbo
Now you can access the DI-API directly via Object Names.
You can access almost any Property with api_sbo. api_sbo will not perform any checks.
More information can be found within the SAP SDK Documentation.
don't work with declare=b1=ue_api_sbo declare=b2=ue_api_sbo
because you can have problems with special variables as example "<getlasterror>" After using the DI-API object: Destroy it! Otherwise you can produce bad mirror effects. |
Error handling
The Object return values in the return object
Return code: <objectname.ret_code> -1 = error, 1 = ok
Return Text: <objectname.ret_text> Return last error
Additional information about error you can read with <objectname.getlasterror>.
vdoc.add
if <vdoc.ret_code> = -1 then
message=fehler$error create Order: <vdoc.getlasterror>
end if
Functions like add, getbusinessobject, update, getbykey and so on will return "value"
vdoc.ret_code = 1 = ok
vdoc.ret_code = -1 = error