Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3189

Re: How to close any documents by di api

$
0
0

Hi Douglas,

 

this is the code that I use a document throught the DI API :

 

    Dim RetVal AsLong

    Dim ErrCode AsLong

    Dim ErrMsg AsString

    Dim vOrder As SAPbobsCOM.Documents

    Set vOrder = vCmp.GetBusinessObject(oOrders)

 

    'Retrieve the document record to close from the database

    RetVal = vOrder.GetByKey(DocEntry)

 

    If RetVal <> 0 Then

        vCmp.GetLastError ErrCode, ErrMsg

        MsgBox "Failed to Retrieve the record "& ErrCode & " "& ErrMsg

            ExitSub

    EndIf

 

    'Close the record

    RetVal = vOrder.Close

 

    If RetVal <> 0 Then

        vCmp.GetLastError ErrCode, ErrMsg

        MsgBox "Failed to Close the document"& ErrCode & " "& ErrMsg

    EndIf

 

EndSub


Viewing all articles
Browse latest Browse all 3189

Trending Articles