2013 May 27 2:52 PM
Hi All,
I have successfully uploaded an excel file to application server(AL11 -Tcode), the problem is I am unable to download the excel data which i have uploaded to application server data to Presentation server.
Please help me out on this issue.
Thanks,
Mahesh
Hi All,
I have successfully uploaded an excel file to application server(AL11 -Tcode), the problem is I am unable to download the excel data which i have uploaded to application server data to Presentation server.
Please help me out on this issue.
Thanks,
Mahesh
2013 May 27 3:19 PM
2013 May 27 5:56 PM
Hi,
If you are trying to download the file using a program follow the below steps,
1) Use OPEN DATASET to open the file in application server.
2) Make use of READ DATASET to read the file content to an internal table.
3) Use GUI_DOWNLOAD to download the internal table data to presentation server.
Hope this helps,
~Athreya
2013 May 28 6:49 AM
sample code for upload:
SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-001.
PARAMETERS : up_file TYPE rlgrap-filename OBLIGATORY." This Parameters using File select File Input
SELECTION-SCREEN END OF BLOCK b.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR up_file.
CALL FUNCTION 'F4_FILENAME'
" Using Call function File Select
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = ' '
IMPORTING
file_name = up_file.
*----------------------------------------------------------------------*
* START OF SELECTION *
*----------------------------------------------------------------------*
START-OF-SELECTION.
REFRESH it_excel.
IF up_file IS NOT INITIAL.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
" Using Call function File Select Upload excel sheet to sap Systems
EXPORTING
i_line_header = 'X'
i_tab_raw_data = it_raw
i_filename = up_file
TABLES
i_tab_converted_data = it_excel
EXCEPTIONS
conversion_failed = 1
OTHERS = 2 .
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ELSE.
MESSAGE 'Please enter a file !!!,' TYPE 'I'.
ENDIF.