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: 

Reg:Download FM

Former Member
0 Kudos

Hi All,

Iam using the FM GUI_DOWNLOAD to download the table data to an excel sheet.

But if the Output field contains any characters like -,;,# then data in the excel sheet is shifting to next column.Kindly suggest me how to proceed.

Thanks & Regards,

Padmasri.

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

Try to use [SAP_CONVERT_TO_CSV_FORMAT|https://www.sdn.sap.com/irj/sdn/advancedsearch?query=sap_convert_to_csv_format&cat=sdn_all] and then download the result table.

Regards

3 REPLIES 3

raymond_giuseppi
Active Contributor
0 Kudos

Try to use [SAP_CONVERT_TO_CSV_FORMAT|https://www.sdn.sap.com/irj/sdn/advancedsearch?query=sap_convert_to_csv_format&cat=sdn_all] and then download the result table.

Regards

Former Member
0 Kudos

Hi,

I hope it will help you.

Regards,

Harish

former_member585060
Active Contributor
0 Kudos

Hi,

Declare as following and give filetype as DBF and check the output.

se sample code.

DATA: w_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

  • BIN_FILESIZE =

filename = w_file

filetype = 'DBF'

  • append = ' '

write_field_separator = w_tab

  • HEADER = '00'

  • TRUNC_TRAILING_BLANKS = ' '

  • WRITE_LF = 'X'

  • COL_SELECT = ' '

  • COL_SELECT_MASK = ' '

  • DAT_MODE = ' '

  • CONFIRM_OVERWRITE = ' '

  • NO_AUTH_CHECK = ' '

  • CODEPAGE = ' '

  • IGNORE_CERR = ABAP_TRUE

  • REPLACEMENT = '#'

  • WRITE_BOM = ' '

  • TRUNC_TRAILING_BLANKS_EOL = 'X'

  • WK1_N_FORMAT = ' '

  • WK1_N_SIZE = ' '

  • WK1_T_FORMAT = ' '

  • WK1_T_SIZE = ' '

  • IMPORTING

  • FILELENGTH =

TABLES

data_tab = it_extractchar

fieldnames = it_header

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.

-


Regards

Bala Krishna