title: How do you add a field to an rfcTable using SAP Nco 3.0?
body: <p>I can't understand the documentation and really need a concrete example.  </p>
  
  <p>I've already created the destination.  Here I define my BAPI:</p>
  
  <pre><code>IRfcFunction BapiIncomingInvoiceGetDetail = SapRfcRepository.CreateFunction("BAPI_INCOMINGINVOICE_GETDETAIL");
  </code></pre>
  
  <p>Set my imports, invoke it, and then get my exports - one of which is a table:</p>
  
  <pre><code>IRfcTable ITEMDATATable = BapiIncomingInvoiceGetDetail.GetTable("ITEMDATA");
  </code></pre>
  
  <p>I now want to add a field to each item in the table ITEMDATATable and set its' value so I can reference it later as if it were one of thefields returned by the BAPI.  Can anyone tell me how?</p>
  
  <p>EDIT:  Okay, I've made some progress:</p>
  
  <pre><code>RfcFieldMetadata newField = new RfcFieldMetadata("SKU_AMT",0,0,0);
  ITEMDATATable.CurrentRow.Metadata.AddField(newField);
  ITEMDATATable.SetValue("SKU_AMT",myItemData.SKU_AMT);
  </code></pre>
  
  <p>However, when I try to set the value, I get RfcInvalidStateException "Cannot add an element to locked STRUCTURE BAPI_INCINV_DETAIL_ITEM".</p>
  
  <p>Any way around this?</p>