PdcMasterData.AddStock: Difference between revisions

From External Bemet Wiki
Jump to navigation Jump to search
No edit summary
 
Line 1: Line 1:
== Declaration ==
== 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)
PdcMasterData.AddStock(rstrMatNo as String, rstrCertNo as String, rstrLocation as String, rstrSerNo as String, rdblUnitAmount as Double, rdblLength as Double, rdblWidth as Double, rdblHeigth as Double, rintNumber as integer, rdblWeigth as Double, rbooBlocked as Boolean, rdtExpireDate as Date, rintMutCode as Integer)


== Description ==
== Description ==
Line 20: Line 20:
dim strLocation
dim strLocation
dim strSerNo
dim strSerNo
dim dblQuantity
dim dblUnitAmount
dim dblLength
dim dblLength
dim dblWidth
dim dblWidth
dim dblWeigth
dim dblWeigth
dim dblHeigth
dim dblHeigth
dim dblAmount
dim intNumber
dim booBlocked
dim booBlocked
dim dtExpireDate
dim dtExpireDate
dim intMutCode
dim intMutCode


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


   if not fbooAddStock(strMatNo, strCertNo, strLocation, strSerNo, dblQuantity, dblLength, dblWidth, dblHeigth, dblAmount, dblWeigth, booBlocked, dtExpireDate, intMutCode, strError) then
   if not fbooAddStock(strMatNo, strCertNo, strLocation, strSerNo, dblUnitAmount, dblLength, dblWidth, dblHeigth, intNumber, dblWeigth, booBlocked, dtExpireDate, intMutCode, strError) then
     msgbox strError
     msgbox strError
   end if
   end if
Line 51: Line 51:




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


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



Latest revision as of 12:19, 14 April 2021

Declaration

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

Description

This method adds stock to a material. Function returns new LMV_ID.

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 dblUnitAmount
dim dblLength
dim dblWidth
dim dblWeigth
dim dblHeigth
dim intNumber
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")
  dblUnitAmount = 0.125
  dblLength     = 0.5
  dblWidth      = 0.5
  dblHeigth     = 0.5
  dblWeigth     = 0
  intNumber     = 1
  booBlocked    = false
  dtExpireDate  = 0
  intMutCode    = 1

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


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

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

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

End Function

Availability

5.2