bom_additem 
 | 
object=ue_api_wo=bom_additem=<belnr_id>=<belpos_id>=<itemcode>=<qty> 
qty in using-unit (menge_verbrauch) 
return in "<e_pos_id>" the new pos_id 
  
 You cannot add a phantom item to a workorder material list (incl. existing routings)! 
 | 
 
 
 
 | 
bom_close 
 | 
Example 
  
object=ue_api_wo=bom_close=<belnr_id>=<belpos_id>=<pos_id> 
 | 
 
 
 
 | 
bom_quantity 
 | 
if quantity of assembly changed or from Bill of material position, the total quantity must be calculated 
  
For complete work order 
wo.bom_quantity=x 
  
For work order position 
wo.bom_quantity=x=y 
  
For Bill of Material position 
wo.bom_quantity=x=y=z 
 | 
 
 
 
 | 
bom_reopen 
 | 
Example 
object=ue_api_wo=bom_reopen=<belnr_id>=<belpos_id>=<pos_id> 
 | 
 
 
 
 | 
bom_replaceitem 
 | 
setvar=ls_newitemcode=[new itemcode] 
declare=mywo=ue_api_wo 
mywo=bom_replaceitem=<ll_belnr_id>=<ll_belpos_id>=<ll_pos_id>=<ls_newitemcode> 
  
 You cannot replace a material in a workorder position with a phantom item or assembly!  
 | 
 
 
 
 | 
bomcandelete=belnr_id,belpos_id,pos_id 
 | 
beas check all subassembly from this position and the bom-Position self. Return in Value "value" "1"=can delete , -1 can not delete 
object=ue_api_wo=bomcandelete=<belnr_id>=<belpos_id>=<pos_id> 
messagebox=<value> 
 | 
 
 
 
 | 
checkrelease 
 | 
  
object=ue_api_wo=checkrelease=fttyp=..<tab>itemcode=...  
if <return> = success then 
  // all ok 
else 
  messagebox=error$<value> 
end if 
  
Properties 
fttyp 
 | 
beas work order type beas_fttyp 
 | 
 
itemcode 
 | 
assemlby itemcode 
 | 
 
stlitemcode 
 | 
id from used bill of material. empty=same as itemcode 
 | 
 
routingid 
 | 
id from routing plan. empty = same as itemcode 
 | 
 
deliverydate 
 | 
date of delivery. empty=today 
 | 
 
version 
 | 
Version of assembly. Empty = don't check version 
 | 
 
 
 
  
Return 
failure = error. In "value" you've the error message 
success = all ok 
  
 | 
 
 
 
 | 
closeposition 
  
 | 
declare=mywo=ue_api_wo 
mywo=closeposition=<str_parm.belnr_id>=<str_parm.belpos_id> 
  
Before closing, all necessary tests would be conducted. 
There must be no open feedback exist. 
A "Close" under certain circumstances can NOT be undone. 
 | 
 
 
 
 | 
copy_wopos 
 | 
object=ue_api_wo=<from-belnr_id>=<from-belpos_id>=<to-belnr_id> 
insert this position in at last in work order <to-belnr_id> 
beas9.0-000-001-007 
 | 
 
 
 
 | 
copy_workorder 
 | 
object=ue_api_wo=<belnr_id> 
messagebox=<value> 
display -1 = error otherwise the new number 
 | 
 
 
 
 | 
deleteworkorder 
 | 
you don't need to load this 
  
object=ue_api_wo=deleteworkorder=<belnr_id> 
if <return> = -1 then 
  // error handling 
end if 
 | 
 
 
 
 | 
delposition 
  
 | 
  
Example Delete Workorder-Position 
declare=mywo=ue_api_wo 
mywo=delposition=<belnr_id>=<belpos_id>=0 
  
All necessary tests would be conducted before erasing. 
If position is complete or feedback exists, no cancellation is possible.  
beas delete all eraseable sub-Positionen and close the rest. In this case base close the actual position and clear the WIA-Accounts. 
  
