Use FBLxN to download files according to layout:
for headears:
if you compare fields from 3 Maintain Source Fields you can be sure that most data you can get from FBLxN.
for items:
Here i also took document number - using this data i can get all line items from documents. For example i can get vendor line items from FBL1n and useing document number i can get from FBL3N the other line item.
This is template how i do transport documents from one company code to other. If you have any questions - let me know.