versioncontrol

 

sub function ue_api_bom

 

itemversion

 

Example: Create new item versino for item "Sofa"

 

object=ue_api_bom=versioncontrol=itemversion<tab>itemcode=Sofa<tab>version=001

bomcopy, bomheadercopy

Copy bill of material to new bill of material with header

getbomid

object=ue_api_bom=versioncontrol=getbomid<tab>itemcode=abc<tab>version=1

setvar=ls_bom_id=<value1>

setvar=ls_routing_id=<value2>

 

getitemversion

object=ue_api_bom=versioncontrol=getitemversion<tab>itemcode=QCTest

Message=Version: <value>

getitemnextversion

???

 

 

Properties

hmtoggle_plus1itemversion

 

return current version or create a new version

return in "value"

 

itemcode

if "toitemcode" is empty then source item version

otherwise the itemcode in which you want to create a new version

toitemcode

optional .. copy version to this item

version

optional ..the source version. If empty then the last version

toversion

optional .. the new version

update=true/false

Update mode. Standard = false

active=true/false

set new itemversion as active

 

hmtoggle_plus1getbomid

return bom in "value1" and routing id in "value2" from item/version
if you don't set the version, beas use the actual version

 

beas is checking all settings

itemcode

itemcode

version

Optional: Version

 

hmtoggle_plus1bomcopy, bomheadercopy

 

copy bom (bomcopy) or only the header of bom (bomheadercopy)

itemcode

source bom

toitemcode

target itemcode

if empty in new mode: "fromitemcode" + Version number

if empty in update mode: same itemcode

foritemcode

copy to this itemcode to "toitemcode" or new version (update=false)

update=true/false

set update mode

 

example: copy bom positions and header of bom

object=ue_api_bom=versioncontrol=bomcopy<tab>itemcode=abc<tab>toitemcode=abc-2

 

// this example copy a bill of material to new bill of material

// source: the first bom, which have header ans position and don't start with QC

// target: QC<second> + name of source bom

setvar=ls_err=

select top 1 "ItemCode" into ls_itemcode from "BEAS_STL" where substring("ItemCode",1,2) <> 'QC' and coalesce("ItemCode",'') <> '' and (select count(*) from "BEAS_STL_HEADER" where "BEAS_STL_HEADER"."ItemCode"="BEAS_STL"."ItemCode")>0

setvar=ls_toitemcode=QC<now,ss>-<ls_itemcode>

object=ue_api_bom=versioncontrol=bomcopy<tab>itemcode=<ls_itemcode><tab>toitemcode=<ls_toitemcode>

select count(*) from "BEAS_STL_HEADER" where "ItemCode"=<ls_toitemcode,dbstring>

if <wert1> n= 0 then

  addvar=ls_err=<cr_lf>Error! Header not generated

end if

select count(*) from "BEAS_STL" where "ItemCode"=<ls_toitemcode,dbstring>

if <wert1> n= 0 then

  addvar=ls_err=<cr_lf>Error! BomLines not generated

end if

 

if <ls_err> <> then

  messagebox=error$**$<ls_err>

  return failure

end if