2008 May 02 5:14 AM
In the selection screen input field
there is an option of selecting the directory and file name and not the extension .
This is used to download the datas
Extension can be selected by using the option button
rtf
csv.
the user has to give only the filename and not the extension.
suppose if the user input is C:\temp\file1.doc.
Either i should take only the filename
or i should display the message give only the filename and not the extension . its already been selected!!!!
I want to compare the input string contains .doc
how to do the comparison and to get the above results mentiond
Thanks
ABAPer
2008 May 02 5:22 AM
hi abap dev
generally in this sort of situation ppl generally give a parameter for the extension as well.. and concatenate in the program.. all there parameters and build the file path.....
parameters 1 for path default 'c:/temp/',
parameters 2 for file name default 'filename',
parameters 3 for extension default '.csv'.
concatenate parameter1 parameter2 parameter3 into file-name.
In the selection screen input field
there is an option of selecting the directory and file name and not the extension .
This is used to download the datas
Extension can be selected by using the option button
rtf
csv.
the user has to give only the filename and not the extension.
suppose if the user input is C:\temp\file1.doc.
Either i should take only the filename
or i should display the message give only the filename and not the extension . its already been selected!!!!
I want to compare the input string contains .doc
how to do the comparison and to get the above results mentiond
Thanks
ABAPer
2008 May 02 5:17 AM
Hi,
You can use the following piece of code:
if p_file cs '.doc'.
your code here...
endif.
Regards,
Himanshu
2008 May 02 5:22 AM
hi abap dev
generally in this sort of situation ppl generally give a parameter for the extension as well.. and concatenate in the program.. all there parameters and build the file path.....
parameters 1 for path default 'c:/temp/',
parameters 2 for file name default 'filename',
parameters 3 for extension default '.csv'.
concatenate parameter1 parameter2 parameter3 into file-name.
2008 May 02 5:42 AM
hi,
I have already done using the method given by you.
Because the requirment is there are two option buttion for selecting the download file format
But unknowingly if the user gives the filename along with the extension. I need to handle that error
giving some error message or information message
By comparing the last 4 letters of the filename.. either.doc or rtf or csv or watever
so how to do that
then after comparing that i should give the user a msg doc type is already selected give only the filename
I hope u understand my req
thanks
2008 May 02 5:58 AM
hmm.. so when ever user gives a extension there will be dot right.. so check for a dot and raise the error..
at selection-screen.
if filename CA '.'.
message text-001. "<<<<< plz dont select the extension of in the path
elseif filename CS '.doc'.
message text-002. "<<<<<file extension .doc is not allowed..
elseif.........
.........
.....
endif.
2008 May 02 6:14 AM
Friend,
I have one more doubt to be clarified in this..
Please help me
we are searching for a dot in the input field.
i.e filename along with the directory.
if the directory name contains any '.' then also it will display the same message.
whether in the directory , do v have any dot as a character in that.
Kiindly clarify this too.
2008 May 02 6:20 AM
hmm thats right.. in real world.. ppl generally use c:/temp as default path...
check out if this is FM is of any help to you..
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
mask = ',*.txt,*.txt'
static = 'X'
CHANGING
file_name = p_pcfile.
2008 May 02 6:48 AM
ya . i have already using this functiom module to get the f4 help for the filename..
But mask uses only a single character.
i dont know how far it will be helpful for my requirement.
if any other method is there , like to retrieve the last four characters of the file path.
c:\doc\file\filename.rtf
I think then i can comparree. please correct me if i am wriong and suggest some good method also
2008 May 02 8:31 AM
Hi
Call the following function and pass the file name entered in the selection.
CALL FUNCTION 'CRM_IC_WZ_SPLIT_FILE_EXTENSION'
EXPORTING
IV_FILENAME_WITH_EXT = <Your Upload/Download file from selection>
IMPORTING
EV_FILENAME = <Your Upload/Download file without file extension is returned>
EV_EXTENSION = <Your file extension is returned here>.
Do the required comparision and display the error.
Thanks
Vijay
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |