on 11-27-2017 12:27 PM
Hi Experts,
I created one Purchase order in sap database. For example That Purchase order number is 506.Now I need to create a GRPO against that Purchase order using DIAPI.
I already written the code but its not working.Here My code Please refer me any code to solve this problem
If s = 0 Then Dim i As Integer = 0 'Dim StrFromware As String = 'txtQltyAvlWhs.Text Dim oPurcahse As SAPbobsCOM.Documents = oCompany.GetBusinessObject(BoObjectTypes.oPurchaseOrders)
Dim oinvgenitems As SAPbobsCOM.Documents = oCompany.GetBusinessObject(BoObjectTypes.oPurchaseDeliveryNotes) oPurcahse.GetByKey(506)
oinvgenitems.DocDate = Today
oinvgenitems.CardCode = oPurcahse.CardCode
oinvgenitems.CardName = oPurcahse.CardName
oinvgenitems.Lines.ItemCode = oPurcahse.Lines.ItemCode oinvgenitems.Lines.ItemDescription = oPurcahse.Lines.ItemDescription oinvgenitems.Lines.BaseEntry = oPurcahse.DocEntry
oinvgenitems.Lines.BaseLine = oPurcahse.Lines.LineNum oinvgenitems.Lines.BatchNumbers.Add() oinvgenitems.Lines.BatchNumbers.SetCurrentLine(0) oinvgenitems.Lines.BatchNumbers.BatchNumber = "Bt1234567" oinvgenitems.Lines.Quantity = 1.0
i = oinvgenitems.Add()
If i = 0 Then
Label1.Text = "Success"
Else
MsgBox("Message:'" & oCompany.GetLastErrorDescription() & "'")
End If
End If
Note:GRPO AGAINST PO -IN DIAPI
Please Help me to solve this Issue
Hi Manikandan
To copy from the PO,
oinvgenitems.CardCode = oPurcahse.CardCode
For i as integer = 0 to oPurcahse.Lines.Count-1
if i>0 then oinvgenitems.lines.add()
oPurcahse.Lines.SetCurrentLine(i)
oinvgenitems.lines.basetype = BoObjectTypes.oPurchaseOrders
oinvgenitems.lines.baseentry = oPurcahse.DocEntry
oinvgenitems.lines.baseline = oPurcahse.lines.linenum
Next
oinvgenitems.add()
Regards
Edy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
9 | |
5 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.