title: RFC error "Element BAPIRETURN1 of container metadata ... is unknown"
body: <p>In my C# program which uses the SAP .NET connector, I want to call the RFC function "BAPI_GET_PAYROLL_RESULT_LIST" and read the result.</p>
  
  <p>I looked at the function with <code>SE37</code>. There I found out that the export parameter should be <code>BAPIRETURN1</code>, which is a structure. </p>
  
  <p>So I searched for an example code of an RFC call and modified it for my case.</p>
  
  <p>I have already tried to read the table <code>BAPI7004_RL</code>, because it was in the information in <code>SE37</code> and I don't know if I have to use the export parameter or the table.</p>
  
  <p>This is my code:</p>
  
  <pre><code>string appServerHost = ConfigurationManager.AppSettings["AppServerHost"];
  string name = ConfigurationManager.AppSettings["Name"];
  string systemnumber = ConfigurationManager.AppSettings["SystemNumber"];
  string user = ConfigurationManager.AppSettings["User"];
  string pw = ConfigurationManager.AppSettings["Password"];
  string client = ConfigurationManager.AppSettings["Client"];
  string language = ConfigurationManager.AppSettings["Language"];
  
  RfcConfigParameters parms = new RfcConfigParameters
  {
      { RfcConfigParameters.AppServerHost, appServerHost },
      { RfcConfigParameters.Name, name },
      { RfcConfigParameters.SystemNumber, systemnumber },
      { RfcConfigParameters.User, user },
      { RfcConfigParameters.Password, pw },
      { RfcConfigParameters.Client, client },
      { RfcConfigParameters.Language, language }
  };
  
  RfcDestination dest = RfcDestinationManager.GetDestination(parms);
  RfcRepository repo = dest.Repository;
  
  IRfcFunction fnc = dest.Repository.CreateFunction("BAPI_GET_PAYROLL_RESULT_LIST");
  fnc.SetValue("employeenumber", "0001");
  
  fnc.Invoke(dest);
  
  RfcStructureMetadata TableMetaData = dest.Repository.GetStructureMetadata("BAPIRETURN1");
  
  IRfcStructure stru = fnc.GetStructure("BAPIRETURN1"); //BAPI7004_RL
  
  //IRfcTable tabDetail = fnc.GetTable("BAPI7004_RL"); //BAPIRETURN1
  </code></pre>
  
  <p>After the line <code>IRfcStructure stru = fnc.GetStructure("BAPIRETURN1")</code> an exception is thrown at runtime, which says:</p>
  
  <blockquote>
    <p>Element BAPIRETURN1 of container BAPI_GET_PAYROLL_RESULT_LIST unknown</p>
  </blockquote>
  
  <p>When I try it with the table, I get the same result.</p>
  
  <p>Where is the error in my code? Or is it maybe a permission problem?</p>