Theobald Software Community Day 2024: Jetzt Early Bird Ticket SICHERN und mit dem Code EARLY20 20% sparen

ERPConnect FAQs

ERPConnect Exception - System.BadImageFormatException


Although I had a copy of the librfc32.dll in my System32 folder, I get this exception.

If you use a 64-Bit System, you have to copy a 64-Bit Version of the librfc32.dll in the System32 Folder. The 32-Bit Version of the librfc32.dll has to be copied in the Windows\SysWow64 folder.

Determine if a connection is valid


How do I know whether an ERPConnect.R3Connection object is already opened or closed? I have a shared connection object in a windows form, and I don’t want the user to supply credentials each time he clicks on a certain button.

Please use the ping() method of the connection object. It will never raise an exception, only returns true / false depending on if the connection is active and usable.

SNC Connection to SAP


How can I establish an SNC (Secure Network Connection) to SAP?

You can use the SNC functionality, just with committing all the Logon Parameters in one Connection String. The Constructor or the Connection String Property of the R3Connection Object can be used to set the Connection String. An SNC Connection String for example can be built like this :

string ConnStr = “ashost=myapphost client=000 snc_mode=1 sysnr=00 type=3 user=SAPDOTNET snc_partnername="p:SAPServiceCS2@nt5.sap-ag.de";

Ports in Use


Which ports are used by SAP to establish the connection?

If a SAP-Router is used, the ports are 3299 and 3399. If not, the ports are 32XX and 33XX. XX is usually the System number (like 00, or 05)

Using Passwords with Blanks

I want to use a password with blanks inside.

You can use blank characters in your password, if you quote your password using double quotes.

R3Connection con = new ERPConnect.R3Connection("ptmalg", 05, "User", "\"My Password\"", "EN", "800");

Error in ASSIGN statement in the program SAPLSDTX

I’m getting an error in ASSIGN statement in the program SAPLSDTX when using the ReadTable class. But only some tables cause this problem.

This error comes from a bug in one of the SAP’s own function modules. The tables that cause the bug contain at least one column of type F (floating point). There are two ways to avoid this error:

Create a view in SAP over the table that causes the error. Leave out all columns of type F and use the ReadTable class to run the view instead of the table.
Install the function module Z_XTRACT_IS_TABLE into your system. Then call the method ReadTable.SetCustomFunctionModule(“Z_XTRACT_IS_TABLE”) before running the extraction. Please have a look here to learn more about the installation of the function module.

ERPConnect Exception - DATA_BUFFER_EXCEEDED

I try to extract a table from SAP using the ReadTable class and get this exception. But only some tables cause this problem.

This error comes from a bug in one of SAP’s own function modules. The tables that cause the bug contain at least one column of type F (floating point). There are two ways to avoid this error:

Create a view in SAP over the table that causes the error. Leave out all columns of type F and use the ReadTable class to run the view instead of the table.
Install the function module Z_XTRACT_IS_TABLE into your system. Then call the method ReadTable.SetCustomFunctionModule(“Z_XTRACT_IS_TABLE”) before running the extraction. Please have a look here to learn more about the installation of the function module.

Date format
I’m trying to run a query with the following date parameter

qry.SelectionParameters(0).Ranges.Add(Sign.Include, RangeOption.Equals, "11-07-2007")
but it keeps failing with the following error: “Entry too long (please enter in the format --____)”

For date values, please use the technical format YYYYMMDD (e.g. 20070703)
Creation date: 5/26/2022 7:15 PM      Updated: 1/18/2024 10:04 AM