create

Create new visual objects (Button, Textfield, Column) in current form

You need beas 9.3 PL 2 or later

 

hmtoggle_plus1Create Button

in a beas form you can create buttons on different areas: Top, right and bottom side and inside the formula

 

create-button

 

Best event to create button: form_loaded

Syntax

 

global function form_loaded

create=button=text=ButtonText,name=ButtonName,Position=Area,{x,y,width,height}

end global

 

Example to create Buttons in all areas

 

// ******* Event form_opened ********

global function form_loaded

create=button=text=Pos0,name=mpos0,position=0

create=button=text=Pos1,name=mpos2,position=2

// Left

create=button=text=Pos1-A,name=mpos1a,position=1

create=button=text=Pos1-B,name=mpos1b,position=1

 

create=button=text=PR,name=mpos1r,x=1700,y=30,height=66,width=180

 

end global

 

Part of Command

Description

create=button

Command to create a button

text=Pos0

Define the Text, which you can see

menutext=[text]

This is optional: Do you define a menu text, beas insert this in right click menu too.

name=mpos0

Every Button need an unique name

Please use your own postfix
Example: mycompany_buttonname

position

Position
0=bottom, 1=left, 2=top
in beas you don't need to define x/y/width or height. The framework calculate automatically correct position and size

 

in beas 9.3 PL 2 you can define
position=bottom

position=top

position=right

x/y/width/height

Define direct position, if you want to insert a button inside the window

 

You can use most of additional properties:
bitmap, forecolor, backcolor, fontsize, textstyle, tooltip, width. See complete Reference

 

For every button a function is needed, which is executed by click on button

for Position 0-2 the main object is dw_master, if inside the form, then dw_1...7

 

global function dw_master_item_mpos2_click

end global

 

Part of function

Description

dw_master

Datawindow ( = dw_master, if outside the main window, dw_1...dw_7 if inside)

item

type of object from dw_master ( = item)

mpos2

Name of object

click

Type of activity (click, rclick...)

 

Simple creation of this function

1. open the window with created buttons

2. open customizing script editor

Crtl+DoubleClick on the Button -> beas open window for "New function"
You can insert a comment and your Name.

3. click on "OK" -> beas create the correct function inside the script editor

4. insert your function

 

Example

 

global function dw_master_item_mpos2_click

messagebox=Hello, this is my first function

end global

 

 

hmtoggle_plus1Create right click entry

 

only beas 9.3 PL 2 and later:

With command

 

create=rightclick=name=my_object_name,text=displaytext,bitmap=bmp\bitmapname

 

The name of called function is
global function dw_master_item_button_my_object_name_click

 

 

Example:

global function form_loaded

create=rightclick=text=Hello Boyum,name=boyum_hello,bitmap=bmp\active.png

end global

 

global function dw_master_item_button_boyum_hello_click

messagebox=clicked on Hello Boyum

end global

 

create-rightclick

hmtoggle_plus1Create new Field

 

A field has 2 parts:
1. Text field, 2. Input field

The input field need a reference to the database layer of the Report

 

create-field1

 

In Script Editor you can see available fields from database layer

create-field2

 

for create new fields you can use UDF5 ... UDF15
and userfield1...x

 

UDF1..4: This fields available. You can make this fields visible in Configuration Wizzard
In most of windows UDF 5..15 available. This field are linked with Database and you can use this fields for customizing

In many windows userfield1...x available. This fields are not linked with Database.
All UDF and userfields have always type String and length of 50 characters.
Userfields allow to insert up to 16 KByte, but only, if the name of this field (property "name") start with "userfield" or "template"
Example: name=userfield_test<tab> ...
If you use another name and if you insert more then 50 chars, you will become the error message "(itemchanged13249) incorrect entry! Please correct!"

 

Best place to define new fields outside tab area is form_loaded

 

Syntax to create new field

 

global function form_loaded

create=column=name=udf5,id=udf5,x=800,y=292,length=200

end global

 

name = field name

id=udf5 = link to database layer

 
Both can be the same. But link a field from database layer only ONE time to a visible column.
 

Create a field on this defined position. You can fill it, beas load and save the value
create-field3

 

Description of the field
The description is always on left side. The Description field (text object) has same name as the input field +"_t", example "udf5_t"

You can create this in one line together with the colum

 

global function form_loaded

create=column=name=udf5,id=udf5,x=1000,y=292,length=220&

  ,text=BoyumTxt,x2=750,width2=220=200

end global

 

create-field4

 

Field inside TAB Area

 

In many windows we've tab area inside the Datawindow

Tab Area are not the Tab on top. The Tab area is always inside the Datawindow

 

