PdcMasterData.AddStock: Difference between revisions
Jump to navigation
Jump to search
Created page with "== Declaration == PdcMasterData.AddStock(rstrMatNo as String, rstrCertNo as String, rstrLocation as String, rstrSerNo as String, rdblQuantity as Double, rdblLength as Double, ..." |
No edit summary |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
== Declaration == | == Declaration == | ||
PdcMasterData.AddStock(rstrMatNo as String, rstrCertNo as String, rstrLocation as String, rstrSerNo as String, | 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 == | ||
This method adds stock to a material | This method adds stock to a material. Function returns new LMV_ID. | ||
== Notes == | == Notes == | ||
Line 20: | Line 20: | ||
dim strLocation | dim strLocation | ||
dim strSerNo | dim strSerNo | ||
dim | dim dblUnitAmount | ||
dim dblLength | dim dblLength | ||
dim dblWidth | dim dblWidth | ||
dim dblWeigth | dim dblWeigth | ||
dim dblHeigth | dim dblHeigth | ||
dim | dim intNumber | ||
dim booBlocked | dim booBlocked | ||
dim dtExpireDate | dim dtExpireDate | ||
dim intMutCode | dim intMutCode | ||
strLMV_ID | strLMV_ID = "161" | ||
strMatNo | strMatNo = GetAnyField("LMV_MAT", "LMV_ID", strLMV_ID, "LMV_MATN") | ||
strCertNo | strCertNo = GetAnyField("LMV_MAT", "LMV_ID", strLMV_ID, "LMV_CERTNR") | ||
strLocation | strLocation = GetAnyField("LMV_MAT", "LMV_ID", strLMV_ID, "LMV_LOK") | ||
strSerNo | strSerNo = GetAnyField("LMV_MAT", "LMV_ID", strLMV_ID, "LMV_USER1") | ||
dblUnitAmount = 0.125 | |||
dblLength | dblLength = 0.5 | ||
dblWidth | dblWidth = 0.5 | ||
dblHeigth | dblHeigth = 0.5 | ||
dblWeigth | dblWeigth = 0 | ||
intNumber = 1 | |||
booBlocked | booBlocked = false | ||
dtExpireDate = 0 | dtExpireDate = 0 | ||
intMutCode | intMutCode = 1 | ||
if not fbooAddStock(strMatNo, strCertNo, strLocation, strSerNo, | 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, | Function fbooAddStock(rstrMatNo, rstrCertNo, rstrLocation, rstrSerNo, rdblUnitAmount, rdblLength, rdblWidth, rdblHeigth, intNumber, rdblWeigth, rbooBlocked, rdtExpireDate, rintMutCode, rstrError) | ||
pdc.MasterData.AddStock rstrMatNo, rstrCertNo, rstrLocation, rstrSerNo, | 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