Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Regarding File Directory

Former Member
0 Likes
654

Hi all,

I have a requirement that i want to save a file the file name will the same as the file which i am trying to download. But i want to save the file where ever I want to.. So i want to capture the Directory path which the client want to store. Means i want to get the path of the Directory. How can i do that.

Thanx in advance

Murthy

Message was edited by:

Ramana Murthy

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
617

HI Ramana

Are you referring to Presentation Server.

In that case, below code can help you to extract the directory name:

Check this code:

DATA: DIR TYPE STRING.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_BROWSE
  EXPORTING
    WINDOW_TITLE         = 'Select Folder'
    INITIAL_FOLDER       = 'C:'
  CHANGING
    SELECTED_FOLDER      = DIR
  EXCEPTIONS
    CNTL_ERROR           = 1
    ERROR_NO_GUI         = 2
    NOT_SUPPORTED_BY_GUI = 3
    others               = 4.

Now that you have the directory, you can add the filename and save to the location.

Kind Regards

Eswar

Hi all,

I have a requirement that i want to save a file the file name will the same as the file which i am trying to download. But i want to save the file where ever I want to.. So i want to capture the Directory path which the client want to store. Means i want to get the path of the Directory. How can i do that.

Thanx in advance

Murthy

Message was edited by:

Ramana Murthy

4 REPLIES 4
Read only

Former Member
0 Likes
617

Hi Murthy,

Please check the following transaction codes.

CG3Z - Upload a file to a application server from presentation server.

CG3Y - Download a file from application server to presentation server.

Regards,

Ferry Lianto

Read only

0 Likes
617

Hi Ferry,

I did all this things. Those TCodes are correct i am using them only but i am using custom Tcodes. When i trying to select the path In the output i am not able to display in the field. Is there any other way

Murthy

Read only

Former Member
0 Likes
618

HI Ramana

Are you referring to Presentation Server.

In that case, below code can help you to extract the directory name:

Check this code:

DATA: DIR TYPE STRING.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_BROWSE
  EXPORTING
    WINDOW_TITLE         = 'Select Folder'
    INITIAL_FOLDER       = 'C:'
  CHANGING
    SELECTED_FOLDER      = DIR
  EXCEPTIONS
    CNTL_ERROR           = 1
    ERROR_NO_GUI         = 2
    NOT_SUPPORTED_BY_GUI = 3
    others               = 4.

Now that you have the directory, you can add the filename and save to the location.

Kind Regards

Eswar

Read only

Former Member
0 Likes
617

Hi Muthy,

Please use the following the methods of CL_GUI_FRONTEND_SERVICES.

DIRECTORY_BROWSE

DIRECTORY_CREATE

DIRECTORY_DELETE

DIRECTORY_EXIST

DIRECTORY_GET_CURRENT

DIRECTORY_LIST_FILES

DIRECTORY_SET_CURRENT

GET_WINDOWS_DIRECTORY

GET_TEMP_DIRECTORY

Regards,

Ferry Lianto