I think what your solution lies in the template features of WM. Depending on your platform - you will need to implement some sort of template that converts a record to a string.
I am most familiar with WM 4.6. With a flat record structure like sql results - you should be able to write a template that creates the flat file (assuming there is a one to one relationship of the row in your record structure to the row in your flat file). If the record structure is not closely matching your flat file structure, you will need to construct your looping logic to fit your needs, but it will still be a template that converts the record to a string.
You can find more about the template features within the “templates and dsps” document.
Another technique that I use a lot when its a simple situation, is to declare a string variable in the pipeline, and use pipeline substitution to extract the values from the record, hard-coded directly into the string variable.
HTH
#Integration-Server-and-ESB#webMethods#edi