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: 

Excel file to unix server

Former Member
0 Kudos

Hi,

i need the next:

1) create excel file (in unix server if possible)

2) move the excel file to unix server (if 1 is not possible)

3) send via email the excel file

This program is running in background job thas why i need to copy the file in unix server.

my problem is in create the excel file in the unix server...

Thanks on advance.

David Fúnez

Tegucigalpa, Honduras

1 ACCEPTED SOLUTION

kesavadas_thekkillath
Active Contributor
0 Kudos

Check the sample code below, it creates a excel file in application server


DATA:WK_string TYPE STRING.
DATA:WK_path TYPE STRING.

concatenate '/METERID/' 'TESTFILE' '.XLS'  into wk_path.
 open dataset WK_path for output in text mode encoding default.
if sy-subrc  ne 0.
write:'ERROR while opening dataset !!!!!!'.
EXIT.
endif.

LOOP AT ITAB.
at first.
concatenate 'Part No' 'Description'
	into wk_string separated by cl_abap_char_utilities=>horizontal_tab.
condense wk_string.
transfer wk_string to WK_path.
ENDAT.
CLEAR wk_string.
CONCATENATE ITAB-MATNR itab-maktx into wk_string 
	separated by cl_abap_char_utilities=>horizontal_tab.
transfer wk_string to WK_path.
at last.
close dataset wk_path.
endat.
endloop.

6 REPLIES 6

kesavadas_thekkillath
Active Contributor
0 Kudos

Check the sample code below, it creates a excel file in application server


DATA:WK_string TYPE STRING.
DATA:WK_path TYPE STRING.

concatenate '/METERID/' 'TESTFILE' '.XLS'  into wk_path.
 open dataset WK_path for output in text mode encoding default.
if sy-subrc  ne 0.
write:'ERROR while opening dataset !!!!!!'.
EXIT.
endif.

LOOP AT ITAB.
at first.
concatenate 'Part No' 'Description'
	into wk_string separated by cl_abap_char_utilities=>horizontal_tab.
condense wk_string.
transfer wk_string to WK_path.
ENDAT.
CLEAR wk_string.
CONCATENATE ITAB-MATNR itab-maktx into wk_string 
	separated by cl_abap_char_utilities=>horizontal_tab.
transfer wk_string to WK_path.
at last.
close dataset wk_path.
endat.
endloop.

0 Kudos

Thanks a lot, it works.

0 Kudos

Hi Thaks for the reply ,

The same i have to do it for multiple excel sheets...sheet1 is having some data and sheet2 is having some data with one application . I want to transfer this excel application to unix server.

Pls suggest me .

Regards,

Krishna.

0 Kudos

Hi you can search in the SCN Wiki for this, you must use the OLE method.

0 Kudos

Hi ,

I need to excute this report in background mode.

I've created two worksheets with one application and transferred the data , Now i need to move this to uinx server

Help me ....

Regards,

Krishnamoorthy V.

0 Kudos