1. Create a new export.
  2. Select the constituent code fields, such as Code long description, from the Constituent Codes field group, usually found at either Constituent Codes or at Constituent Information > Constituent Codes.
  3. A Selected Constituent Codes window will appear. Specify how many you want to export for each record and the codes to include. 
  4. In this same window, choose in the lower right section to base hierarchy on table.
For more information on the hierarchy choices, please refer to this Knowledgebase solution: What is the difference between the options 'Base hierarchy on Constituent' and 'Base hierarchy on Table'?