Example Operatino Catalog - General / Extented / Tool

Fields inside a Tab area are in same Datawindow, but in different cases Datawindow 2, 3 and so on

 

 

create-fieldtab

 

Name of the Tab object is "etab". In some windows we've tab objects inside main tab area with another name.

Every tab-element have own name, example the first tab has name etab.stamm

 

You can see the object name and tab name in debug window if mouse over the tab name

create-fieldtabdebug

 

This Tab objects created in form_load, form_loaded or other events.
Correct place to define a field in a tab is

 

global function etab_firstredraw

end global

 

Use property "related" to define the position to another field
Example we want to insert a field "BoyumTxt" down of "Number of payslips"

 

global function etab_firstredraw

create=column=name=udf5,id=udf5,text=BoyumTxt,related=anzls

end global
 

create-fieldtab2

 

Attention:

In this window we've empty areas, which not always empty
Example: Area "Processing" / "Personnel" ... beas display additional fields related of other settings, here related to cost counts.

 

Alternative: Define position manually

With tabobject, tabpage you can define the tab area
Position x=0/y=0 is left top of the Tab, not of the window

create=column=name=udf5,id=udf5,text=BoyumTxt,tabobject=etab,tabpage=stamm,x=...y=...,x2=...,wdith2=...

 

Numeric fields, Date Fields

Userfields are always string fields and not numeric or date fields

But it's possible to simulate numeric or date fields

Concept: Define the type of field (beas 9.3 PL 2)

 

Example:

 

Operation catalog - new field Number field with 2 decimal places

we need

alignment=1 = right alignment

type=#0.00   = numeric, 2 decimal places

 

global function etab_firstredraw

// add new field, right alignment

create=column=name=udf5,id=udf5,text=BoyumNum,related=anzls,alignment=1,type=#0.00

end global

 

as date field

we need

dropdown=date = Calendar

type=date     = replace input in correct date format

 

global function etab_firstredraw

// add new field, right alignment

create=column=name=udf5,id=udf5,text=BoyumDate,related=anzls,dropdown=date,type=date

end global

 

 

hmtoggle_plus1Examples

 

 

in this example we create a new database field and insert this in the routing position - edit form

 

 

hmtoggle_plus1Complete Reference of all properties

 

 

if you work with "&" to switch to next line, insert the comma always in next line

 

create=column=name=udf5,ID=udf5,x=1000,y=292,length=220,&

  text=BoyumTxt,x2=750,width2=220=200

 

In this example we've 2 errors:
Only lower case allowed
Space before keywords not allowed. In this case we've space or tab for keyword "text"

Correct is

 

global function form_loaded

create=column=name=udf5,id=udf5,x=1000,y=292,length=220&

  ,text=BoyumTxt,x2=750,width2=220=200

end global

 

 

Type

Description

create=text

Create a Text Object

create=column

Create a Input Field

create=button

 

SAP: Define x+y position

 

beas:

 

You can insert the button inside the form

dw_1.create=button=name=mybutton,text=my button text,x=100,y=100

current not inside tabs.

 

You can define the button in bottom button list, on right side or top button list

see position

 

create=button=name=mybutton,text=my button,position=2

create=bitmap

Create a Bitmap (only beas)

create=compute

Create a Computed Field (only beas)

create=checkbox

Create a Checkbox-Field

create=rightclick

Create rightclick popup menu entry (beas 9.3 PL 2)

 

Properties: [ use comma for seperation ]

Property

Object

Description

alignment

column, compute

The alignment of the control's text within its borders. 0 - (Default) Left, 1 - Right, 2 - Center, 3 - Justified

position

button

 

0=bottom

1=right

2=top

 

create=button=text=my button,name=mybutton,position=2

 

beas 9.3 PL 2

band

all

The returned text is one of the following, where # is the level number of a group: detail, footer, header, header.#, summary, trailer.#, foreground, background.

bitmap

bitmap, button


checkboxoff

column

Only Checkbox: set the "OFF"-Value. Standard =N (if checkboxon = Y or J) or 0 (if checkboxon=1)

checkboxon

column

 

if you set "Y" or "J", beas set checkboxoff to "N"

if you set "1", beas set checkboxoff to "0"

Example bom-Position

global function form_loaded

create=checkbox=related=description,id=udf5,name=myfield,tab=41,text=MyField,&

checkboxon=Y,checkboxoff=N

end global

 

dropdown

column

Available with Beas 2020.05

This field become a dropdown icon

Follow Dropdown types available

 

Dropdown type

Description

color

Choose color

bmp

Choose internal bitmap

values

Choose from values

Example

dropdown=values=red,blue,yellow

or

