Write Text File: Column 'SAP Code' does not belong to table DataTable

The error is pretty clear. You are referencing a column named “SAP Code” but there is no such column in your datatable.