setvar

beasscript-logo-small

Set window variable

setvar=[variable]=[value]

 

Window variables defined with setvar support only variable type string

You can store numbers, date, logic variables, but all variables saved as string

The variable is visible in the complete form

 

// Set a variable
setvar=ls_itemcode=<str_parm.s_parm1>   // writes the content of s_parm1 to the variable lart_id
// add string to variable
setvar=ls_itemcode=<ls_itemcode> <str_parm.s_parm2>
// fast alternative (only string)
addvar=ls_itemcode=>str_parm.s_parm2>
// Get a variable
message=<ls_itemcode>

 

if you want return a variable and not a standard place holder or column, use follow syntax

message=<%var("header")>. See Standard Function

 

if you want to get a variable which does not exist neither as a variable nor as a column the placeholder does not get substituted.  

Example:

// displays: "<NoVariable>"

message=<NoVariable> 

To avoid this you can use the prefix "var:"

message=<var:NoVariable> displays: ""

 

see addvar