2005 Aug 11 12:08 PM
hi frenz,
I'm using gui_download to download a internal table content as a presentation server file.
Now the problem is, i'm not able to give the heading for each field names in file. File only contains the field values. So how to give column name?
I can do that with alv_download function module with fielcatalog stuffs... But it's a big coding stuff. So i want something other than that.
Prompt answers will be rewarded with points.
with regards,
praveen.
Message was edited by: Praveen Rajendran
2005 Aug 11 12:12 PM
Hi Praveen,
Two ways you can do this.
1. Have the header as the first line of the internal table.
2. First create an internal table which only holds one record with just headings. You already have an internal table for data and download this to the same file location and name in append mode . Set the import parameter "append = 'X'".
Regards
Vinod
hi frenz,
I'm using gui_download to download a internal table content as a presentation server file.
Now the problem is, i'm not able to give the heading for each field names in file. File only contains the field values. So how to give column name?
I can do that with alv_download function module with fielcatalog stuffs... But it's a big coding stuff. So i want something other than that.
Prompt answers will be rewarded with points.
with regards,
praveen.
Message was edited by: Praveen Rajendran
2005 Aug 11 12:12 PM
Hi Praveen,
Two ways you can do this.
1. Have the header as the first line of the internal table.
2. First create an internal table which only holds one record with just headings. You already have an internal table for data and download this to the same file location and name in append mode . Set the import parameter "append = 'X'".
Regards
Vinod
2005 Aug 11 12:12 PM
Hi Praveen,
Insert the headings as first record into your internal table. and poupulate ur internal table and call the FM.
Best Regards,
Vijay
2005 Aug 11 12:19 PM
hi vinod,
I've tried those two methods also. thats working. But i just want to know whether we got any other formal method of doing this. Otherwise it fine. So is there any other way or in-built functionality for doing it?
With regards,
praveen
2005 Aug 11 12:32 PM
Hi Praveen,
As far as I know this is the solution for your requirement. I have not seen any other solution to this for similar earlier posts.
Thanks
Vinod
2005 Aug 11 2:01 PM
Hi Praveen,
1) If you are downloading this as a txt file then there is no other alternative method to this. But here you'll have some problems. eg: if the field is a numeric field in the internal table and you try to enter the heading/title in the first line it cannot get apended. In this case you shud make all the fields as char.
2) Other alternative to this is you can download the contents in a excel sheet format using the function module MS_EXCEL_OLE_STANDARD_DAT. In the tables, you can actually pass two itabs. One for headers (Fieldnames) the contains only the field names 1 row. The actual data can be in Internal table assigned to (data_tab).
This will surely solve this issue.
Cheers,
Sam
2005 Aug 11 2:31 PM
Hi, if you concern that the heard line content is not enough flexbile as a general solution, maybe you can get the field name by some FM, not hard code(if you current use it).
List as following:
'REUSE_ALV_FIELDCATALOG_MERGE'
'GET_COMPONENT_LIST'
CL_ABAP_STRUCTDESCR CL_ABAP_TYPEDESCR
call them, you can get any fields name of the internal table or structure, and your solution will be suitable for more general case.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |