Skip to Content
0
Former Member
Oct 26, 2005 at 06:59 AM

Problem with Column header through GUI_DOWLOAD

330 Views

Hi folks,

Iam facing a peculiar problem when using GUI_DOWNLOAD.

TO download a header, iam using a MACRO which is as follows:

DEFINE add_field_header.

clear &1.

&1-field = &2.

append &1.

END-OF-DEFINITION.

Before calling GUI_DOWNLOAD, iam filling the header as follows:

add_field_header lt_fieldnames 'Record.No'.

add_field_header lt_fieldnames 'Lic.Type'.

add_field_header lt_fieldnames 'Ext.Lic.No'.

add_field_header lt_fieldnames 'Lic.Text'.

add_field_header lt_fieldnames 'Valid.From'.

add_field_header lt_fieldnames 'Valid.to'.

add_field_header lt_fieldnames 'Customer'.

add_field_header lt_fieldnames 'Vendor'.

add_field_header lt_fieldnames 'Cust.Grp'.

add_field_header lt_fieldnames 'Material'.

add_field_header lt_fieldnames 'Mat.Grp'.

add_field_header lt_fieldnames 'Country'.

add_field_header lt_fieldnames 'Region'.

add_field_header lt_fieldnames 'County'.

add_field_header lt_fieldnames 'City'.

add_field_header lt_fieldnames 'Mode.of.Transport'.

add_field_header lt_fieldnames 'Jurisdiction'.

Then, iam calling the Funcrtion module as follows:

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

FILENAME = lw_filepath

FILETYPE = 'DBF'

WRITE_FIELD_SEPARATOR = gc_x

TABLES

DATA_TAB = GT_OIHL_ERROR_AS

FIELDNAMES = lt_fieldnames

EXCEPTIONS

FILE_WRITE_ERROR = 1

NO_BATCH = 2

GUI_REFUSE_FILETRANSFER = 3

INVALID_TYPE = 4

NO_AUTHORITY = 5

UNKNOWN_ERROR = 6

HEADER_NOT_ALLOWED = 7

SEPARATOR_NOT_ALLOWED = 8

FILESIZE_NOT_ALLOWED = 9

HEADER_TOO_LONG = 10

DP_ERROR_CREATE = 11

DP_ERROR_SEND = 12

DP_ERROR_WRITE = 13

UNKNOWN_DP_ERROR = 14

ACCESS_DENIED = 15

DP_OUT_OF_MEMORY = 16

DISK_FULL = 17

DP_TIMEOUT = 18

FILE_NOT_FOUND = 19

DATAPROVIDER_EXCEPTION = 20

CONTROL_FLUSH_ERROR = 21

OTHERS = 22.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

But, the output excel file has header which is only 10 characters long... Ex:'Jurisdiction' is getting truncated to 'Jurisdicti'...

Moreover, any spaces between the words are getting removed. Example: If i give 'Record Number' it is printing it as 'RecordNumber' in the excel file in the header.

Is there any way by which i can avoid the truncation as well as retain the spaces ?

Thanks and Regards,

Vijay