Open a Beas window, SAP window or create new Beas Window:
[parent].openform (string windowname,Parameter1,Parameter2...); // open window with parameter defined in object
[parent].openform (object); // Create new window
[parent].openform (string windowname,object); // open window with parameter defined in object
Without parent:
openform (string windowname,object/parameter);
With openform you can open a new window:
openform ("beas_id",ParameterList) // Open Beas Form by Beas-Id. See Beas window names
openform ("fo_id",ParameterList) // Open SAP Form or third AddOns by SAP-Form-Uid
window.openform ("psr-filename",{object}) // Open Beas Form from current window as parent window
Create own window
window.openform(object)
Example:
window.openform("beas_ItemMasterData_Edit","RM"}); // Open Beas Item Frrm for item "RM" as modal form
openform("fo_2050",1025); // Open SAP Form "Sales Order" DocEntry=1025
window.openform("artikel_edit.psr",{s_parm1:"RM",modal:true}); // Open Beas Item Frrm for item "RM" as modal form
Related to parent window:
Type |
Description |
|
|---|---|---|
window.openform(x) |
|
|
macro.openform(x) |
|
|
application.openform(x) |
|
Open existing window
First parameter is the Window-psr-file, the fo_[SAPFormID] or beas_[beasFormId]
If the psr-file name defined, the system search for this file in the project folder and then in standard folder.
Second parameter define additional properties by object or parameter list. SAP Forms support only 1 parameter.
openform (string windowname,Parameter1,Parameter2...); // open window with parameter defined in object
openform (string windowname,object); // open window with parameter defined in object
Define all Parameters as Parameter List, example: window.openform("beas_Routing_Pos_Edit","FP",10,"modal");
Related to window type we've different functionality
Open window by SAP-Id
Only first parameter supported. All other ignored. Example: application.openform("fo_2561","C001") ; // open Business Partner "C001"
Open window by Beas-ID In beas_[beasFormId] the Parameter List is defined. Additional keyword new, delete and modal supported application.openform("beas_WorkOrderBOM_Edit",6002253,10,10); // open Work order BoM Window
Open window by PSR File Name In this variant Parameters autoamtically copied to str_parm, example: application.openform("fert_ftstlpos_edit.psr",6002253,10,10); // open Work order BoM Window Complete Link
Additional Keywords "modal", "new" and "delete" supported from second Parameter Example application.openform("fert_ftstlpos_edit.psr",6002253,10,10,"delete"); // delete Bill of Material position
|
Second parameter can be defined as Object Example: application.openform("fert_ftstlpos_edit.psr",{belnr_id:6002253,belpos_id:10,pos_id:10}); // open Work order BoM Window This is supported for open by PSR-File name and Beas-Window-Id, but NOT for SAP Forms application.openform("beas_WorkOrderBOM_Edit",{belnr_id:6002253,belpos_id:10,pos_id:10}); // open Work order BoM Window
Additional object properties supported
|
Return value
openform return
SAP-Forms: nothing
Not modal forms return the instance of the opned window let lw=application.openform("windowname",parameter);
Example: let ll_docEntry=6002253; let lw=application.openform("beas_WorkOrderBOM_Edit",ll_docEntry,10,10); // open Work order BoM Window // next line will be executed after complete opening of the child window
|
If you open a form modal, the script is waiting up to closing the modal form Modal forms return an object with - All fields from dw_1 - String returnText - String returnValue - boolean returnOk: return "true", if closed by "OK" otherwise "False" - str_parm object from current window
In the modal form you can define the return values with window.setReturnValue("valueName","value"); Example: window.setReturnValue("s_parm1","test"); // set str_parm.s_parm1 property from return Value window.setReturnValue("myValue",23); // set Property "myValue" with 23
let f=application.openform("myModalForm","modal");
|
Create new Beas window
if first parameter is an object, the system opens a completely new window: See new Form.
Create new SAP Window: Use SAP UI-API objects: sbo_forms.Add