2008 Feb 27 5:53 AM
Hi All
How can i get the files from appl server and open it with right software. Such as I upload a Excel files to appl server,Now I want download it and open it with MS Excel,How can i do that by ABAP.
BR
Chris
Hi All
How can i get the files from appl server and open it with right software. Such as I upload a Excel files to appl server,Now I want download it and open it with MS Excel,How can i do that by ABAP.
BR
Chris
2008 Feb 27 6:00 AM
Hi,
From Application server to Internal table
Use FM :
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = fpath "'c:\NON_STD.xls'
i_begin_col = 1
i_begin_row = 1
i_end_col = 100
i_end_row = 100
TABLES
intern = i_mail
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
BREAK-POINT.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
MESSAGE i000(zmamin) WITH 'error'.
ENDIF.
Now data is in Intenal table i_mail
From Here use FM GUI_DOWNLOAD
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'C:\TEMP\DATA.XLS'
WRITE_FIELD_SEPARATOR = 'X'
tables
data_tab = itab "Internal table.
2008 Feb 27 7:05 AM
hi,
here f4 help is used to get the file and it is uploaded then the contents are changed into upper case and the again it is downloaded.Chk this out.
report zflatfile_upper_f4help.
*----
INTERNAL TABLE
*----
data: begin of wi_upp occurs 0,
text type string,
end of wi_upp.
data: begin of wi_upp1 occurs 0,
text1 type string,
end of wi_upp1.
*----
DATA
*----
data: var1 like rlgrap-filename.
data: var2 like rlgrap-filename.
data : name1 type string ,
name2 type string.
*&----
*& CALLING FUNCTIONAL MODULE 'KD_GET_FILENAME_ON_F4'
*&----
call function 'KD_GET_FILENAME_ON_F4'
exporting
program_name = syst-repid
dynpro_number = syst-dynnr
changing
file_name = var1.
if sy-subrc <> 0.
endif.
name1 = var1.
*&----
*& CALLING FUNCTIONAL MODULE 'GUI_UPLOAD'
*&----
call function 'GUI_UPLOAD'
exporting
filename = name1
filetype = 'ASC'
tables
data_tab = wi_upp.
loop at wi_upp.
write:/ wi_upp-text.
translate wi_upp-text to upper case.
append wi_upp to wi_upp1.
write:/ wi_upp-text.
endloop.
*&----
*& CALLING FUNCTIONAL MODULE 'KD_GET_FILENAME_ON_F4'
*&----
call function 'KD_GET_FILENAME_ON_F4'
exporting
program_name = syst-repid
dynpro_number = syst-dynnr
changing
file_name = var2.
name2 = var2.
*&----
*& CALLING FUNCTIONAL MODULE 'GUI_DOWNLOAD'
*&----
call function 'GUI_DOWNLOAD'
exporting
filename = name2
filetype = 'ASC'
tables
data_tab = wi_upp1.
hope this helps u,
Regards,
Arunsri
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |