on 07-31-2012 4:53 PM
i want to copy a "purcase order po" to "goods receipt po"
(...)
odocument.lines.baseentry=5
odocument.lines.baseline=0
odocument.lines.basetype=22
this is working
and i need the freight from the base-document (not from the lines)
(example only one line in the base document)
odocument.expenses.basedocentry=5
odocument.expenses.basedoctype=22
odocument.expenses.basedocline=0
but this is not working
please help
regards
M.Heigl
Hi M,
Are you sure your base document header has the expenses ?
the odocument.expenses.BaseDocLine should refer to the POR3 table LineNum field.
Which B1 version are you on ?
I am able to do it in 881. PL 9.
Regards
Edy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Edy,
i use 8.82.064 PL:03
Yes, the base-document has expenses
and all Data in the Database are correct
if i insert this three lines in my existing source code
odocument.expenses.basedocentry=58
odocument.expenses.basedoctype=22
odocument.expenses.basedocline=0
Answer: No matching recorts found (ODBC -2028)
i check the Profiler and search for "por3"
all other tables are correct, but no select on por3
(sorry, is german. Answer: "por3 not found")
I created the GRPo without the 3 lines: all ok - but without Freight
I created the GRPo with SAP: all ok with Freight
regards
Hi Martin,
I ran a quick test on 882 PL5 using below code (VBA script)
It is working fine.
Below code will add the PO and after successfull addition, add the GRPO
Set oPO = oComp.GetBusinessObject(oPurchaseOrders
oPO.CardCode = "V10000"
oPO.DocDate = Now
oPO.DocDueDate = Now
oPO.Lines.ItemCode = "A00002"
oPO.Lines.Quantity = 1
oPO.Expenses.ExpenseCode = 1
oPO.Expenses.LineTotal = 10
lErr = oPO.Add
If lErr = 0 Then
iDocEntry = oComp.GetNewObjectKey
Set oGR = oComp.GetBusinessObject(20) 'GoodReceipt PO
oGR.CardCode = "V10000"
oGR.DocDate = Now
oGR.DocDueDate = Now
oGR.Lines.BaseEntry = iDocEntry
oGR.Lines.BaseLine = 0
oGR.Lines.BaseType = 22
oGR.Expenses.BaseDocEntry = iDocEntry
oGR.Expenses.BaseDocLine = 0
oGR.Expenses.BaseDocType = 22
lErr = oGR.Add
If lErr <> 0 Then MsgBox (.GetLastErrorDescription) Else MsgBox ("Success")
Else
MsgBox (oComp.GetLastErrorDescription)
End If
oComp.Disconnect
Regards
Edy
User | Count |
---|---|
89 | |
7 | |
6 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.