Application Development 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: 

How to eliminate additional row with header like F1, F2 in excel file when using gui_download

former_member596090
Discoverer
0 Kudos

Dear All

I want to download internal table data to excel file using GUI_DOWNLOAD with file type DBF, and also want to with file header text.

My question is that I insert the header text into file table but the file have unwanted header line like F1 F2..and so on. Could you please give some solution to delete them?

I also try to use the parameter FIELDNAMES in GUI_DOWNLOAD, but the file header text only could display 10 characters not full text. it is appreciate that you could give me some help to display the whole text for each field.

Thanks in advace.

Zhang Yongmei

2 REPLIES 2

former_member228164
Participant
0 Kudos

Can you attach the screenshots...and please make it simple your requirement...

former_member596090
Discoverer
0 Kudos

Dear abid ali

My requirement is download internal table data to excel file using GUI_DOWNLOAD with file type DBF, and also want to with file header text.

and the issue is the header text is not correct.

I tried 2 solution but both are failed.

So I want to get help that how to display text correct in file.

one is insert header text into internal table GT_FILE and call GUI_DOWNLOAD with file type DBF.

and the download file has unwanted header line . although we could keep this line as blank,

I want to confirm how to delete this unwanted line

LWA_FILE-FLAG_RE = TEXT-008.
LWA_FILE-PSUBID = TEXT-009.
LWA_FILE-PIDENT = TEXT-010.
LWA_FILE-PSUBNAM = TEXT-011.
LWA_FILE-PAUTHGRP = TEXT-012.
LWA_FILE-PAUTHNAM = TEXT-013.
LWA_FILE-SUBID = TEXT-014.
LWA_FILE-IDENT = TEXT-015.
LWA_FILE-SUBNAM = TEXT-016.
LWA_FILE-AUTHGRP = TEXT-017.

APPEND LWA_FILE TO GT_FILE.

CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = LV_FULLPATH
FILETYPE = 'DBF'
WRITE_FIELD_SEPARATOR = ABAP_TRUE
CODEPAGE = '8000'
TABLES
DATA_TAB = GT_FILE

The other solution is not insert header text into internal table GT_FILE but use

GUI_DOWNLOAD parameter FIELDNAMES like below:

But the file header text for each field only disply 10 characters.

For example, text is 'Materal name' in file the text maybe became'materiname'.

* Edit the fiel name for each field
LWA_NAME-NAME = TEXT-008.
APPEND LWA_NAME TO LT_FIEL_NAME.
LWA_NAME-NAME = TEXT-009.
APPEND LWA_NAME TO LT_FIEL_NAME.
LWA_NAME-NAME = TEXT-010.
APPEND LWA_NAME TO LT_FIEL_NAME.
LWA_NAME-NAME = TEXT-011.
APPEND LWA_NAME TO LT_FIEL_NAME.
LWA_NAME-NAME = TEXT-012.
APPEND LWA_NAME TO LT_FIEL_NAME.
LWA_NAME-NAME = TEXT-013.
APPEND LWA_NAME TO LT_FIEL_NAME.
LWA_NAME-NAME = TEXT-014.
APPEND LWA_NAME TO LT_FIEL_NAME.
LWA_NAME-NAME = TEXT-015.
APPEND LWA_NAME TO LT_FIEL_NAME.
LWA_NAME-NAME = TEXT-016.
APPEND LWA_NAME TO LT_FIEL_NAME.
LWA_NAME-NAME = TEXT-017.
APPEND LWA_NAME TO LT_FIEL_NAME.
LWA_NAME-NAME = TEXT-018.
APPEND LWA_NAME TO LT_FIEL_NAME.

CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = LV_FULLPATH
FILETYPE = 'DBF'
WRITE_FIELD_SEPARATOR = ABAP_TRUE
CODEPAGE = '8000'
TABLES
DATA_TAB = GT_FILE
FIELDNAMES = LT_FIEL_NAME

Thanks.

Zhang yongmei