How to calculate available qty before trying inter-site transfer.

SOLVED

I need to prevent errors due not existent or insufficient stock when doing inter-site transfers, I have tried calling the standard x3 procedure STODISPO   from library STKLIB. The error happen when passing the parameters.

I've found only information for V5 and V6, currently  I am in V12.

  V5

Call STODISPO("[F:ZITV]",ZFCY,ZITM,"*",ZLOC,2,ZWSTA,"","","",ZSTODIS) From STKLIB

V6 (one extra parameter = blank)

Call STODISPO("[F:ZITV]",ZFCY,ZITM,"*","*",1,ZWSTA,"","","",ZSTODIS) From STKLIB

Where:

#ZITV CONTAINS THE ABBREVIATION OF THE ITMMVT TABLE (PRODUCT-SITE TOTALS) CLASS By Default:’[F :ITV]’
#ZFCY SITE
#ZITM PRODUCT
#ZLOT LOT NO. PREFIX With "*" / ALL THE LOTS "*" / BLANK LOT ONLY ""
#ZLOC LOCATION PREFIX With "*" / ALL THE LOCATIONS "" or "*"
#ZTYPLOC LOCATION type TAKEN INTO ACCOUNT: ALL THE INTERNAL LOCATIONS + THE COMBINATIONS Using THE FOLLOWING WEIGHTS (1=DOCK / 2=CUSTOMER / 4=SUBCONTRACT)
# EXAMPLE: 5=DOCK & SUBCONTRACT
#ZSTA STATUS TAKEN INTO ACCOUNT (Local MENU NO. 2701) / If 0 Then status ‘A’
#ZOWN OWNER (If "" Then LFCY)
#ZWRH WAREHOUSE or ""
#ZSTODIS CONTAINS THE AVAILABLE STOCK CALCULATED By THE SUB-PROGRAM.

  • 0
    verified answer

    Hello Werner, 

    When generating an intersite transfer, you pick the destination site and the product, then use the left list to select the stock line.

    Here there is a field called 'Available', it shows the available stock. 

    When selecting the stock line and if some of the stock is allocated, you will get a message "Caution, the quantity has already been allocated". 

    You can analyze the allocated stock in Detailed allocations inquiry.

  • 0 in reply to Joel Singam

    Hi Joel,  Thank you for your valid and useful answer, My scenario is different I not doing the inter-site transfers from the UI, but from code. Before I try to do the transfer I need to know if there is enough available stock by using call STODISPO(...)  FROM  STKLIB.  I've been able to put it to work, for V12 it needs an extra parameter.

    Call STODISPO("[F:ITV]",[F:SDH]STOFCY,[F:ZSDD]ITMREF,"*",[F:SDH]BPCLOC,ZTYPLOC,ZWSTA,"","","","",ZSTODIS) From STKLIB

     Thanks again.