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

Create .xls file in background

Former Member
0 Likes
1,749

I want to build a program that can fill and save an excel-file. The things I have found so far opens an excel-file in the <b>fore</b>ground and fills the neccesary cells / worksheets.

See Function Module: RRM_MSEXCEL_OUTBOUND

I want to fill an excelsheet in the <b>back</b>ground and mail the populated file as attachment (*.xls).

I want to build a program that can fill and save an excel-file. The things I have found so far opens an excel-file in the <b>fore</b>ground and fills the neccesary cells / worksheets.

See Function Module: RRM_MSEXCEL_OUTBOUND

I want to fill an excelsheet in the <b>back</b>ground and mail the populated file as attachment (*.xls).

6 REPLIES 6
Read only

Former Member
0 Likes
942

Hi,

Try use the FM

ISU_TRANSFER_TO_EXCEL==>transfers document data to excel.

Sending a mail:

data: maildata type sodocchgi1.

data: mailtxt type table of solisti1 with header line.

data: mailrec type table of somlrec90 with header line.

start-of-selection.

clear: maildata, mailtxt, mailrec.

refresh: mailtxt, mailrec.

maildata-obj_name = 'TEST'.

maildata-obj_descr = 'Test'.

maildata-obj_langu = sy-langu.

mailtxt-line = 'This is a test'.

append mailtxt.

mailrec-receiver = '[email protected]'.

mailrec-rec_type = 'U'.

append mailrec.

call function 'SO_NEW_DOCUMENT_SEND_API1'

exporting

document_data = maildata

document_type = 'RAW'

put_in_outbox = 'X'

tables

object_header = mailtxt

object_content = mailtxt

receivers = mailrec

exceptions

too_many_receivers = 1

document_not_sent = 2

document_type_not_exist = 3

operation_no_authorization = 4

parameter_error = 5

x_error = 6

enqueue_error = 7

others = 8.

if sy-subrc <> 0.

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

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

endif.

Read only

Former Member
0 Likes
942

Sorry, ISU_TRANSFER_TO_EXCEL does not exist in our system:

SAP_BASIS 620 SAPKB62054 SAP Basis Component

SAP_ABA 620 SAPKA62054 Cross-Appl. Comp

SAP_APPL 470 SAPKH47024 Logistics and Acc.

Read only

0 Likes
942

call function 'GUI_DOWNLOAD'

exporting

filename = v_xl_name

filetype = 'ASC'

append = 'X'

write_field_separator = 'X'

tables

data_tab = i_format_unix

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.

*-- Collect the output filenames into internal table

concatenate 'export'

v_fcount

'.xls'

into i_xl_files-xl_name.

append i_xl_files.

clear i_xl_files.

endif.

Read only

Former Member
0 Likes
942

GUI_DOWNLOAD is in the foreground

I want to fill an excelsheet, not download a file as excelsheet

Read only

0 Likes
942

Use function module XXL_SIMPLE_API. This creates an XL file in abckground and sends it to your SAP inbox.

PS : Please reward the helpful answers.

Read only

0 Likes
942

Sorry, it won't work either.

It will send a file to the inbox, but populates it with data in the foreground when i open the attachment.

When it is being send to an internet adres it does not contain the data.