PdcApplication.CheckStock: Difference between revisions

From External Bemet Wiki
Jump to navigation Jump to search
Created page with "== Declaration == == Description == == Notes == == Code example == <source lang="vb"> </source> == Availability =="
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
== Declaration ==
== Declaration ==
 
CheckStock(strMatNr as String)


== Description ==
== Description ==
 
Creates purchaseorderlines or internal productionorders if necessary


== Notes ==
== Notes ==
 
This method checks the ACTUAL stock position against the MINIMUM quantity stated in the material's master data. Depending on the materialtype this can lead to purchaseorder lines (RawMaterials of BuyParts) or internal stock order lines (Stocked MakeParts).


== Code example ==
== Code example ==
This code example checks the need for purchase order or stock order lines for materials for which the stocked quantity is changed to 100.


<source lang="vb">
dim strMatNr
dim tblMAT


<source lang="vb">
  strMatNr = "12345"
  set tblMAT = pdc.Database.OpenTable(pdcConData, "LM_MAT", "LM_MATN")


  if IsValid(tblMat) and tblMat.Locate("LM_MATN", strMatNr) then
    pdc.ChangeStock(strMatNr, 100)
    pdc.CheckStock(strMatNr)
    set tblMat = nothing
  end if
</source>
</source>


== Availability ==
== Availability ==
Available since July 2008 (From version 3.8).

Latest revision as of 10:42, 21 May 2012

Declaration

CheckStock(strMatNr as String)

Description

Creates purchaseorderlines or internal productionorders if necessary

Notes

This method checks the ACTUAL stock position against the MINIMUM quantity stated in the material's master data. Depending on the materialtype this can lead to purchaseorder lines (RawMaterials of BuyParts) or internal stock order lines (Stocked MakeParts).

Code example

This code example checks the need for purchase order or stock order lines for materials for which the stocked quantity is changed to 100.

dim strMatNr
dim tblMAT

  strMatNr = "12345"
  set tblMAT = pdc.Database.OpenTable(pdcConData, "LM_MAT", "LM_MATN")

  if IsValid(tblMat) and tblMat.Locate("LM_MATN", strMatNr) then
    pdc.ChangeStock(strMatNr, 100)
    pdc.CheckStock(strMatNr)
    set tblMat = nothing
  end if

Availability

Available since July 2008 (From version 3.8).