If the assembly has sub-groups with feedback, a cancellation is not possible. 
The script workordermanagement:delstl() will be called. Is this a failure,  a cancellation is not possible. 
The script workordermanagement:delpos() will be called. Is this a failure, a cancellation is not possible. 
  
Delete BoM-Position 
declare=mywo=ue_api_wo 
mywo=delposition=<belnr_id>=<belpos_id>=<pos_id> 
  
You can check the deletable of this position with "bomcandelete" 
  
 You cannot delete a phantom item (because you will not no the contents of this item)! 
 | 
 
 
 
 | 
ftpos_refresh 
  
 | 
declare=mywo=ue_api_wo 
mywo=ftpos_refresh=<str_parm.belnr_id>=<str_parm.belpos_id> 
  
Manufacturing assembly will be removed and re-imported. Working consequences, where feedback exists will not be deleted (depending on the option). 
Whether an upgrade is possible, is dependent on other settings. If the assembly or production order is closed, no update is possible. 
 | 
 
 
 
 | 
ftzuordnung=<parameter> 
 | 
 Parameter with tab 
belnr_id,belpos_id 
 | 
Check workorder ... 
 | 
 
receipt 
 | 
Check for this receipt-document 
 | 
 
distnumber 
 | 
this is the distnumber from receipt-document. 
Works only with batches! 
 | 
 
issue 
 | 
check only for this issue-document (optional) 
 | 
 
getissue 
 | 
get the issue-document automatically (examle for backflushing-procress) ... get the last issue-docentry which is created 4 min before the receipt document. 
 | 
 
 
 
beas9.9-000-003-000 
  
  
destroy=lds 
declare=lds=ue_datastorevalues 
lds=select "BEAS_FTPOS"."BELNR_ID"+0 as "BELNR_ID","BEAS_FTPOS"."BELPOS_ID"+0 as "BELPOS_ID" & 
   from "BEAS_FTPOS"  & 
   inner join "OITM" on "OITM"."ItemCode"="BEAS_FTPOS"."ItemCode" and &                        ("OITM"."ManBtchNum"='Y' or "OITM"."ManSerNum"='Y') 
    
for ll_loop=1 to <lds.rowcount> 
  lds.setrow=<ll_loop> 
  object=ue_api_wo=ftzuordnung=belnr_id=<lds.belnr_id><tab>belpos_id=<lds.belpos_id> 
next 
destroy=lds 
 | 
 
 
 
  
 | 
 
 
 
 | 
getbomquantitysql 
 | 
This part sequence requires the tables "beas_ftpos" and "beas_ftstl" 
declare=mywo=ue_api_wo 
select "BEAS_FTSTL"."POS_ID",<mywo.getquantitysql> as "Quantity" from "BEAS_FTSTL","BEAS_FTPOS" where "BEAS_FTSTL"."BELNR_ID"="BEAS_FTPOS"."BELNR_ID" and "BEAS_FTSTL"."BELPOS_ID"="BEAS_FTPOS"."BELPOS_ID" 
 | 
 
 
 
 | 
getsubassembly=belnr_id,belpos_id,pos_id 
 | 
object=ue_api_wo=getsubassemlby=<belnr_id>=<belpos_id>=<pos_id> 
messagebox=<value> 
Return as example: "20,30,40" 
  
Example: print all work order automatically after work order creation. 
userevent workordermanagement 
  
function CreateWorkOrderPositionEnd 
object=ue_api_wo=getsubassembly=<e_WoDocEntry>=<e_WoLineNumber> 
setvar=e_positions=<value> 
[loop] 
tools=token=e_positions=, 
if <value> = "" then 
  goto=exitloop 
end if 
beasfunction=PrintWorkorder=<e_WoDocEntry>=<value>=print==true 
goto=loop 
[exitloop] 
end function 
  
 | 
 
 
 
 | 
