sap-connector

Need Help at Getting data from SAP to C#

自古美人都是妖i 提交于 2020-01-06 03:17:25
问题 I want to get some data from an SAP Server to my C# Programm in Visual Studio. The connection between the SAP and the program is already working but I don't really know how to get the data from the Server into the program. namespace ConsoleApp1 { class Program //: IDestinationConfiguration { static void Main(string[] args) { fn f = new fn(); RfcDestination destination = f.GetRfcDestination("vhcalnplci", "brachi", "Abap2017", "001", "EN", "vhcalnplci", "00", "20", "10"); RfcSessionManager

Add items to IRfcTable

我只是一个虾纸丫 提交于 2019-12-30 05:23:25
问题 I have a function and one of it's parameter is a table (T_ITEMS). Item of tables is of type/structure Z_ITEM with two fields: Value, Quantity; How can I add to this table items of type Z_ITEM? What I have done is following code: IRfcFunction fnct = repo.CreateFunction( "MY_FUNCTION" ); IRfcTable t_items = fnct.GetTable( "T_ITEMS" ); foreach( XmlNode oneNode in postdata.Items.SelectNodes( "//articles/article" ) ) { IRfcStructure articol = repo.GetStructureMetadata("Z_ITEMS") as IRfcStructure;

SAP .NET connector takes a long time to fetch results on first attempt

不问归期 提交于 2019-12-22 21:22:52
问题 I have an issue with the SAP .NET Connector I have built a web application (ASP.NET, C#) that connects to SAP BAPI procedure to fetch results from SAP database. I have connected it to SAP BAPI procedure and it also fetches the results for the web application. My issue is, during the first attempt it takes 25 to 30 seconds to fetch the results, but from the second attempt onwards the results are fetched with no time. I don't know exactly why it is taking so long to fetch the results on the

SAP Hard-coded logon parameters not allowed when using a Destination Configuration in C#

旧巷老猫 提交于 2019-12-22 11:24:51
问题 When i try to connect to SAP server dynamically I am getting error like Hard-coded logon parameters not allowed when using a Destination Configuration any one plz help me I need to send all parameters from codebehind Dynamically not from Web.config from web.config its working fine .. but not here My code is like this SAPSystemConnect objSapConfig = new SAPSystemConnect(); RfcDestination objSapdestination = null; RfcDestinationManager.RegisterDestinationConfiguration(objSapConfig);

How to fetch data from SAP system using sap .net connector?

瘦欲@ 提交于 2019-12-21 04:58:38
问题 I am developing an windows application, here I wanna extract data from sap system and show it in a datagridview... I have extracted the column names alone like name, city and so on.. I don't know how to extract the data from the columns, can anyone help me with the code? I am using RFC_READ_TABLE function module and rfc destiantion manager Thanks in advance!!! 回答1: untested, but this is essentially how it works: first create the connection RfcDestination destination = mDestinationManager

How to create and send Idocs to SAP using SAP .Net Connector 3

断了今生、忘了曾经 提交于 2019-12-17 20:52:01
问题 I want to create and send idocs to SAP using the SAP. Net Connector 3.x. And I have a configured RFC Destination in my application: _rfcDestination = RfcDestinationManager.GetDestination(_destinationName); But I can not find any examples on how to create and send idocs. Can anybody give some sample code on how to create and send an idoc? 回答1: One way to submit idocs to the SAP system using NCo is function module IDOC_INBOUND_ASYNCHRONOUS . The function module has several table parameters

Retrieve texts from a sales order by using RFC_READ_TEXT

跟風遠走 提交于 2019-12-12 14:01:59
问题 I'm using SAP .NET Connector 3.0 to read data from SAP(R/3). I need to get some header texts from sales orders: A lot of information I found regarding READ_TEXT function which can be used for this purpose. Here you can find some sample how to do it by using ERPConnect. I'm trying to do the same and I have following function which returns IRfcTable: static IRfcTable ReadFunction(string destName, int rowCount) { // get the destination RfcDestination dest = RfcDestinationManager.GetDestination

Getting “Not logged on in interface XBP” error when calling XBP function module via sap .net connector

拥有回忆 提交于 2019-12-11 13:06:44
问题 I am getting the error while calling BAPI_XBP_JOB_START_IMMEDIATELY IRfcFunction rfcFunc = repository.CreateFunction("BAPI_XMI_LOGON"); rfcFunc.SetValue("extcompany", "testC"); rfcFunc.SetValue("extproduct", "testP"); rfcFunc.SetValue("interface", "XBP"); rfcFunc.SetValue("version", "3.0"); rfcFunc.Invoke(dest); rfcFunc = repository.CreateFunction("BAPI_XBP_JOB_START_IMMEDIATELY"); rfcFunc.SetValue("jobname", "MYSCHEDULEDJOB"); rfcFunc.SetValue("jobcount", "15530600"); rfcFunc.SetValue(

2 errors when trying to use RFCDestination.Repository.GetTableMetadata(string tablename)

梦想与她 提交于 2019-12-11 07:29:42
问题 I know that you can get the data of a table in a SAP Server with the function RFCDestination.Repository.GetTableMetadata(string tablename) . Unfortunately I get an error when I try to execute the command. The weird thing is when I give a exisiting table I get a different error when I try something random as a tablename. Existing table: var x = dest.Repository.GetTableMetadata("TFTIT"); Error: SAP.Middleware.Connector.RfcInvalidStateException: "cannot find TABLE specified by TFTIT" Random

SAP connection to extract data from PHP

六眼飞鱼酱① 提交于 2019-12-10 12:11:15
问题 I need to extract data from SAP ERP for a third-party system. The third-party system has to be able to request remotely data from SAP ERP on demand (i.e. information from a given employee). So the point is to make queries (mainly employees, inventory, stock) for a given resource. Therefore the data to transfer should be small for each request. The system is PHP-based. My questions are: a) Best way to carry out this task b) Do I need to carry some operation or coding within SAP to enable such