‎2007 Jul 27 3:18 PM
Hi,
I am trying to get an Excel File Name using the function module KD_GET_FILENAME_ON_F4 on a Module Pool program. I can see the name of the file but when I click on it it just does not move the filename to the screen field.
Using the DEBUGger, I found that in KD_GET_FILENAME_ON_F4 when he calls the FM WS_FILENAME_GET it returns sy-subrc as 4 (selection error).
Could you please help me with this problem?
Here is the code sample.
Best regards.
********************************************************************************************
CONSTANTS: C_XLS(25) TYPE C VALUE ',Arquivos do Excel,*.XLS'.
CONCATENATE RLGRAP-FILENAME C_XLS INTO V_TEMPARQ.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
STATIC = ' '
MASK = V_TEMPARQ
CHANGING
FILE_NAME = RLGRAP-FILENAME.
‎2007 Jul 27 4:05 PM
‎2007 Jul 27 3:22 PM
Check this..
CONSTANTS: C_XLS(25) TYPE C VALUE <b>',Arquivos do Excel,*.XLS'.</b>
CONCATENATE RLGRAP-FILENAME C_XLS INTO V_TEMPARQ.
CONCATENATE RLGRAP-FILENAME '*.xls' INTO V_TEMPARQ.
Thanks
Mahesh
‎2007 Jul 27 3:47 PM
It has not worked. =/
In the same program, the user can upload TXT and XLS files. With txt it's ok, but the excel files just does not work.
=/
Thank's and regards.
‎2007 Jul 27 3:41 PM
Check the below Code
CONSTANTS: C_XLS(25) TYPE C VALUE ',Arquivos do Excel,*.XLS'.
data: V_TEMPARQ(25) type c.
data: file_name like RLGRAP-FILENAME value ''.
move c_xls to v_temparq.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
STATIC = ' '
MASK = V_TEMPARQ
CHANGING
FILE_NAME = file_name.
write:/ file_name.
reward if helpful
Regards
Prax
‎2007 Jul 27 3:53 PM
‎2007 Jul 27 3:51 PM
Hi,
Try to use
DATA: LV_CNT TYPE I,
LS_FILENAME TYPE FILE_TABLE,
LT_FILENAME TYPE FILETABLE.
*
CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES
EXPORTING
DIRECTORY = 'C:'
FILTER = '*.*'
FILES_ONLY = 'X'
CHANGING
FILE_TABLE = LT_FILENAME
COUNT = LV_CNT.
*
LOOP AT LT_FILENAME INTO LS_FILENAME.
WRITE: / LS_FILENAME.
ENDLOOP.
aRs
‎2007 Jul 27 3:57 PM
I can see the files listed in directory C:/ but how can i make the user search the directory he wants the same way that KD_GET_FILENAME_ON_F4 do?
‎2007 Jul 27 4:05 PM
‎2007 Jul 27 4:08 PM
It worked!
Thanks ARS... I've added reward points for you all.
Regards!!!