Set Batchnumber using Beas script 2020.05

Peter Tarr

Dear support

We have solution for setting the batchnumber during the booking of the goods using the timereceipt functionality

It is done using the stockmanagement.receipt function. Here I can assign the batch and it doesn't asking during the booking using timereceipt. It works fine, but it doesn't work in the new Beas version (2020). I read the documentation of the new script. I assuming that  I should use the stockmanagement.receiptline function, but it doesn't work. It is asking for the batchn umber during the timereceipt,  but it should not because I should set the  batchnumber before as it is in the older beas version.

Any idea what could be wrong ?

Thanks in advance,

Peter

 

Comments

9 comments

  • Comment author
    Martin Heigl

    Hi,

     

    please use GetBatchNumber

    http://help.beascloud.com/script/index.html?stockmanagement_getbatchnumber.htm

    0
  • Comment author
    Peter Tarr

    Hi Martin,

     

    Thank for your reply.

     

    I am trying to use that function, and  also different combination, but it is still asking for the batch:

    Is it possible to set up the batchnumber using that function without asking for the batch number?

    If yes, could you share  the part of the code in the script ?

    Thanks in advance,

    0
  • Comment author
    Martin Heigl

    Item master data -> set to "Automatic batch determination"

     

    Note: If anything is not working then it's always good to post
    - Beas Version
    - Debug log

    0
  • Comment author
    Peter Tarr

    Hi Martin,

    So you mean that if the Batch determination is set tu "manual entry", then is not possible to pass the batchnumber and the system will not ask it ? Like is in our current version of Beas script ?

    0
  • Comment author
    Martin Heigl

    Hi Peter,

     

    correct. Manual means Manual
    But set to autoamtically and you can ask for batch Number in your script

    function GetBatchNumber
    select coalesce(max(substring("DistNumber",10,4)),0) into myCounter from "OBTN" where left("DistNumber",9) = '<today,yyyymmdd>-'
    setvar=myCounter=%numadd(myCounter,1)
    setvar=myCounter=000<myCounter,#0>
    setvar=e_DistNumber=<today,yyyymmdd>-<myCounter,right 4>
    input=Batch number=e_DistNumber=<e_DistNumber>
    end function

    Note: Cancel is not possible in this process

    0
  • Comment author
    Peter Tarr

    Hi Martin,

    Thanks for the code. I have figured out.

    So to summarize it. I had to change the Batch managment from "manual" to "Automatc" then use the "GetBatchNumber" function in workordermanagement and callit from the event "receiptline" like this:

    function receiptline
    GetBatchNumber()
    end function

     

    0
  • Comment author
    Martin Heigl

    Hi Peter,

    no!
    Beas execute the GetBatchNumber() automatically.
    Don't insert this in function receiptLine()

     

    regards

    Martin

    0
  • Comment author
    Peter Tarr

    But forexample, I am not using the "counter" as part of the batch number.

    My batchnumber is simply the WO number. 

    So if I exclude those lines then my batchnumber will be assigned according to the batch counter.

    Or as a workaround I should pass the WO number to that counter, and in that case I can exclude those lines.

     

    .

    0
  • Comment author
    Martin Heigl

    Hi Peter,

    correct

    0

Please sign in to leave a comment.