I have seen many posts for downloading from internal table to PC and many replies for the same. Many people have suggested different ways. But I saw those posts are yet Not Answered. Some complained that they are able to download with Field name. But Field name characters are only 10.
So for all these, I got a suitable way to download with proper field names. Some might have tried this method, some may be seeing newly. I thought of sharing this anyway.
Here I will be having 2 internal tables.
1. Final Internal table with the data to be downloaded.
2. Field names of the final internal table.
Fetching data and getting field names.
Downloading the Field names internal table.
After calling GUI_DOWNLOAD function module, again call GUI_DOWNLOAD and put the final internal table with data.
Downloading the Final Internal table
Check the exporting parameters passed while calling the function module both times.