05-05-2009 7:42 AM
hello
experts,
when we are uploading a file name through f4_filename browser, FM the result sometime we have to take in a variable type string otherwise there is a short dump. why such things happens.
05-05-2009 7:45 AM
Hi,
Because you are using the function module.
Check the function module. Goto SE37--> FM --> Import parameters. There you can find the Data type for the file name. It will be string.
So if you use otherthan string then datatype mismatch will occur and a short dump occurs.
SE38->Call Function 'FM'-> Exporting filename = p_filename.
p_filename should have the datatype same as filename's datatype in the function module.
Thanks and Best Regards,
Suresh
05-05-2009 7:48 AM
Hi:
The best way is,
go in se37 -> Put the FM name and click on Where used list, it would display the name of used program name, Just see how the fm is being used with data declaration.
Regards
Shashi
05-05-2009 7:49 AM
Hi,
For the file_name variable is of type DYNFNAM. i.e. which is of type CHAR132. If you specify it will less lengh, and trying to move the one with more lengh then, it may lead to dump.
So try using the types given the function modules itself.
Regards,
Santhosh.
05-05-2009 7:50 AM
05-05-2009 7:55 AM
Hi,
You have to use
data: p_fname type string .
p_fname = 'C:/temp/sss.xls' .
Path format itu2019s accepted only for string data type, some special character there u2026u2026
Regards,
Ansari.
05-05-2009 7:58 AM
Hi,
whenever we are using FM for uploading the file, please make sure that import, export and tables and changing parameters which you are passing/accessing should contain same data type, other wise FM will throw a dump
05-05-2009 8:10 AM
use
* Needed for Class CL_GUI_FRONTEND_SERVICES
DATA:
IT_FILTB TYPE FILETABLE,
V_RETCD TYPE I.
W_PATH TYPE STRING VALUE 'C:\xyz\blablabla',
I_WHATTYPE TYPE STRING.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
EXPORTING
WINDOW_TITLE = 'Open File' "Titel
FILE_FILTER = 'all files (*.csv*)|*.CSV*|' "type of file
INITIAL_DIRECTORY = W_PATH "directory (see value)
DEFAULT_FILENAME = I_WHATTYPE
CHANGING
FILE_TABLE = IT_FILTB
RC = V_RETCD
EXCEPTIONS
FILE_OPEN_DIALOG_FAILED = 1
CNTL_ERROR = 2
ERROR_NO_GUI = 3
NOT_SUPPORTED_BY_GUI = 4
OTHERS = 5.
05-05-2009 8:23 AM
Hi,
Yes in FM F4_FILENAME the filename has to be of type IBIPPARMS-PATH or RLGRAP-FILENAME as follows:
PARAMETER P_FNAME LIKE RLGRAP-FILENAME OBLIGATORY.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FNAME.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
* PROGRAM_NAME = SYST-CPROG
* DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = 'P_FNAME'
IMPORTING
FILE_NAME = P_FNAME
.
However if you wish to have the filename as string simply convert:
DATA: P_FNAME2 TYPE STRING.
P_FNAME2 = P_FNAME.
Or vice versa.
Regards.
07-28-2009 9:09 AM
07-28-2009 9:09 AM