Skip to Content
0
Former Member
Feb 27, 2009 at 09:06 AM

Adding Data (Service data type ) to GRPO

28 Views

Hi to all,

Im doing a data intergration between 2 DB, DR (Source DB) and GRPO (Target) , I could inditify if the transaction were item or service, I dont have any problem if the the transaction is Item doctype , my problem were if im processing a service type , i encounter a error .

Error Message : Error Item no. is missing [PDN1.ItemCode][line:1]

Kindly see my source code for reference

For nLnDtls = 0 To nLnDtls - 1

oDR.Lines.SetCurrentLine(nLnDtls)

If oDR.DocType = BoDocumentTypes.dDocument_Items Then

oGRPO.Lines.ItemCode = oDR.Lines.ItemCode

oGRPO.Lines.ItemDescription = oDR.Lines.ItemDescription

oGRPO.Lines.WarehouseCode = oDR.CardCode

oGRPO.Lines.Quantity = oDR.Lines.Quantity

oGRPO.Lines.UnitPrice = oDR.Lines.UnitPrice

oGRPO.Lines.BatchNumbers.BatchNumber = oDR.Lines.BatchNumbers.BatchNumber

oGRPO.Lines.BatchNumbers.Quantity = oDR.Lines.BatchNumbers.Quantity

oGRPO.Lines.BaseLine = oDR.Lines.LineNum

oGRPO.Lines.Add()

Else

oGRPO.Lines.ItemCode = ""

oGRPO.Lines.ItemDescription = oDR.Lines.ItemDescription

oGRPO.Lines.AccountCode = oDR.Lines.AccountCode

oGRPO.Lines.LineTotal = oDR.Lines.LineTotal

oGRPO.Lines.BaseLine = oDR.Lines.LineNum

End If

Next nLnDtls

Dim oDocNum As String

If oGRPO.Add <> 0 Then

MsgBox("Error " + oCpTrgt.GetLastErrorDescription())

Else

oDocNum = oCpTrgt.GetNewObjectKey()

SndB1Msg(oDocNum, SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes, "New GRPPO")

Insert2OCTP(vDocNum, vDocDate, oDocNum, Now.ToShortDateString, vCardCode, vCardName)

End If

oRecordSetTrgt.MoveNext()

End While

Thank You