function

 

database Functions in Beas Database

 

Beas create additional functions inside the database

All functions starting with "beas_"

MSSQL: for using functions, you need always the Prefix "dbo.", example : select dbo.beas_getdate()

 

function

description

beas_getdate()

returns the Mandant - Date-Time-Stamp

same as getCompanyTime() from sap, but compatible to all sap-Versions.

Example MSSQL:

select dbo.beas_getdate()

 

beas_getsetup(variable,default)

return System-Variable from beas. If Variable not exist, this function return the default-Value

 

Example MSSQL:

select dbo.beas_getsetup('fert_afoabgallow','J')

if return = J, user can't close a labour-position

 

Example HANA

select beas_getsetup('fert_afoabgallow','J')

 

beas_getlocal(clientname,variable,default)

return a local-Variable (Client-Variable) from beas

if variable not exist, this function return the default-Value

 

Exampe MSSQL:

select dbo.beas_getlocal('mystationname','fert_afoabgallow','J')

 

to_varchar(datetime date,varchar format)

alternative for Hana-Syntax

convert datetime to string

format is yyyy-mm-dd or yyymmdd

all other formats are return an empty string

Example

select dbo.to_varchar(getdate(),'yyyy-mm-dd')

rpad(varchar text,int length)

alternative for Hana-Syntax

don't use space or replicate. Use "dbo.rpad"

this function convert this in "replicate"

select dbo.rpad(' ',10)

is the same as

select replicate(' ',10)

 

More about MSSQL and Hana see select