PdcMasterData.AddStock

From External Bemet Wiki
Revision as of 08:10, 7 April 2016 by Mike (talk | contribs) (Created page with "== Declaration == PdcMasterData.AddStock(rstrMatNo as String, rstrCertNo as String, rstrLocation as String, rstrSerNo as String, rdblQuantity as Double, rdblLength as Double, ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Declaration

PdcMasterData.AddStock(rstrMatNo as String, rstrCertNo as String, rstrLocation as String, rstrSerNo as String, rdblQuantity as Double, rdblLength as Double, rdblWidth as Double, rdblHeigth as Double, rdblAmount as Double, rdblWeigth as Double, rbooBlocked as Boolean, rdtExpireDate as Date, rintMutCode as Integer)

Description

This method adds stock to a material

Notes

Code example

This code example adds stock with the help from LMV Line 161 with 0.125 m3 and code ID1 (CORRECTION). If the LMV line is already in use, it returns an error msg.

'USEUNIT  pdcTables
Sub btnReduceStockClick(Sender)
dim strError
dim strMatNo
dim strLMV_ID
dim strCertNo
dim strLocation
dim strSerNo
dim dblQuantity
dim dblLength
dim dblWidth
dim dblWeigth
dim dblHeigth
dim dblAmount
dim booBlocked
dim dtExpireDate
dim intMutCode

  strLMV_ID    = "161"
  strMatNo     = GetAnyField("LMV_MAT", "LMV_ID", strLMV_ID, "LMV_MATN")
  strCertNo    = GetAnyField("LMV_MAT", "LMV_ID", strLMV_ID, "LMV_CERTNR")
  strLocation  = GetAnyField("LMV_MAT", "LMV_ID", strLMV_ID, "LMV_LOK")
  strSerNo     = GetAnyField("LMV_MAT", "LMV_ID", strLMV_ID, "LMV_USER1")
  dblQuantity  = 0.125
  dblLength    = 0.5
  dblWidth     = 0.5
  dblHeigth    = 0.5
  dblWeigth    = 0
  dblAmount    = 1
  booBlocked   = false
  dtExpireDate = 0
  intMutCode   = 1

  if not fbooAddStock(strMatNo, strCertNo, strLocation, strSerNo, dblQuantity, dblLength, dblWidth, dblHeigth, dblAmount, dblWeigth, booBlocked, dtExpireDate, intMutCode, strError) then
    msgbox strError
  end if
End Sub


Function fbooAddStock(rstrMatNo, rstrCertNo, rstrLocation, rstrSerNo, rdblQuantity, rdblLength, rdblWidth, rdblHeigth, rdblAmount, rdblWeigth, rbooBlocked, rdtExpireDate, rintMutCode, rstrError)

  pdc.MasterData.AddStock rstrMatNo, rstrCertNo, rstrLocation, rstrSerNo, rdblQuantity, rdblLength, rdblWidth, rdblHeigth, rdblAmount, rdblWeigth, rbooBlocked, rdtExpireDate, rintMutCode
  rstrError = pdc.LastError

  if rstrError = "" then
    fbooAddStock = true
  else
    fbooAddStock = false
  end if

End Function

Availability

5.2