Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Importing Column heading into CSV file using GUI_DOWNLOAD

Former Member
0 Likes
6,070

Hi Experts,

I am using GUI_DOWNLOAD function to create a CSV file with data .

But, I am not able to create column headings for the data.

I am importing the data to an internal table using select query.

Then I converting this data to csv format using SAP_CONVERT_TO_TEX_FORMAT.

Then I am using GUI_DOWNLOAD to generate the file.

I want to import column headings also into this file.

Please help me !

Regards,

Narsingh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,459

Dear Narsigh subudhi,

            Just use the new ITAB the one you already have it. Append your fields name before downloading the file and then append lines of your old itab into new itab.

clear: your old itab.

and use it in download you will get the required results.

CLEAR: WA_DATA.

       CONCATENATE   'LIFNR'  'NAME1'  'AUGBL'  'XBLNR'

                     'BELNR'  'BUDAT' 'BLDAT'  'WRBTR'  'WAERS'

                     'ZTERM'  'TEXT1'  'VALUT'  'CYCLE'  'BEGDA'

                     'AGEIN'  'EBELN'  'BUKRS'  'GJAHR'  INTO WA_DATA-field SEPARATED BY ','.

       APPEND WA_DATA TO I_DATA1.

       APPEND LINES OF I_DATA[]  TO I_DATA1[].

6 REPLIES 6
Read only

Former Member
0 Likes
2,459

This message was moderated.

Read only

0 Likes
2,459

Giri, I think these link won't work with CSV file format. Correct me if i am wrong.

Read only

Former Member
0 Likes
2,460

Dear Narsigh subudhi,

            Just use the new ITAB the one you already have it. Append your fields name before downloading the file and then append lines of your old itab into new itab.

clear: your old itab.

and use it in download you will get the required results.

CLEAR: WA_DATA.

       CONCATENATE   'LIFNR'  'NAME1'  'AUGBL'  'XBLNR'

                     'BELNR'  'BUDAT' 'BLDAT'  'WRBTR'  'WAERS'

                     'ZTERM'  'TEXT1'  'VALUT'  'CYCLE'  'BEGDA'

                     'AGEIN'  'EBELN'  'BUKRS'  'GJAHR'  INTO WA_DATA-field SEPARATED BY ','.

       APPEND WA_DATA TO I_DATA1.

       APPEND LINES OF I_DATA[]  TO I_DATA1[].

Read only

0 Likes
2,459

Hi Zaheed,

Thanks a lot!! your idea worked!!

Read only

former_member185177
Contributor
0 Likes
2,459

Hi K Narsingh

Before downloading the data from internal table.  You have to concatenate the required Header separated by  ";".  Then append the data from the internal table.

Hope it helps you.

Regards,

Krishna Chaitanya.

Read only

Former Member
0 Likes
2,459

Hi Narsingh,

Yeah is given one way you got Column Heading and another way if you using "GUI_DOWNLOAD"  use  "FieldNames " Tabular Parameter .

Out Put : data with column heading's .

Note :  It is For '.Xls' Format but Concept is Same for Capturing Column Heading .

Check below link..

How to Download Leading With Zeros from SAP to Excel Sheet using GUI_Download Function Module - A...

Regard's

Smruti