Showing results for 
Search instead for 
Did you mean: 

SAP .NET Connector 3.0, error pushing data to SAP


I have an old program pushing some data from a Microsoft SQL server database to SAP. It uses Microsoft .NET Data Provider for mySAP Business Suite to connect to SAP and up to the moment it has worked perfectly.

Now, as a part of an improvement plan, I've been ask to migrate from Microsoft driver to the new SAP .Net Connector, version 3.0. Since I didn’t have any experience with either Microsoft connector neither with SAP connector, I started from the documentation. Even though I think I’ve done my homework I’m getting an error that I’m not able to solve or find any information about.

My main function:

log.Debug("Get the SAP destination")
    Dim destination As RfcDestination = RfcDestinationManager.GetDestination("SAP")    log.Debug("Fetch the function metadata")
    Dim rfcFunction As IRfcFunction = destination.Repository.CreateFunction("Z_TEC_CAT")    log.Debug("Set the import parameters")
    Dim am As RfcStructureMetadata = destination.Repository.GetStructureMetadata("ZTEC_CAT")
    Dim exportTable As IRfcTable = rfcFunction.GetTable("ZTEC_CAT")
    FillIrfTable(exportTable, invoices)    log.Debug("Invoking the function Z_TEC_CAT")    rfcFunction.Invoke(destination)

A helper to populate the table that I have to send to SAP HCM: 

    Private Sub FillIrfTable(ByVal sapTable As IRfcTable, ByVal dt As DataTable)    log.Debug("Started FillIrfTable")
    For Each row As DataRow In dt.Rows        sapTable.Append()
        Dim index As Integer = 0
        Do While (index < dt.Columns.Count)
            Dim columName As String = dt.Columns.Item(index).ColumnName
            Dim columnValue = row.Item(index)            sapTable.SetValue(columName, columnValue)            index = (index + 1)
    Next    log.Debug("Completed FillIrfTable")

End Sub

When the exportable variable is empty, I get a NO_DATA exception and everything is fine, but when the table has records, it throws: 

Failed calling SAP Function Module Z_TEC_CAT
SAP.Middleware.Connector.RfcAbapException: BDC_OPEN_ERROR
   at SAP.Middleware.Connector.RfcConnection.ThrowRfcErrorMsg()   at SAP.Middleware.Connector.RfcConnection.RfcReceive(RfcFunction function)   at SAP.Middleware.Connector.RfcFunction.RfcDeserialize(RfcConnection conn, IRfcIOStream stream)   at SAP.Middleware.Connector.RfcFunction.RfcCallReceive(RfcConnection conn, IRfcIOStream stream, RFCID rid)   at SAP.Middleware.Connector.RfcFunction.RfcCallReceive(RfcConnection conn)   at SAP.Middleware.Connector.RfcFunction.Invoke(RfcDestination destination)

Does anyone know what can be happening? Any suggestion will be greatly appreciated.



Re: SAP .NET Connector 3.0, error pushing data to SAP

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

Why was this posted here?

Seems to have nothing to do with Siemens software.

At best it should be posted in the "General Discussion" -> "Off Topic" forum?

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP16/TC11.2
I'd rather be e-steamed than e-diseaseled

Learn online

Solution Information