on 10-18-2006 1:33 PM
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) doesnt 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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.