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

data transfer to excel sheet

Former Member
0 Likes
657

I am trying to download some fields into excel,i am putting first line as blank.there is some field with type DATUM.for this field it is giving // character in excel sheet.

i want only blank space.what should be done?

Regards,

Prasad

5 REPLIES 5
Read only

Former Member
0 Likes
614

Hi Prasad,

date will appear in the same format as it is in internal table.check ur internal table data first.

Refer this code and then try.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

  • BIN_FILESIZE =

filename = v_file "name of the excel file in which u want to "download data

filetype = 'ASC'

  • APPEND = ' '

write_field_separator = 'X'

  • 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 = '30'

  • IMPORTING

  • FILELENGTH =

TABLES

data_tab = i_tab

  • 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.

.

IF sy-subrc = 0.

MESSAGE i002.

ENDIF.

Reward points if helpful.

Regards,

Hemant

Read only

0 Likes
614

Without changing the format in internal table i have to put the space there.is there any way.

Read only

Former Member
0 Likes
614

Hi Sai,

Have a look at demo program SAPRDEMO_TABLES_IN_EXCEL.Hope this programs gives some inputs.

Well i think it will surely solve your purpose...

Regards,

Jayant

Read only

Former Member
0 Likes
614

Hi,

Try this FM.

CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'

EXPORTING

  • I_FIELD_SEPERATOR =

  • I_LINE_HEADER =

I_FILENAME = LV_FILENAME

  • I_APPL_KEEP = ' '

TABLES

I_TAB_SAP_DATA = ITAB_DATA_EXCEL

  • CHANGING

  • I_TAB_CONVERTED_DATA =

EXCEPTIONS

CONVERSION_FAILED = 1

OTHERS = 2

.

This might help you.

Regards,

Hemant.

Read only

0 Likes
614

Is there anyway to put field names while downloading to excel sheet.