Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Problem in downloading

Hi Experts ,

How can i download the output of the report in to excel file format

DATA:list_tab1 TYPE TABLE OF abaplist.

ELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

PARAMETERS : C1 AS CHECKBOX.

PARAMETER: VARR1 type VARID-VARIANT.

SELECTION-SCREEN END OF BLOCK B1.

SELECTION-SCREEN PUSHBUTTON /10(5) SEL USER-COMMAND PRI .

INITIALIZATION.

SEL = 'PUSH BUTTON'.

AT SELECTION-SCREEN.

CASE SY-UCOMM.

WHEN 'PRI'.

IF C1 = 'X'.

  • SELECT * APPENDING TABLE T_VARID1

*

  • FROM VARID

*

  • WHERE REPORT EQ 'ZRM07MLBD'.

if VARR1 is initial.

submit ZRM07MLBD

  • line-size p_linesz

  • line-count p_linect

via selection-screen

exporting list to memory

and return.

else.

submit ZRM07MLBD

  • line-size p_linesz

  • line-count p_linect

using selection-set VARR1

exporting list to memory

and return.

endif.

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

listobject = list_tab1

EXCEPTIONS

not_found = 1

OTHERS = 2.

IF sy-subrc = 0.

CALL FUNCTION 'WRITE_LIST'

TABLES

listobject = list_tab1.

ENDIF.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

  • BIN_FILESIZE =

filename = 'C:\documents and settings\SAP\Desktop\Report\Report1.D'

filetype = 'ASC'

append = space

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

  • IMPORTING

  • FILELENGTH =

TABLES

data_tab = list_tab1

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

ELSE.

MESSAGE 'FILE UPDATED SUCCESSFULLY' TYPE 'I'.

ENDIF.

CLEAR LIST_TAB3.

*

*CALL FUNCTION 'GUI_DOWNLOAD'

*EXPORTING

** BIN_FILESIZE =

*filename = 'C:\documents and settings\SAP\Desktop\Report\Report1.xls'

  • filetype = 'ASC'

** APPEND = ' '

** WRITE_FIELD_SEPARATOR = ' '

** HEADER = '00'

** TRUNC_TRAILING_BLANKS = ' '

** WRITE_LF = 'X'

** COL_SELECT = ' '

** COL_SELECT_MASK = ' '

** DAT_MODE = ' '

** IMPORTING

** FILELENGTH =

*

*TABLES

*data_tab = T_VARID1.

*

ENDIF.

pls correct this coding is there any need of declaring internal table and something pls

Thanks & Regads

Mohan Reddy

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question