gettimesql 
 | 
 The partial sequence required the tables beas_ftapl,beas_ftpos and beas_ftapl 
  
declare=mywo=ue_api_wo 
select "BEAS_FTSTL"."POS_ID",<mywo.gettimesql> as wotime from 
"BEAS_FTAPL" inner join "BEAS_FTPOS" on "BEAS_FTAPL"."BELNR_ID"="BEAS_FTPOS"."BELNR_ID" and "BEAS_FTAPL"."BELPOS_ID"="BEAS_FTPOS"."BELPOS_ID" left outer join "BEAS_APLATZ" on "BEAS_FTAPL"."APLATZ_ID"="BEAS_APLATZ"."APLATZ_ID" 
where "BEAS_FTAPL"."BELNR_ID"=<str_parm.belnr_id> and "BEAS_FTAPL"."BELPOS_ID"=<str_parm.belpos_id> 
select beas_ftstl.pos_id,<mywo.gettimesql> as wotime from 
beas_ftapl inner join beas_ftpos on beas_ftapl.belnr_id=beas_ftpos.belnr_id and beas_ftapl.belpos_id=beas_ftpos.belpos_id left outer join beas_aplatz on beas_ftapl.aplatz_id=beas_aplatz.aplatz_id 
where beas_ftapl.belnr_id=<str_parm.belnr_id> and beas_ftapl.belpos_id=<str_parm.belpos_id> 
 | 
 
 
 
 | 
inventoryaudit 
 | 
wo=inventoryaudit=docnumber=posnumber=routingnumber 
if <value> = -1 then 
   message=info$<valuetext> 
end if 
Executes an Material 
Executes inventory audit for the work sequence. 
Return value will be stored in "value" 
-1 Inventory not enough 
1  Inventory OK 
If return value is -1 so the reason will be stored in Variable <valuetext>. 
 | 
 
 
 
 | 
 
 | 
  
 | 
loadworkorder 
 | 
Load work order in memory and allow to change properties on workorder level or add / change work order positions on position level 
  
Add Line to existing work order 
declare=wo=ue_api_wo 
wo=loadworkorder=1411 
wo.line.add 
wo.line.itemcode=FP 
wo.line.quantity_ve=5 
wo.line.belpos_id=100 
wo.line.save 
destroy=wo 
  
Change quantity in existing work order 
declare=wo=ue_api_wo 
wo=loadworkorder=1411 
wo.line.gotobelpos_id=10 
wo.line.quantity_ve=15 
wo.line.save 
// Now we must calculate total quantity in BoM 
wo.bom_quantity=1411=10 
destroy=wo 
 | 
 
 
 
  
 | 
opcandelete=belnr_id,belpos_id,pos_id 
 | 
return in value: -1 = you can't delete, 1 = you can delete 
beas check beas_arbzeit,beas_ftstmp,pch1,por1 
object=ue_api_wo=opcandelete=<belnr_id>=<belpos_id>=<pos_id> 
messagebox=<value> 
 | 
 
 
 
 | 
refreshschema=belnr_id=belpos_id 
 | 
This method delete the current schema on BEAS_FTPOS_SCHEMA and insert the updated selected schema. 
  
object=ue_api_wo=refreshschema=<belnr_id>=<belpos_id> 
 | 
 
 
 
 | 
reset / new 
 | 
Delete all instances, insert new entries 
 | 
residualquantity=belnr_id=belpos_id=pos_id=pos2_id 
 | 
object=ue_api_wo=residualquantity=<belnr_id>=<belpos_id>=<pos_id>=<pos2_id> 
messagebox=Residual Quantity = <value,#0.000000> 
 | 
 
 
 
 | 
routing_close 
 | 
object=ue_api_wo=routing_close=<belnr_id>=<belpos_id>=<pos_id> 
 | 
 
 
 
 | 
routing_reopen 
 | 
object=ue_api_wo=routing_reopen=<belnr_id>=<belpos_id>=<pos_id> 
 | 
 
 
 
 | 
