Announcement:
wanna exchange links? contact me at sapchatroom@gmail.com.
Posted by
Admin at
Reply from horacio zapettini on Aug 21 at 8:45 AM Mauro, What matters here is that you've found a possible solution. (so you can go on with your project). As a programmer you'll find out that there are always different ways to solve the same issue. (one or more are optimal, the others aren't but if you get into a solution, who cares? ) If RFC_READ_TABLE works, then who cares? :) I'd finish my assignment and once it's working, I'd check if there is a better (and possibly optimal) solution. Horacio Ps: I'd still check if having dialog access, that RFC user receives the "error 0" . It's a minor change for your basis guys.
| | | ---------------Original Message--------------- From: Mauro Re Garbagnati Sent: Saturday, August 18, 2012 2:11 PM Subject: SAP RFC Call Returns Error in Return Parameter from Vb Before the RFC Call @Wes, @Horacio: I tried just now the use of RFC_READ_TABLE and in this way I found what I needed (I replicated the functionality of BAPI_GL_ACC_EXISTENCECHECK) : Set objRfcFunc = sapConn.Add("RFC_READ_TABLE") objRfcFunc.Exports("QUERY_TABLE") = "SKB1" objRfcFunc.Exports("DELIMITER") = "|" Dim optsObj As Object Set optsObj = objRfcFunc.Tables("OPTIONS") Call optsObj.appendrow optsObj(1, "TEXT") = "BUKRS EQ 'C100' AND SAKNR EQ '0000000001'" Dim fldObj As Object Set fldObj = objRfcFunc.Tables("FIELDS") Call fldObj.appendrow fldObj(1, "FIELDNAME") = "SAKNR" Rem *** BAPI Call *** If objRfcFunc.Call = False Then ErrorMsg = objRfcFunc.Exception 'Message collection MsgBox ErrorMsg, 16, "Errore" InsertCash = False sapConn.Connection.Logoff Exit Sub End If Dim tabReturn As Variant Set tabReturn = objRfcFunc.Tables("DATA") returnedRows = tabReturn.RowCount if returnedRows=0 then MsgBox "Don't exist" else MsgBox "Exist" end if sapConn.Connection.Logoff However I simply don't understand why I'm getting the 'Error 0' problem with the BAPI itself calling it directly. I found a way to bypass the problem (and that's good!) but I consider it not solved at the moment. I want - If all of you are ok with me - leave this thread open to see if something else is coming out to solve the 'Error 0' problem. At the moment, please accept my sincere thanks to all of you *gurus*! Mauro | | Reply to this email to post your response. __.____._ | _.____.__ |