2006 Nov 27 9:14 AM
hi,
i need a function module to get me the physical path of the directory on F4
for eg.
function module 'KD_GET_FILENAME_ON_F4'
allows us to select the file (on pressing F4) and gives the physical path of the selected file.
Similarly i want the function which selects the DIRECTORY and gives the physical path of the DIRECTORY..
2006 Nov 27 9:18 AM
Take a look at the CL_GUI_FRONTEND_SERVICES, and you will find all kinds of the methods, which will solve your requirement.
Regards,
Ravi
Note - Please mark all the helpful answers
hi,
i need a function module to get me the physical path of the directory on F4
for eg.
function module 'KD_GET_FILENAME_ON_F4'
allows us to select the file (on pressing F4) and gives the physical path of the selected file.
Similarly i want the function which selects the DIRECTORY and gives the physical path of the DIRECTORY..
2006 Nov 27 9:16 AM
hi,
try FM F4_FILENAME.
use it in at selection-screen on value-request for ...
event.
santhosh
Message was edited by:
Kaluvala Santhosh
2006 Nov 27 9:17 AM
2006 Nov 27 9:18 AM
Take a look at the CL_GUI_FRONTEND_SERVICES, and you will find all kinds of the methods, which will solve your requirement.
Regards,
Ravi
Note - Please mark all the helpful answers
2006 Nov 27 9:20 AM
2006 Nov 27 10:22 AM
hi,
all the above are used for getting the path for FILENAME..
but none of them is used for getting just the DIRECTORY..
Please Reply.
Thanks
2006 Nov 27 10:29 AM
Anuj
The follwing are the methods of CL_GUI_FRONTEND_SERVICES that deal with directories
DIRECTORY_BROWSE
DIRECTORY_CREATE
DIRECTORY_DELETE
DIRECTORY_EXIST
DIRECTORY_GET_CURRENT
DIRECTORY_LIST_FILES
DIRECTORY_SET_CURRENT
GET_WINDOWS_DIRECTORY
GET_TEMP_DIRECTORY
If you want to get the directory, DIRECTORY_GET_CURRENT and GET_WINDOWS_DIRECTORY should help you.
Regards,
Ravi
Note - Please mark the helpful answers
2006 Nov 28 4:46 AM
hi ,
you have mentioned
**************************************************8
The follwing are the methods of CL_GUI_FRONTEND_SERVICES that deal with directories
DIRECTORY_BROWSE
DIRECTORY_CREATE
DIRECTORY_DELETE
DIRECTORY_EXIST
DIRECTORY_GET_CURRENT
DIRECTORY_LIST_FILES
DIRECTORY_SET_CURRENT
GET_WINDOWS_DIRECTORY
GET_TEMP_DIRECTORY
If you want to get the directory, DIRECTORY_GET_CURRENT and GET_WINDOWS_DIRECTORY should help you.
***********************************************************************************
But none of the functions are existing in SAP ??
Please reply.
Thanks
Anuj
2006 Nov 28 4:56 AM
Anuj,
These are not functions, these are methods of the class CL_GUI_FRONTEND_SERVICES.
Go to SE24, put in CL_GUI_FRONTEND_SERVICES and you can see all the methods that I have mentioned here.
Here is a sample call
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GET_WINDOWS_DIRECTORY
CHANGING
WINDOWS_DIRECTORY =
* EXCEPTIONS
* CNTL_ERROR = 1
* ERROR_NO_GUI = 2
* NOT_SUPPORTED_BY_GUI = 3
* others = 4
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.Regards,
Ravi
Note - Please mark all the helpful answers
2006 Nov 28 5:43 AM
Ravi,
My sample code is..
*******************************************************************************************
REPORT ZEST_DOWNLOAD.
PARAMETERS: p_fname type STRING.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GET_WINDOWS_DIRECTORY
CHANGING
WINDOWS_DIRECTORY = p_fname
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
NOT_SUPPORTED_BY_GUI = 3
others = 4
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
write: p_fname.
***************************************************************************************************
When i am executing this method 'GET_WINDOWS_DIRECTORY' function is getting called but there is no pop up for directory selection and neither it is raising any exceptions.. what should i do now ??
2007 Jan 04 2:45 PM
> When i am executing this method
> 'GET_WINDOWS_DIRECTORY' function is getting called
> but there is no pop up for directory selection and
> neither it is raising any exceptions.. what should i
> do now ??
Hi Anuj Pachauri,
I had the same problem. Just add
CALL METHOD CL_GUI_CFW=>FLUSH.
or the FM CONTROL_FLUSH
CALL FUNCTION 'CONTROL_FLUSH'.
after the first method is called.
It transfers the buffered automation-queue to the frond-end.
In your case:
*******************************************************************************************
REPORT ZEST_DOWNLOAD.
PARAMETERS: p_fname type STRING.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GET_WINDOWS_DIRECTORY
CHANGING
WINDOWS_DIRECTORY = p_fname
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
NOT_SUPPORTED_BY_GUI = 3
others = 4
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
<b>
CALL METHOD CL_GUI_CFW=>FLUSH.</b>
write: p_fname.
***************************************************************************************************
This should solve the problem.
Reward with points if helped, please.
Message was edited by:
Erik Nagler
2006 Nov 27 10:27 AM
Hi ,
Check these from CL_GUI_FRONTEND_SERVICES
->DIRECTORY_BROWSE
->DIRECTORY_GET_CURRENT
->DIRECTORY_LIST_FILES
->DIRECTORY_SET_CURRENTRegards,
Raghav
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |