Code: Alles auswählen.
RfcConfigParameters rfc = new RfcConfigParameters();
rfc.Add(RfcConfigParameters.Name, "LGT");
rfc.Add(RfcConfigParameters.SystemID, "LGT");
rfc.Add(RfcConfigParameters.AppServerHost, "192.168.1.170");
rfc.Add(RfcConfigParameters.Client, "100");
rfc.Add(RfcConfigParameters.User, "username");
rfc.Add(RfcConfigParameters.Password, "passw");
rfc.Add(RfcConfigParameters.SystemNumber, "00");
rfc.Add(RfcConfigParameters.Language, "DE");
rfc.Add(RfcConfigParameters.PoolSize, "5");
rfc.Add(RfcConfigParameters.IdleTimeout, "600");
RfcDestination rfcDest = RfcDestinationManager.GetDestination(rfc);
RfcRepository rfcRep = rfcDest.Repository;
IRfcFunction myfun = null;
myfun = rfcRep.CreateFunction("BAPI_CUSTOMER_GETDETAIL2");
myfun.SetValue("CUSTOMERNO", "100000");
myfun.SetValue("COMPANYCODE", "1000");
myfun.Invoke(rfcDest);
IRfcStructure structure = myfun.GetStructure("CUSTOMERADDRESS");
Logfile("NAME: " + myfun.GetStructure("CUSTOMERADDRESS").GetString("NAME"));
Logfile("NAME2: " + myfun.GetStructure("CUSTOMERADDRESS").GetString("NAME_2"));
Logfile("NAME3: " + myfun.GetStructure("CUSTOMERADDRESS").GetString("NAME_3"));
Logfile("NAME4: " + myfun.GetStructure("CUSTOMERADDRESS").GetString("NAME_4"));
Logfile("CITY: " + myfun.GetStructure("CUSTOMERADDRESS").GetString("CITY"));
Logfile("RESULT NUM: " + myfun.GetStructure("RETURN").GetString("NUMBER"));
Logfile("RESULT MSG: " + myfun.GetStructure("RETURN").GetString("MESSAGE"));