2013 Jul 01 12:34 PM
Hi Gurus,
I am using FM TMP_GUI_DIRECTORY_LIST_FILES to list files in a folder. This FM is working fine in my PC but when we try it in the user's PC it not working nor throwing any exceptions. Please throw light in this issue.
Regards
Anil Malhotra
2013 Jul 02 1:15 PM
Dear All,
Thanks you all for your valuable comments. The problem has been solved by re-installing the SAP GUI.
Regards
Anil Malhotra
Dear All,
Thanks you all for your valuable comments. The problem has been solved by re-installing the SAP GUI.
Regards
Anil Malhotra
2013 Jul 01 12:51 PM
Hi Anil
it's missing user authorisations from sap or client(microsoft i suppose) perspective
Let me know if you need on how to proceed
a
2013 Jul 02 5:52 AM
Hi Andrea,
I think so its not authorization issue in SAP because in both the systems I used my login. If it is client issue(Microsoft) then what I need to check. The user is using Win 7.
Regards
Anil Malhotra
Message was edited by: Anil Malhotra
2013 Jul 02 10:32 AM
Hi Anil
right! so, to make it easy, ask to your support team (in case you can't by yourself) to give admin rights on that computer for microsoft user you are using
Meanwhile it would be useful if you can login to erp op system and try to map the c drive of the client (there could be some network port locked ...)
Let me know if u need me
a
2013 Jul 01 12:52 PM
Hi,
I am not sure about this issue,but You can check this sap notes
Note 1583869 - Template report for copying the location environment
also You can check this wiki help
http://wiki.sdn.sap.com/wiki/display/Snippets/Working+With+Files
Thanks
Gourav.
2013 Jul 01 1:08 PM
Hi Anil,
The alternative for above FM is:
CL_GUI_FRONTEND_SERVICES->DIRECTORY_LIST_FILES.
Example for using it.
DATA: wa_pfile TYPE file_table.
DATA: it_pfiles TYPE STANDARD TABLE OF file_table,
count TYPE i,
dir TYPE string VALUE 'C:\temp\'.
CALL METHOD cl_gui_frontend_services=>directory_list_files
EXPORTING
directory = dir
files_only = 'X'
CHANGING
file_table = it_pfiles
count = count
EXCEPTIONS
cntl_error = 1
directory_list_files_failed = 2
wrong_parameter = 3
error_no_gui = 4
not_supported_by_gui = 5
OTHERS = 6.
LOOP AT it_pfiles INTO wa_pfile.
WRITE wa_pfile.
ENDLOOP.
Regards,
Anil.
2013 Jul 02 10:36 AM
Hi Anil
Check the Directory Path you are passing?
Is that path exists in the use desktop? Is it accessible ?
If you are using any shared directlry then is it accessible ?
Regards,
Venkat
2013 Jul 02 11:02 AM
HI Anil,
CALL FUNCTION 'TMP_GUI_DIRECTORY_LIST_FILES'
EXPORTING
directory = 'D:\ramesh' " giving path like this is not correct - this path may not be with your user
* FILTER = '*.*'
* IMPORTING
* FILE_COUNT =
* DIR_COUNT =
tables
file_table = filetable
dir_table = dirtable
* EXCEPTIONS
* CNTL_ERROR = 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.
Try like this
DATA: ini_path TYPE string,
sel_path TYPE string,
filetable like SDOKPATH OCCURS 0 WITH HEADER LINE,
dirtable like SDOKPATH OCCURS 0 WITH HEADER LINE.
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001 .
PARAMETER: p_path TYPE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN : END OF BLOCK b1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path.
CALL METHOD cl_gui_frontend_services=>directory_browse
EXPORTING
initial_folder = ini_path
CHANGING
selected_folder = sel_path
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
OTHERS = 3.
IF sy-subrc = 0.
CALL METHOD cl_gui_cfw=>flush( ).
IF sel_path IS NOT INITIAL.
p_path = ini_path = sel_path.
ENDIF.
ENDIF.
START-OF-SELECTION.
CALL FUNCTION 'TMP_GUI_DIRECTORY_LIST_FILES'
EXPORTING
directory = p_path
* FILTER = '*.*'
* IMPORTING
* FILE_COUNT =
* DIR_COUNT =
tables
file_table = filetable
dir_table = dirtable
* EXCEPTIONS
* CNTL_ERROR = 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.
Loop at filetable.
write : / filetable-pathname.
endloop.
loop at dirtable.
write: / dirtable-pathname.
endloop.
Regards,
Ramesh.T
2013 Jul 02 12:09 PM
Hi Anil,
Step 1.
Try use function - CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
Else Step 2
As I already posted, the issue is with the PATH.
As long as you are testing by giving the C:\temp\ from your system.
In order to make it avaialbe, it is always recommended that you should use the Shared File system..
I have similar requiremetn to read the XML files from the Shared folder whenever user executes a tcode.
So what I did is as follows :
Define the parameter - default it to a value with Shared directory.
PARAMETERS: p_filnam TYPE localfile DEFAULT '\\XXXXXXX\FILESERVER\SAP\Default.xml'.
In your case instead of C:\Temp\ - use teh shared file fodler...
Regards,
Venkat
2013 Jul 02 1:15 PM
Dear All,
Thanks you all for your valuable comments. The problem has been solved by re-installing the SAP GUI.
Regards
Anil Malhotra
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |