- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Getting error- Hard-coded logon parameters not allowed when using a Destination Configuration while connecting to SAP server dynamically
You can try below sample code. I would suggest you to try using this:
public class Program { static void Main(string[] args) { SapConnection con = new SapConnection(); RfcDestinationManager.RegisterDestinationConfiguration(con); RfcDestination dest = RfcDestinationManager.GetDestination("NSP"); RfcRepository repo = dest.Repository; IRfcFunction fReadTable = repo.CreateFunction("ZSOMA"); fReadTable.SetValue("I_NRO1", 1); fReadTable.SetValue("I_NRO2", 2); fReadTable.Invoke(dest); var result = fReadTable.GetValue("E_RESULT"); Console.WriteLine(result.ToString()); Console.ReadLine(); } } public class SapConnection : IDestinationConfiguration { public RfcConfigParameters GetParameters(string destinationName) { RfcConfigParameters conf = new RfcConfigParameters(); if (destinationName == "NSP") { conf.Add(RfcConfigParameters.AppServerHost, "sap-vm"); conf.Add(RfcConfigParameters.SystemNumber, "00"); conf.Add(RfcConfigParameters.SystemID, "xxx"); conf.Add(RfcConfigParameters.User, "yourusername"); conf.Add(RfcConfigParameters.Password, "yourpassword"); conf.Add(RfcConfigParameters.Client, "001"); } return conf; } public bool ChangeEventsSupported() { return true; } public event RfcDestinationManager.ConfigurationChangeHandler ConfigurationChanged; }
You can refer below SAP link −
https://archive.sap.com/discussions/thread/3171324
- Related Articles
- Performing different SAP logon check while connecting to HANA
- Getting error message: Scalar type not allowed in SAP HANA
- Error while connecting to SAP server from Java application: java.lang.UnsatisfiedLinkError: no sapjco3 in java.library.path
- Getting error message while using SAP Scripting Tool
- Getting error while using schema in SAP HANA Modeling
- Getting error while extracting data from SAP
- Connecting to SAP HANA server on Cloud using PHP
- Getting memory error while doing UNION in SAP HANA
- Error connecting SAP while sapjco3.jar file is in my library path
- Jmeter server error while perform load testing on SAP application
- Getting error not assigned on running SAP ABAP program
- Getting error while running SAP oData service “HTTP Open failed: PLUGIN_NOT_ACTIVE”
- PHP Soap Client is not supporting WSDL extension while connecting to SAP system
- Error while using LOOP…..WHERE in SAP ABAP
- Dynamically creating parameters from table entries in SAP system

Advertisements