on 05-08-2006 6:35 AM
Hi,
I am using the FM : FILE_GET_NAME_USING_PATH
can anyone help in identifying the scnario where it can give a dump.
When going through a few sample codes.I have observed that many developers avoid using the standard Mssg ID and Msg description which the SAP provides..when a sy-subrc check fails so I was a bit confused as why the standard message has been commented and instead a new message has been given.
By default we get :
if sy-subrc ne 0.
MESSAGE MSGID sy-msgno ...
endif.
but most of the time it is commented and replaced with
message text type 'E'.
can anyone throw soem light on this.
Thanks and reagrds,
Avinash.
Hai Avinash
F.M 'WS_FILENAME_GET' was abosolete in Higher versions
replace 'WS_FILENAME_GET' with Class CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG(Method)
Check with the following Code
PARAMETERS: P_FILE LIKE RLGRAP-FILENAME. "local file with contracts
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
*----
Begin of delete by Neelimab on 03/11/2005.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
DEF_FILENAME = ''
DEF_PATH = 'C:\'
MASK = ',..'
TITLE = 'Find File'
IMPORTING
FILENAME = P_FILE
EXCEPTIONS
INV_WINSYS = 1
NO_BATCH = 2
SELECTION_CANCEL = 3
SELECTION_ERROR = 4
OTHERS = 5.
*----
End of delete by Neelimab on 03/11/2005.
*----
Begin of Add by Neelimab on 03/11/2005.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
EXPORTING
WINDOW_TITLE = 'Find File'
DEFAULT_EXTENSION = 'C:\'
DEFAULT_FILENAME = ''
FILE_FILTER = ',..'
INITIAL_DIRECTORY =
MULTISELECTION =
WITH_ENCODING =
CHANGING
FILE_TABLE = I_FILETABLE
RC = V_RC
USER_ACTION =
FILE_ENCODING =
EXCEPTIONS
FILE_OPEN_DIALOG_FAILED = 1
CNTL_ERROR = 2
ERROR_NO_GUI = 3
NOT_SUPPORTED_BY_GUI = 4
others = 5
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE I_FILETABLE INTO P_FILE INDEX 1.
*----
End of Add by Neelimab on 03/11/2005.
Thanks & Regards
Sreenivasulu P
Message was edited by: Sreenivasulu Ponnadi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There are different ways of the using the MESSAGE statements. I guess its just ease of usage which makes the developer use a different syntax than the standard code.
The functionality doesn't change anyway.
Regards,
Ravi
Note : Please mark the helpful answers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, however, if internall the standard code raise the error it will still dump.
You will have to be careful while passing the parameters, and unless there is a difference in datatypes, the dump usually does not happen.
Regards,
Ravi
Note : Please close the thread if the question is answered and mark all the helpful answers
Avinash,
With in the code of the function, the code might have the MESSAGE statement which might have a A or X and might cause a short dump and this usually depends on what values you are passing. So, if that happens, the dump happens without even coming back to your code.
Note : SDN's way of saying thanks is be marking all the helpful answers of a thread and closing the thread "SOLVED PROBLEM", once the question is answered.
Welcome to SDN Forums.
Regards,
Ravi
also when the exceptions are commented and not handled via sy-subrc ne 0
you will get a dump when exception happens
CALL FUNCTION 'FILE_GET_NAME_USING_PATH'
EXPORTING
CLIENT = SY-MANDT
logical_path = logical_path
OPERATING_SYSTEM = SY-OPSYS
PARAMETER_1 = ' '
PARAMETER_2 = ' '
PARAMETER_3 = ' '
USE_BUFFER = ' '
file_name = file_name
USE_PRESENTATION_SERVER = ' '
ELEMINATE_BLANKS = 'X'
IMPORTING
FILE_NAME_WITH_PATH = FILE_NAME_WITH_PATH
EXCEPTIONS
PATH_NOT_FOUND = 1
MISSING_PARAMETER = 2
OPERATING_SYSTEM_NOT_FOUND = 3
FILE_SYSTEM_NOT_FOUND = 4
OTHERS = 5
.
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
Raja
Use
<b>WS_FILENAME_GET</b> Call file Selector Browse and get file name of the chosen type
use above function module.
regards
vinod
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vinod,
Thanks for the input,
But it be helpful if i can know whether using the Fm FILE_GET_NAME_USING_PATH will result in a short dump When the standard functionality is used inseted of handling it using the Message ;text tyep E way
by standard i mean :
if sy-subrc ne 0.
MESSAGE MSGID sy-msgno msgno
endif.
Avinash,
There is no specific way of doing that. When the dump happens usually you can find why it has occured and make sure your parameters are not causing the issue.
Once the X or A, there is nothing much we can do about it. And more over, when that happends that means some thing has happened that should not have happened.
Regards,
Ravi
Note Please mark the helpful answers
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.