2008 Aug 14 10:25 AM
Hello,
I have kept a button in the application tool bar and declared the user command its all working fine.
What i want to communicate is like when i select a particular material number from the list of material numbers displayed by ALV, select particular material number and click the button kept in application tool bar by which the document related to that material number has to display automatically allthe documents are stored in the desktop.
My folder name is "NEW" and one of my document name is ONE.doc. For opening the document automatically i have the idea of concatenateing the path but not getting the exact syntax my code is..
CALL METHOD cl_gui_frontend_services=>file_open_dialog
CHANGING
file_table = lt_filetab
rc = v_rc
EXCEPTIONS
file_open_dialog_failed = 1
cntl_error = 2
error_no_gui = 3
not_supported_by_gui = 4
OTHERS = 5.
READ TABLE lt_filetab INTO ls_filetab INDEX 1.
IF sy-subrc = 0.
v_file = ls_filetab-filename.
CALL METHOD cl_gui_frontend_services=>execute
EXPORTING
document = Concatenate 'C:\Documents and Settings\New\' and 'MATNR'.
ENDIF.
but this code is not working can anyone suggest me where to concatenate the path and document name.
Useful answers will be appricated.
Thks
2008 Aug 14 10:32 AM
hi babu...
chk the following code....
CALL METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE
EXPORTING
DOCUMENT = cmd_file. "path
APPLICATION =
PARAMETER =
DEFAULT_DIRECTORY =
MAXIMIZED =
MINIMIZED =
SYNCHRONOUS =
OPERATION = 'OPEN'
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
BAD_PARAMETER = 3
FILE_NOT_FOUND = 4
PATH_NOT_FOUND = 5
FILE_EXTENSION_UNKNOWN = 6
ERROR_EXECUTE_FAILED = 7
SYNCHRONOUS_FAILED = 8
NOT_SUPPORTED_BY_GUI = 9
others = 10
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
<removed by moderator>
Regards
deva
Edited by: Mike Pokraka on Aug 14, 2008 10:50 AM
2008 Aug 14 10:39 AM
Hi thks for your reply i have tried excecuteing your code its only opening the browser here i want to open the document pertaining to the material number automatically.