2009 Mar 17 9:22 AM
Hi all,
I had used function module GUI_DOWLOAD for downloading the excel to a file specified in the path.While executing its working fine and downloading the file to excel.But while runnijg it in the background the Excel file is not getting saved to the specifie path.Can anyone tell me a solution.
Please reply.
Thanks in Advance
Nitin
2009 Mar 17 9:24 AM
GUI_download doesnot support download functionality in background.
2009 Mar 17 9:24 AM
2009 Mar 17 9:24 AM
This function does not work in background mode, only foreground (GUI...).
Use open dataset commands instead.
Edited by: Shmilo on Mar 17, 2009 10:25 AM
2009 Mar 17 9:24 AM
2009 Mar 17 9:25 AM
Hi,
Thanks to all fo rthe reply.
Then can anyone tell which function module to use instead.
Thanks
Nitin
2009 Mar 17 9:28 AM
2009 Mar 17 9:33 AM
Hi,
GUI_DOWNLOAD FM will not support in background mode.
Otherwsie use OPEN DATASET and write the data in the application server.
And also check is there any other FM's.
2009 Mar 17 9:43 AM
PLease use this function module to perform the required task
'SAP_CONVERT_TO_XLS_FORMAT', If you are using any other function modules all the data will go into the A1 cell and not as the structure of the internal table.
This is a standard FM that will write in the structure of the Itable.
ChK
Edited by: Harsha Cheruku on Mar 17, 2009 10:43 AM
Edited by: Harsha Cheruku on Mar 17, 2009 10:43 AM
2009 Mar 17 9:40 AM
hi,
Try Using this , ie class interface.
cl_gui_frontend_services=>gui_download
Thanks and Regards
Suraj
2009 Mar 17 9:44 AM
Hi Nitin ,
In this context, we can also use OLE to save the excel file including various cell formating actions.
Regards,
Nitin Sikka.
2009 Mar 17 9:47 AM
Hi,
You cannot write data to Presentation Server while executing the program in the background,
GUI_DOWNLOAD will not work.
So your option is to write a file on the app server, which can be done by OPEN DATASET.
(OR)
There is no way to do it as a background job.. create the folder..
transfer the file to the appliaction server in the backgorund using OPEN DATASET...
use the tcode CG3Y to download the file from the app server to your folder..
Regards,
Shalini
2009 Mar 17 9:47 AM
GUI_DOWNLOAD will not work for downloading the report into Excel in background.
You can try this code,
DATA : l_mess(200).
DATA : i_tab LIKE text1.
OPEN DATASET <Path> FOR INPUT IN TEXT MODE ENCODING DEFAULT MESSAGE l_mess.
IF sy-subrc NE 0.
MESSAGE w_msg TYPE 'S' DISPLAY LIKE 'E'.
LEAVE LIST-PROCESSING.
ENDIF.
DO.
READ DATASET w_path INTO i_tab.
IF sy-subrc EQ 0.
i_tab2 = i_tab.
APPEND i_tab2.
CLEAR i_tab2.
ELSE.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET w_path.
Regards,
Joan
2009 Mar 17 9:49 AM
Hi all,
Thanks a lot .
I will try by using OPEN DATASET n revert back.
Thanks once more.
Nitin
2009 Mar 17 9:51 AM
HI Nitin,
GUI_DOWNLOAD FM is not supported in forground.
Better you use OPEN DATASET... and write the data in Application server.
Or if you are generating a List then it will create Spool when executed in Background. Which you can download later from SP01.
Regards,
Nitin.
2009 Mar 17 9:52 AM
Hi Nitin,
You can do like this,
TYPE-POOLS: slis,truxs.
DATA: it_upload TYPE STANDARD TABLE OF i_upload, "internal table having uploaded file data
wa_upload LIKE LINE OF it_upload.
DATA: it_raw TYPE truxs_t_text_data. "internal table declared to be passed in the
"function module used to convert data from
"xls to sap
START-OF-SELECTION.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
i_field_seperator = 'X'
i_line_header = 'X'
i_tab_raw_data = it_raw
i_filename = p_file
TABLES
i_tab_converted_data = it_upload[]
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.
Hope it helps
Regards
Mansi
2009 Mar 18 9:04 AM
Hi all,
reagrding the dowloading of ALV to excel in bacjground some one suggested me to use FM 'EXCEL_OLE_STANDARD_DAT' ..how far this will help is my problem,ie dowloading not occuring while executing in Background.
Thanks,
Nitin