Skip to Content
author's profile photo Former Member
Former Member

Problem with a BAPI collecting dunning levels

Hello all experts,

I am having a problem with BAPI “DebtorCreditAccount” (called from a VB program), collecting dunning levels.

The BAPIs is called like follows (only the essential code is shown):

The first function (GetCustomerCurrentBalance) works fine but the second (GetCustomerHighestDunningLevel) doesn’t work.

-


Public Function GetCustomerCurrentBalance(ByVal strCustomerID As String) As Decimal

Dim objARAccount, objReturn, objActualBalance As Object

Try

objARAccount = Me.p_sapBapi.GetSAPObject("ARAccount", "1000", Me.ConvertCustomerID(strCustomerID))

objARAccount.GetCurrentBalance(Return:=objReturn, ActualBalance:=objActualBalance)

Return CType(objActualBalance.Value("TOTAL_BAL"), Decimal)

Catch ex As Exception

Return 0

Finally

objARAccount = Nothing : objReturn = Nothing : objActualBalance = Nothing

End Try

End Function

Public Function GetCustomerHighestDunningLevel(ByVal strCustomerID As String) As Integer

Dim objDebtorCreditAccount, objReturn, objHighestDunningLevelD As Object

Dim objTEST1 As Object

Try

objDebtorCreditAccount = Me.p_sapBapi.GetSAPObject("DebtorCreditAccount", Me.ConvertCustomerID(strCustomerID), "0001")

objDebtorCreditAccount.GetHighestDunningLevel(Return:=objReturn, HighestDunningLevelD:=objHighestDunningLevelD)

Return CType(objHighestDunningLevelD.Value("DUNN_LEVEL"), Integer)

Catch ex As Exception

Return 0

Finally

objDebtorCreditAccount = Nothing : objReturn = Nothing : objHighestDunningLevelD = Nothing

End Try

End Function

-


The error message I get is:

Message: The runtime object of type DebtorCreditAccount with the persistent key 00000480060001 could not be created in the Business Object Repository.

Message-Nr: 826

Workarea: OL

R/3 error message: Object does not exist

Please give me some input on how to proceed!

Best Regards,

Niklas

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2006 at 12:37 PM

    Hi,

    From the error it looks like a data error or type error.

    Please can you check if the type that you are giving as input is the same as its expecting?

    Regards

    Vijaya

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2006 at 02:36 PM

    Thanks Vijaya for your fast reply. The parameters that I am giving as input are however correct.

    I have investigated the problem a bit further and tried some other calls.

    If I just chose to create an object of the type “DebtorCreditAccount” (without submitting any parameters) and then use the same method call as before (se code in topic above) I get the following error: “Mandatory parameter HIGHESTDUNNINGLEVELA missing.” This must mean that it knows that something is missing.

    objDebtorCreditAccount = Me.p_sapBapi.GetSAPObject("DebtorCreditAccount")

    objDebtorCreditAccount.GetHighestDunningLevel(Return:=objReturn, HighestDunningLevelD:=objHighestDunningLevelD)

    If if add the mandatory parameter “HIGHESTDUNNINGLEVELA” I get the error message "The persistent key for an business object instance of type DebtorCreditAccount has not been set. Cannot invoke method GETHIGHESTDUNNINGLEVEL”. This I interpret as the object has not been right instantiated. This brings me back to square one.

    objDebtorCreditAccount = Me.p_sapBapi.GetSAPObject("DebtorCreditAccount")

    objDebtorCreditAccount.GetHighestDunningLevel(HIGHESTDUNNINGLEVELA:="0", Return:=objReturn, HighestDunningLevelD:=objHighestDunningLevelD)

    Grateful for a response!

    Regards,

    Niklas

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.