Skip to Content
0
Former Member
Oct 18, 2006 at 12:33 PM

Problem with a BAPI collecting dunning levels

63 Views

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