dropdown=values=1=red,2=blue,3=yellow

bsl

get command from BSL

sql

Select command (all results must be type String

date

Dropdown Calendar

 

More see Chapter Beas Item Object

 

Example

In Work order add addiional fields

dropdownExample

global function etab_firstredraw

create=column=name=udf7<tab>id=udf7<tab>text=BoyumDate<tab>related=bplname<tab>dropdown=date<tab>type=date

create=column=name=udf8<tab>id=udf8<tab>text=BoyumBitmap<tab>related=udf7<tab>dropdown=bmp

create=column=name=udf9<tab>id=udf9<tab>text=BoyumColor<tab>related=udf8<tab>dropdown=color

create=column=name=udf10<tab>id=udf10<tab>text=BoyumValues<tab>related=udf9<tab>dropdown=values=red,blue,yellow

create=column=name=udf11<tab>id=udf11<tab>text=BoyumNormal<tab>related=udf10

create=column=name=udf12<tab>id=udf12<tab>text=BoyumItemList<tab>related=udf11<tab>dropdown=select "ItemCode","ItemName" from "OITM"

end global

 

 

expression

compute

 

Example: today()                

field1 + field2

more see PowerBuilder DataWindow help

fontsize

button

define font size (30 .... 60)

Note: Not possible for buttons in the bottom

forecolor

button

define fore color. example Red=255

Note: Not possible for buttons in the bottom

format

column, compute

Output Format. (onlya for type Column and Compute), Default: "[general]"

height

all

 

Optional

Default 58 (SBO: 20)

 

Don't define this, if you create a button on bottom, top or right side

id

column

Only for columns. Name of the column that should be used ( e.g. userfield1, udf5 ..15)

Each Field can only be used once.

menutext

button

Text for right click menu

name

all

MANDATORY! Unique name of the Object.

related

all

 

Example:

Field udf5 bottom from field "udf4"

 

dw_1.create=column=related=udf4,text=myField

 

if the related field part of tab object, then the new field is part of same tab object and page

 

beas 9.3 PL 2

tab

column

Only for columns: define the order of tab

tabobject

all

object is part of tab area ... (normal "etab") beas 9.3 PL 2

tabpage

all

object is part of tab page (1...x or name of tab page) beas 9.3 PL 2

text

column, text, button

 

Column Objects: Describe the Description of the column. beas create additional text object (columnname_t) left of the column

Define x2 for position from text object beas 9.3 PL 2

 

Text Object and Buttons: Define Text of this object

textstyle

button

define text style 0=normal, 1=weight, 2=italic, 3=weigt+italic

tooltip

column, button, text

define tooltip

type

column

 

beas 9.3 PL 2

 

udf fields and userfields always from type "String"

With this command you can simulate another field types. But it's only a simulation

 

Parameter:

date

#0 or #0.00 for number

 

beas convert the string in date or number and use the format, which you define

 

type=#0.00: User make an input: 3

beas insert in field: 3.00

 

type=date: User insert 1.10.19

beas insert - related to current settings, 01.10.2019

 

Note:

Beas use current window regional setting for date format. The Date is saved as string with the current Date format from current window user. It's not a real date field. If SAP Date format another format as defined in Windows Regional settings, the system use Windows regional settings!

underline

text, column

underline text (true/false or 1/0)

values

column

 

Selection text: Value

e.g.
red:1/yellow:2/green:3
The selection text will also be translated by the multilanguage engine

visible

all

Visibly yes/no (1/0)

width

all

 

optional.

 

Default: 200 (SBO: 90)

Don't set this, if you define a button

You don't need to define this, if you work with "related"

width2

column

 

create=column=text=Myfield,x2=100,name=myfield,id=udf5,x=1000,y=300,width2=200

 

In this example the calculated with for text object is 900, but you overwrite with 200

 

beas 9.3 PL 2

x

all

 

Define the x position from the object

If it's a part of a tab object, then related from X/Y postion from the tab object

x2

column

 

if you define a column object, you can define the related text field to. X-Position is "x2"

 

create=column=text=Myfield,x2=100,name=myfield,id=udf5,x=1000,y=300

 

if you work with related you don't need to define this

width from text field is x - x2

In this example 900

 

beas 9.3 PL 2

y

all

 

Specific Feature for SBO Form: if "max" then on the lower edge

Specific Feature for BEAS Form: if 0 then it will automatically placed on the lower edge.

 

If it's a part of a tab object, then related from X/Y postion from the tab object

 

 

 

Example Video:

 

youtube Create Label for each line from a sap b1 receipt document

youtube Function: Open material issue form from time receipt window

youtube Create issue document from work order bill of material window