API WoBom Problem
Hi!
We have a problem in the API (WoBom) or in our code that we made to include an item in one or more work orders, where it has taken a long time and if it is inclusion of greater demand depending on the size of the order it crashes and ends the whole process including Beas. With analysis we were able to identify that the presented slowness and the reason for the lock with closing, happens with “wobom.getbykey”, which it loads the order and its items before inserting the new item in the order and its new position.
I could also analyze that by doing this it makes an update on the previous line (Only in the last position before the new one included) where it puts the "6" in decimal and rounding to 6, something that doesn't make much sense in our scenario, consuming time and feature with this function, since we only work with integers in production.

Code:
global function AdicionarItemBOM
question=Deseja incluir os itens nas possições da ordem de trabalho ?=yesfunction()=nofunction()
function yesfunction
for ll_loop=1 to <dw_1.rowcount>
declare=wobom=ue_api_wobom
//wobom.getbykey=<dw_1.item.belnr_id:[ll_loop].value>=<dw_1.item.belpos_id:[ll_loop].value>
wobom.getbykey=<dw_1.item.belnr_id:[ll_loop].value>=99
wobom.addline
wobom.itemcode=<dw_1.item.novoitem:[ll_loop].value>
wobom.quantity=<dw_1.item.quantidade:[ll_loop].value>
wobom.usertext=<dw_1.item.observacao:[ll_loop].value>
wobom.whscode=<dw_1.item.deposito:[ll_loop].value>
wobom.aplanpos_id=<dw_1.item.PosicaoRota:[ll_loop].value>
wobom.round_type=-1
wobom.round_dec=-1
wobom.abgkz=N
// define the position (text information)
//wobom.pos_text=5555
// sort (beas use numberic sort, means: convert information to numberic
//wobom.sortbypostext
// save
wobom.save
destroy=wo
messagebox=ok$$Incluída <dw_1.item.belnr_id:[ll_loop].value> / <dw_1.item.belpos_id:[ll_loop].value>ordem de trabalho. Operação concluída com sucesso!!!
next
return success
end function
global end
Please sign in to leave a comment.

Comments
0 comments