set 
 | 
For set make a load. 
you can set some properties in a workorder (beas 9.1 PL: 08) 
  
declare=mywo=ue_api_wo
mywo=set=prior_id=1050=10=high 
if <return> = -1 then 
  messagebox=you can not set the priority! 
end if 
destroy=mywo 
  
  
Settigs for creation or refresh 
function 
 | 
Description 
 | 
 
validdate=<date> 
 | 
set valid date to check bom/routing valid date  
you must set before create work order (beas 9.1 PL 8) 
 | 
 
capacityautomatic=true/false 
 | 
make capacity planing automatically after refresh or save (standard = true) 
 | 
 
 
 
  
  
settings for existing work orders 
Function 
 | 
Description 
 | 
 
prior_id=<belnr_id>=<belpos_id>=<value> 
 | 
set the prior_id 
 | 
 
apsstatus=<belnr_id>=<belpos_id>=<value> 
 | 
set planed 1=planed, 0=unplaned 
 | 
 
sperrung=<belnr_id>=<belpos_id>=<value> 
 | 
lock the workorder J=locked, N=unlock 
 | 
 
starttime,startzeit,startzeit_struktur 
   =<belnr_id>=<belpos_id>=<value> 
 | 
Set the "startzeit_struktur" work order. 
Date must be always equal or greater than today. If date is previous than today system will assign <today> date. 
 | 
 
deliverydate, lieferdatum 
   =<belnr_id>=<belpos_id>=<value> 
 | 
Set the deliverydate infor to work order position 
 | 
 
fix, freeze 
  
 | 
Set all routing position from this work order position and all sub positions to freeze (1) or unfreeze (0) 
// freeze all routing position from this  
// work order position and his sub structure 
object=ue_api_wo=set=freeze=<belnr_id>=<belpos_id>=1 
  
  
 | 
 
 
 
 | 
 
 
 
  
 | 
updateworkorder 
 | 
wo=loadworkorder=<belnr_id> 
// changes 
wo=updateworkorder 
 | 
 
 
 
 | 
wipclear=belnr_id= 
belpos_id 
 | 
we found an error in the account-settings. we want to make a automatic correction for all closed workorders 
In this script we open the workorder, call the wipclear-Function and close the position. 
  
destroy=lds 
declare=lds=ue_datastorevalues 
lds=select "BELNR_ID","BELPOS_ID","ABGKZ_DATE" from "BEAS_FTPOS" where "ABGKZ"='J' 
for ll_loop=1 to <lds.rowcount> 
   lds.setrow=<ll_loop> 
   select "ABGKZ" from "BEAS_FTHAUPT" where "BELNR_ID"=<lds.belnr_id.value> 
   setvar=ls_abgkz=<wert1> 
   if <ls_abgkz> = J then 
     sql=update "BEAS_FTHAUPT" set "ABGKZ"='N' where "BELNR_ID"=<lds.belnr_id.value> 
   end if 
   sql=update beas_ftpos set abgkz='N' where belnr_id=<lds.belnr_id.value> & 
        and belpos_id=<lds.belpos_id.value> 
   setvar=e_date=<lds.abgkz_date,yyyy/mm/dd> 
   object=ue_api_wo=wipclear=<lds.belnr_id.value>=<lds.belpos_id.value> 
   sql=update "BEAS_FTPOS" set "ABGKZ"='J' where "BELNR_ID"=<lds.belnr_id.value> & 
        and "BELPOS_ID"=<lds.belpos_id.value> 
   if <ls_abgkz> = J then 
     sql=update "BEAS_FTHAUPT" set "ABGKZ"='J' where "BELNR_ID"=<lds.belnr_id.value> 
   end if 
next 
 | 
 
 
 
 | 
wocanclose 
 | 
wocanclose=<belnr_id>=<belpos_id> 
if <return> n= -1 then 
  message=error$you can not close this position 
end if 
 | 
 
 
 
 |