ue_api_sbo

With this object you've access to the SAP Business one Datainterface (DI-API)

 

Note: If it possible: User Beas Service Layer. This is the new interface for creating documents and support all Beas Rules.

 

How to use ue_api_sbo:

 

You can declare it with

declare=[objektname]=ue_api_sbo

 

Now you can access the DI-API directly via Object Names.

 

Example: change item-entry

declare=myitem=ue_api_sbo

myitem=getbusinessobject=oitem

myitem=getbykey=A001

myitem=itemname=new itemname

myitem=update

destroy=myitem

 

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.

 

hmtoggle_plus1Important: Only one DI-API Object  a time is allowed.

 

 

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

 

Additional examples

hmtoggle_plus1Create goods receipt
hmtoggle_plus1Goods Receipt with UDF
hmtoggle_plus1Goods Receipt with Batches and Serials
hmtoggle_plus1Create Purchase order
hmtoggle_plus1Create Goods Receipt PO based on a purchase order
hmtoggle_plus1Create SAP Receipt from production
hmtoggle_plus1Sales return with Batchnumbers
hmtoggle_plus1Create Inventory transfer based on a transfer request

 

 

Functions

debug=y

extended Debugging

connect_extern

connect to external database. see connect_extern

 

Methoden (generell)

add

add a document

return variable "value" 0=failure, 1=ok

 

cancel

cancel

close

close the document

savetofile=<file>

save document to file

savexml=<file>

save document to xmlfile

getasxml=<file>

get document from xml-file

getbusinessobject=<documenttype>

create business object (see examples).
see documenttyp

getbusinessobjectfromxml=<path>

Load object from definition saved in "path" file

update

save
return variable "value" 0 = failure, 1 = ok

In Silent-Mode

return variable "errortext" with the current Error, only if value=0

getbykey

get entry (only char. if numeric: getbykeynum)

after loading you can get all information from the current object. Attention: only with correct lower / uppercase

getbykey

get entry (typ numeric)

silent=true/false

set silent-Mode

in silent-mode beas set only variables and send no error-Meesage