on 07-23-2013 8:02 AM
could someone pleae share a sample code to create a AP Draft invoice
usually done on the UI by AP Invoice and then File | Save as draft
Thanks very much.
Hi,
Here is an example from SAP SDK:
Sub AddInvoice_Click()
Dim RetVal As Long
Dim ErrCode As Long
Dim ErrMsg As String
'Create the Documents object
Dim vDrafts As SAPbobsCOM.Documents
Set vDrafts = vCmp.GetBusinessObject(oDrafts)
'Set values to the fields
vDrafts.DocObjectCode = oPurchaseInvoices
vDrafts.CardCode = "BP234"
vDrafts.HandWritten = tNO
vDrafts.DocDate = "21/8/2003"
vDrafts.DocTotal = 264.6
'Invoice Lines - Set values to the first line
vDrafts.Lines.ItemCode = "A00023"
vDrafts.Lines.ItemDescription = "Banana"
vDrafts.Lines.Quantity = 50
'Invoice Lines - Set values to the second line
vDrafts.Lines.Add
vDrafts.Lines.ItemCode = " A00033"
vDrafts.Lines.ItemDescription = "Orange"
vDrafts.Lines.Quantity = 1
'Add the Invoice
RetVal = vDrafts.Add
'Check the result
If RetVal <> 0 Then
vCmp.GetLastError ErrCode, ErrMsg
MsgBox ErrCode & " " & ErrMsg
End If
End Sub
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
12 | |
10 | |
6 | |
6 | |
4 | |
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.