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

how to open a floder by clicking a button

Former Member
0 Likes
960

dear all,

my requirement is : i've to open a floder when ever i pressed a button on a screen.

Thanks in advance.,

Ajay Kumar K.

9908979994.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
894

Hi Ajay Kanigiri,

use SY-UCOMM to capture the user command event of the buttone

and call the FM CALL_BROWSER and provide the URL as import parameter...

Just copy it and try to run the program... change the url if needed but specify in CAPS

REPORT zilesh_open_folder.

CALL FUNCTION 'CALL_BROWSER'
 EXPORTING
   URL                          = 'C:\DOCUMENTS AND SETTINGS\'
*   WINDOW_NAME                  = ' '
*   NEW_WINDOW                   = ' '
*   BROWSER_TYPE                 =
*   CONTEXTSTRING                =
 EXCEPTIONS
   FRONTEND_NOT_SUPPORTED       = 1
   FRONTEND_ERROR               = 2
   PROG_NOT_FOUND               = 3
   NO_BATCH                     = 4
   UNSPECIFIED_ERROR            = 5
   OTHERS                       = 6
          .
IF SY-SUBRC <> 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

8 REPLIES 8
Read only

Former Member
0 Likes
894

Hi,

Use the method FILE_OPEN_DIALOG of class CL_GUI_FRONTEND_SERVICES

when ever the button is clicked.

Read only

0 Likes
894

Thanks for the answer.

nd can pls send any sample data if u have,

Thanks ,

With regards,

Ajay Kumar K,

9908979994.

Read only

Former Member
0 Likes
894

DEAR ALL,

PLS SEND ME THE ANS FOR MY QUESTION.IT'S URGANT.

THANK U ALL,

WITH REGARDS,

AJAY KUMAR K,

9908979994.

Read only

0 Likes
894

Hi Ajay,

Please let me know whether my understanding is right:

You have a folder path (say c:/project/sap/ or an NT file server share path) and you would like to open the folder after the user clicks on the button.

Is this your requirement?

Please clarify.

Thanks,

F.Nelson

Read only

0 Likes
894

Hi Ajay,

If my understandng is the same, please use FM CALL_BROWSER.

This should solve the purpose.

Regards,

F.Nelson

Read only

0 Likes
894

hi ,

yah u understand that well, i need the ans for the same.

thanks,

with regards,

ajay kumar k,

9908979994.

Read only

Former Member
0 Likes
894
  • Get the file that you wish to use.

at selection-screen on value-request for p_newfil.

call method cl_gui_frontend_services=>file_open_dialog

exporting

window_title = 'Select File'

default_filename = '*.doc'

multiselection = ' '

changing

file_table = g_file

rc = g_subrc.

This is how I have done it.

Regards

J

Read only

Former Member
0 Likes
895

Hi Ajay Kanigiri,

use SY-UCOMM to capture the user command event of the buttone

and call the FM CALL_BROWSER and provide the URL as import parameter...

Just copy it and try to run the program... change the url if needed but specify in CAPS

REPORT zilesh_open_folder.

CALL FUNCTION 'CALL_BROWSER'
 EXPORTING
   URL                          = 'C:\DOCUMENTS AND SETTINGS\'
*   WINDOW_NAME                  = ' '
*   NEW_WINDOW                   = ' '
*   BROWSER_TYPE                 =
*   CONTEXTSTRING                =
 EXCEPTIONS
   FRONTEND_NOT_SUPPORTED       = 1
   FRONTEND_ERROR               = 2
   PROG_NOT_FOUND               = 3
   NO_BATCH                     = 4
   UNSPECIFIED_ERROR            = 5
   OTHERS                       = 6
          .
IF SY-SUBRC <> 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7