2008 Jun 12 2:58 AM
Hi All,
When user wants to download on to the excel file a dialog box has to come with the user desktop directory and with filename as .xls.
for example :
Directory : C:\Documents and Settings\<user>\Desktop
File name : .XLS
its urgent..
Thanks & Regards.
Bharat.
2008 Jun 12 6:39 AM
HI,
For this you have to use 2 function modules.
The first one provides F$ help for selecting file. You can use this FM and select the location and then specify the file in name with extension .xls
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
PROGRAM_NAME = SYST-REPID
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = 'P_P_SRCFIL'
CHANGING
FILE_NAME = P_P_SRCFIL
EXCEPTIONS
OTHERS = 2.
This will get the file path in to the parameter text box p_sucfil.
i_filename = p_sucfil.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = i_filename
FILETYPE = 'ASC'
WRITE_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = itab.
This will download the itab data into excel sheet .
Hope this solves the problem.
Reward points if helpful.
Thanks and regards.
2008 Jun 12 6:39 AM
HI,
For this you have to use 2 function modules.
The first one provides F$ help for selecting file. You can use this FM and select the location and then specify the file in name with extension .xls
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
PROGRAM_NAME = SYST-REPID
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = 'P_P_SRCFIL'
CHANGING
FILE_NAME = P_P_SRCFIL
EXCEPTIONS
OTHERS = 2.
This will get the file path in to the parameter text box p_sucfil.
i_filename = p_sucfil.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = i_filename
FILETYPE = 'ASC'
WRITE_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = itab.
This will download the itab data into excel sheet .
Hope this solves the problem.
Reward points if helpful.
Thanks and regards.