biuan SAP® BUSINESS ONE SDK
API Documents / Close
Close Method

Description

Closes a record of the object in SAP Business One database.

Syntax

Visual Basic
Public Function Close() As Long

Example

The following sample shows how to close a document record. Use this sample as a basis to all business objects of document type (not master data type).
Order Document - Close Method Sample (Visual Basic)
Sub CloseDocument() Dim RetVal As Long Dim ErrCode As Long Dim ErrMsg As String Dim vOrder As SAPbobsCOM.Documents Set vOrder = vCmp.GetBusinessObject(oOrders) 'Retrieve the document record to close from the database RetVal = vOrder.GetByKey("55") If RetVal <> 0 Then vCmp.GetLastError ErrCode, ErrMsg MsgBox "Failed to Retrieve the record " & ErrCode & " " & ErrMsg Exit Sub End If 'Close the record RetVal = vOrder.Close If RetVal <> 0 Then vCmp.GetLastError ErrCode, ErrMsg MsgBox "Failed to Close the record " & ErrCode & " " & ErrMsg End If End Sub

See Also

Related information


Documents Documents Object· Table: OIGE OIGN
Documents is a business object that represents the header data of documents in the Marketing Documents and Receipts module and the Inventory and Production module of SAP Business One application. The source table for each document is according...

API Documents / Close
Close Method

Description

Closes a record of the object in SAP Business One database.

Syntax

Visual Basic
Public Function Close() As Long

Example

The following sample shows how to close a document record. Use this sample as a basis to all business objects of document type (not master data type).
Order Document - Close Method Sample (Visual Basic)
Sub CloseDocument() Dim RetVal As Long Dim ErrCode As Long Dim ErrMsg As String Dim vOrder As SAPbobsCOM.Documents Set vOrder = vCmp.GetBusinessObject(oOrders) 'Retrieve the document record to close from the database RetVal = vOrder.GetByKey("55") If RetVal <> 0 Then vCmp.GetLastError ErrCode, ErrMsg MsgBox "Failed to Retrieve the record " & ErrCode & " " & ErrMsg Exit Sub End If 'Close the record RetVal = vOrder.Close If RetVal <> 0 Then vCmp.GetLastError ErrCode, ErrMsg MsgBox "Failed to Close the record " & ErrCode & " " & ErrMsg End If End Sub

See Also

API Documents / Close
Close Method

Description

Closes a record of the object in SAP Business One database.

Syntax

Visual Basic
Public Function Close() As Long

Example

The following sample shows how to close a document record. Use this sample as a basis to all business objects of document type (not master data type).
Order Document - Close Method Sample (Visual Basic)
Sub CloseDocument() Dim RetVal As Long Dim ErrCode As Long Dim ErrMsg As String Dim vOrder As SAPbobsCOM.Documents Set vOrder = vCmp.GetBusinessObject(oOrders) 'Retrieve the document record to close from the database RetVal = vOrder.GetByKey("55") If RetVal <> 0 Then vCmp.GetLastError ErrCode, ErrMsg MsgBox "Failed to Retrieve the record " & ErrCode & " " & ErrMsg Exit Sub End If 'Close the record RetVal = vOrder.Close If RetVal <> 0 Then vCmp.GetLastError ErrCode, ErrMsg MsgBox "Failed to Close the record " & ErrCode & " " & ErrMsg End If End Sub

See Also

Related information


Documents Additional Expenses DocumentsAdditionalExpenses Object
DocumentsAdditionalExpenses is a child object of Documents object and represents the documents of additional expenses in the Marketing Documents module. The source table for each document is according to the document type as follows: INV3, RIN3,...
   Parent: Documents Documents Object· Table: OIGE OIGN

Document Lines Document_Lines Object· Table: IGE1 IGN1
Document_Lines is a child object of Documents object and represents the line entries of a document in the Marketing Documents and Receipts module and the Inventory and Production module. The source table for each document is according to the...
   Parent: Documents Documents Object· Table: OIGE OIGN

Address Extension AddressExtension Object· Table: INV12 IGE12 IGN12
The Bill To and Ship To address for a marketing document. Source table: INV12
   Parent: Documents Documents Object· Table: OIGE OIGN

Document Approval Requests Document_ApprovalRequests Object· Table: OWDDV
Documents_ApprovalRequests is a child object of the Documents object. You can set the remarks field of the approval request. Source table: OWDDV.
   Parent: Documents Documents Object· Table: OIGE OIGN

Document Installments Document_Installments Object
A child object of Documents object representing the installments feature in marketing documents. Source tables:  INV6, OPCH6.
   Parent: Documents Documents Object· Table: OIGE OIGN

Document Special Lines Document_SpecialLines Object· Table: INV10
This object represents text and subtotal lines in marketing documents. Source table: INV10 and IN10V (a virtual table for storing calculated values).
   Parent: Documents Documents Object· Table: OIGE OIGN

Document Packages DocumentPackages Object
This object holds a collection of packaging types you can attach to items in Delivery or A/R Invoice documents. Access this object via Documents.Packages property. Source tables: DLN7, DLN8, INV7, INV8.
   Parent: Documents Documents Object· Table: OIGE OIGN


SAP® Business One is the trademark(s) or registered trademark(s) of SAP AG in Germany and in several other countries. Contact
This website is not affiliated with, maintained, authorized, endorsed or sponsored by SAP AG or any of its affiliates