Cl_gui_frontend_services= file_save_dialog - how to admit JUST .txt ext
hi all, i'm using the: cl_gui_frontend_services=>file_save_dialog class and method..
My question, how can i do for RESTRICT the file extension of the file JUST to '.txt' ?? if the user select the name of the file to create to 123.pdf -for example- that the system don't let him to continue, or just add the txt extension to the final of the filename.. -like 123.pdf.txt ??
Thanks!!
Hi Pampeano,
i I have created a small code snippet :-
LV_FILENAME TYPE STRING,
LV_FULLPATH TYPE STRING,
LV_PATH TYPE STRING,
LV_ACTION TYPE I,
LV_FILE TYPE STRING,
DEFAULT_EXTENSION TYPE STRING.
if DEFALUT_EXTENSION ne 'TXT'.
eRROR ........
ENDIF.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
EXPORTING
WINDOW_TITLE = 'Please select the location'
DEFAULT_EXTENSION = DEAFAULT_EXTENSION
DEFAULT_FILE_NAME = LV_FILE
FILE_FILTER = '*.TXT'
CHANGING
FILENAME = LV_FILENAME
PATH = LV_PATH
FULLPATH = LV_FULLPATH
USER_ACTION = LV_ACTION
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
OTHERS = 3.
Regards
Abhii
Edited by: Abhii on Aug 17, 2010 7:44 AM
Edited by: Abhii on Aug 17, 2010 7:44 AM
Edited by: Abhii on Aug 17, 2010 7:44 AM
Edited by: Abhii on Aug 17, 2010 7:46 AM
Similar Messages
-
CALL METHOD cl_gui_frontend_services= file_save_dialog
Hi,
I want to use 'CALL METHOD cl_gui_frontend_services=>file_save_dialog', to choose a path for saving my txt files. I only want the user to be able to choose the path and not have to supply a filename aswell. My filenames are standard in the program and I don't want them to be changed by the user.
Is there another method which is designed for this or is there a simple parameter I have missed?
Thanks and regards,
Simon.AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_f.
PERFORM f_search_help_pa_f1.
FORM f_search_help_pa_f1 .
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
program_name = sy-repid
dynpro_number = sy-dynnr
CHANGING
file_name = pa_f
EXCEPTIONS
mask_too_long = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " f_search_help_pa_f1
Try this
Regards -
Question on cl_gui_frontend_services= file_save_dialog
Hi all,,, need your help.. thank you i n ad vance ..
why ist tht happen? the default extension, 'txt'
but the "save as type" in the dialog box shows 'XLS', excel file ??
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
window_title = 'Save file to'
DEFAULT_EXTENSION = 'txt'
default_file_name = v_filename
INITIAL_DIRECTORY = 'c:\'
CHANGING
filename = t_file
path = ld_path
fullpath = ld_fullpath
user_action = ld_result.you can do in this way....
in this case default is 'XLS' and he can choose all the files.
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
window_title = l_title
default_extension = 'XLS'
file_filter = ' '
CHANGING
fullpath = l_fullpath
path = l_path
filename = l_filename
EXCEPTIONS
OTHERS = 1.
Regards
Vijay -
How do I embed .txt into my iWeb website?
HOw do I embed .txt into my iWeb website with domain purchased from go daddy.com
You want to embed a text file into a web page? To read or for downloading?
To add a multipage text file to a webpage see this demo page: Scrolling Text Box. For a single text file just drag the text file onto an iWeb page and it will automatically be added as a text box. To download the file zip, put it on your GoDaddy.com account folder and use a hyperlink to the zipped file like in this demo page: LinkTestPage -
hee guys how do u delete a creditcard from your apple id? in the summer a friend of mine connected his own creditcard details to my apple id now i want to disconnect that again but i have no idea how? i just want my own apple id without a creditcard connected to it
I own the movies and I want them to stay in my iTunes library basically forever.
But in both cases the file name no longer shows in the movie list, so I don't know how to re-download it from the Cloud.
iTunes prefs > Store > Show iTunes in the Cloud purchases.
This will show all your iTunes purchases in your library with a cloud icon down arrow. Click the icon to redownload or click on Play to stream without downloading.
Also see this , -> Download past purchases
and techncially, you don't "own" the movie, You simply have a license to use it.
Yet the first thing iTunes does when you hit the delete key is tell you that it will remove the movie forever from all devices and the library.
Actually, no it does not tell you that.
FYI: You should keep copies of all yoru iTnue spurahses as the labels/movie studios/copyright owners can pull their product at anytime and it won't be available to redownload.
Suggestions here -> http://www.apple.com/feedback/ -
I have ad Apple ID on my iPad , when I use the apple on my iPhone for the first time, I put in my Apple ID for the iPad, didn't work. Need to create a new one. Why? How can I just use my iPad ID on my iPhone?
Hi kamfong,
Went to Settings where?
If you want to use your exisiting Apple ID on your iPad, you need to:
1. Go to Settings>iTunes & App Store and sign out the new ID, and then sign on the old one
2. Go to Settings>iCloud, scroll to the bottom and delete the iCloud account, and the sign back onto iCloud using the old ID
You still have not indindated why you are saying that using your old ID originally "didn't work". What do you mean by that? Did you get some sort of error when you tried to sign on with your exisiting Apple ID?
Cheers,
GB -
I am a first-time iPad owner/user. I bought a relative's original iPad. I want to leave the apps on it and add my own pdfs to read. My itunes account is really for my iPod. iTunes message says that if I "Sync" the iPad will be erase, and become like my iPods. If I make a new iTunes account, would the apps be erased when I tried to use it?
How can I just get my files onto this iPad, and still have the apps that my relative left there for me?
Thank you.iPads sync to 1 computer only.
All media and apps are tied to the Apple ID that purchased them.
Without your relatives ID and password, you cannot update any of the Apps.
I am pretty certain he is also violating Apples terms of service by giving you the apps. -
I have an iPhone5, 16 gb and a 120 gb iPod. All my songs won't fit on the iPhone of course. How can I just get some of them on the iPhone? I want to keep all my music on the iPod, but just want SOME of my music on the iphone. I am VERY new to all this so be gentle and thanks.
You Sync the Music you want on the Phone via iTunes on your computer.
See here > http://support.apple.com/kb/HT1386
From Here > http://www.apple.com/support/iphone/syncing/ -
How can I just disable "navigation toolbar" completely for the App Tabs? I don't want to disable this for other normal tabs. This is important as otherwise while I am in the app tab, i mistakenly start browsing from that tab and meaning of the app tab is completely lost...
How can I view my full billing history for the app and music stores without iTunes installed?
No.
If my account has been compromised
If you even think this may have happened, immediately change your password.
See this -> Apple ID: Changing your password -
I am using a table which contains a text field with a lookup. I want to use the selected value of this field in a form which is acting as a selection form. No editing of the field's value is permitted. How do I just display the value of the field (which
is considered a listbox on the form) without the reverse display and the up and down selection buttons.
I can provide an illustration of the condition I am trying to overcome, but this system doesn't accept it.
Thank you for any suggestions or clarification you can provide.
Marj WeirThank you. I'll try that approach.
I found, after much experimentation, on a similar problem involving a multiselect lookup field, that if I make the field invisible, and add a textbox that displays the fieldname plus .column(0), it displays all the selected entries.
E.g.: staff.Column(0)
Staff is the field containing the last names of selected staff members.
staff.Value only shows the first name in the lookup list whether it is checked or not, so this is useless.
staff.column(0), however, (inexplicably) shows all the selected names, e.g. Jones, Smith, Wiggins.
Marj Weir
-
How to restore just Mavericks from a Time Machine backup
Macbook Pro 15", (early 2011) 2.0 GHz, 8GB memory
After having my WD 750GB HD crash, I decided that I would opt for a smaller (256GB) SSD drive and just put Mavericks and my apps on the new drive and keep my user files on an external drive. I've installed and formatted the new drive but I can't figure out how to install just OSX from Time Machine since the entire backup is too big for my new drive. Before the drive failed, I had installed the latest update for Mavericks (10.9.3?) Thoughts?I think you should do the following:
Install Mavericks, Lion/Mountain Lion Using Internet Recovery
Be sure you backup your files to an external drive or second internal drive because the following procedure will remove everything from the hard drive.
Boot to the Internet Recovery HD:
Restart the computer and after the chime press and hold down the COMMAND-OPTION- R keys until a globe appears on the screen. Wait patiently - 15-20 minutes - until the Recovery main menu appears.
Partition and Format the hard drive:
Select Disk Utility from the main menu and click on the Continue button.
After DU loads select your newly installed hard drive (this is the entry with the mfgr.'s ID and size) from the left side list. Click on the Partition tab in the DU main window.
Under the Volume Scheme heading set the number of partitions from the drop down menu to one. Click on the Options button, set the partition scheme to GUID then click on the OK button. Set the format type to Mac OS Extended (Journaled.) Click on the Partition button and wait until the process has completed. Quit DU and return to the main menu.
Reinstall Lion/Mountain Lion. Mavericks: Select Reinstall Lion/Mountain Lion, Mavericks and click on the Install button. Be sure to select the correct drive to use if you have more than one.
Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.
You can find more about restoring from a Time Machine backup at Pondini's Time Machine FAQ for help with all things Time Machine.
You -
Hello Experts,
Is there a way to disable the 'Cancel' button in method 'FILE_SAVE_DIALOG' of class
cl_gui_frontend_services? Because in our requirement, the saving of the file is mandatory.
Thank you guys and take care!HI, Viraylab
Use the Logic Bellow it will solve out your problem, using following you must provide a file name other wise after selecting Cancel button this dialog will appear again.
PERFORM save_dialog.
*& Form save_dialog
* text
FORM save_dialog.
DATA: filename TYPE string,
path TYPE string,
fullpath TYPE string.
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
window_title = 'Select File Name'
CHANGING
filename = filename
path = path
fullpath = fullpath
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
IF filename IS INITIAL.
PERFORM save_dialog.
ENDIF.
ENDFORM. "save_dialog
Please Reply if any Issue,
Best Regards,
Faisal -
Hi Guys,
I am saving Invoice Output type into local PDF file and using CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG to give user the choice where to save the file. It gives an abap short dump "Access not possible using 'NULL' object reference". and update is terminated in the same method.
I think output types are executing in Update Taks.
It's working fine when used in other programs(Normal)
Suggestions are Welcome. Thanks! Vijender
The code is :
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
EXPORTING
WINDOW_TITLE = 'Save PDF File'
DEFAULT_EXTENSION = 'PDF'
DEFAULT_FILE_NAME = LV_NAME_INIT
FILE_FILTER = '*.PDF'
INITIAL_DIRECTORY = 'C:'
PROMPT_ON_OVERWRITE = 'X'
CHANGING
FILENAME = LV_FNAME
PATH = LV_PATH_FOLDER
FULLPATH = LV_FILE_NAME
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
NOT_SUPPORTED_BY_GUI = 3
OTHERS = 4.HI, Viraylab
Use the Logic Bellow it will solve out your problem, using following you must provide a file name other wise after selecting Cancel button this dialog will appear again.
PERFORM save_dialog.
*& Form save_dialog
* text
FORM save_dialog.
DATA: filename TYPE string,
path TYPE string,
fullpath TYPE string.
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
window_title = 'Select File Name'
CHANGING
filename = filename
path = path
fullpath = fullpath
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
IF filename IS INITIAL.
PERFORM save_dialog.
ENDIF.
ENDFORM. "save_dialog
Please Reply if any Issue,
Best Regards,
Faisal -
Question for cl_gui_frontend_services= file_save_dialog
Hi Expert.
I made simple test page.
there is nothing but this code in oninitlization
* event handler for data retrieval
DATA: ld_filename TYPE string,
ld_path TYPE string,
ld_fullpath TYPE string,
ld_result TYPE i.
* Display save dialog window
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
* window_title = ' '
DEFAULT_EXTENSION = 'XLS'
default_file_name = 'accountsdata'
INITIAL_DIRECTORY = 'c:temp'
CHANGING
filename = ld_filename
path = ld_path
fullpath = ld_fullpath
* Check user did not cancel request
CHECK ld_result EQ '0'.
and that shows
"method:FILE_SAVE_DIALOG ,line : 164
An attempt was made to execute a dynamic method callon an initial(NULL-) object reference. The reference must refer to an object."
why this error caught?
Did I miss something or made mistake BSP code above?
should I create some object before call cl_gui_frontend_services=>file_save_dialog?
I don't have any clue on this.
help me please. thanks .Oh yes - this most certainly will not work from BSP. This class and any other that uses the control framework are written as proxy objects to code that actually executes as part of the SAPGui on the client machine.
BSP is completly web centric. Its output can only be ran in a browser. To the browser the output of BSP doesn't look any different than any other web page that might come from ASP, JSP, PHP, etc.
Also because BSP runs in a browser - the amount of interaction that can occur with the client (particularly around file downloads) is somewhat limited. There is no file download element or a file save as dialog object. There are other ways to attach content to an HTTP Response or place it in a hidden iFrame - the browser is then responsible for intrepting this information and offering the file save as or open dialog based upon the appropriate MIME Type.
This weblog is the primer on BSP downloads written by the Jedi Master himself:
<a href="/people/mark.finnern/blog/2003/09/23/bsp-programming-handling-of-non-html-documents:///people/mark.finnern/blog/2003/09/23/bsp-programming-handling-of-non-html-documents
If you search you will find other examples in the older BSP weblogs as well. -
Cl_gui_frontend_services= file_save_dialog?
Hi All,
Im trying to use the below method, what are all the parameters need to fill and hw to declare those parameters.
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
WINDOW_TITLE =
DEFAULT_EXTENSION =
DEFAULT_FILE_NAME =
FILE_FILTER =
INITIAL_DIRECTORY =
WITH_ENCODING =
PROMPT_ON_OVERWRITE = 'X'
CHANGING
filename =
path =
fullpath =
USER_ACTION =
FILE_ENCODING =
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
NOT_SUPPORTED_BY_GUI = 3
others = 4
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Puppy.Hi ,
copy this code and try this , after executing this code ypu will get the path into " lv_fullpath " .
and then pass this lv_fullpath to next function module like gui_download .
DATA: v_name TYPE string,
v_file TYPE rlgrap-filename,
lv_filename TYPE string,
lv_filen TYPE string,
lv_path TYPE string,
lv_fullpath TYPE string.
* MOVE v_name TO lv_filename.
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
* WINDOW_TITLE =
* DEFAULT_EXTENSION =
* default_file_name = lv_filename
* WITH_ENCODING =
* FILE_FILTER =
* INITIAL_DIRECTORY =
* PROMPT_ON_OVERWRITE = 'X'
CHANGING
filename = lv_filen
path = lv_path
fullpath = lv_fullpath
* USER_ACTION =
* FILE_ENCODING =
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
OTHERS = 4
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,
Aby.
Maybe you are looking for
-
HELP! Cannot set up HP LaserJet M1217nfw MFP
I just purchased an HP LaserJet M1217nfw multi-function printer and am not able to install a driver on my Mac. I am using the latest MacBook Pro 17" with Mountain Lion. The printer is working. I also have access to a PC and I have configured it wirel
-
White Noise showing up in images after PDF Creation
I am currently running into an issue making PDFs from InDesign CS4. Lately, our company has been getting some rather large jobs in to print and that's when this all started. The current job is 190 pages plus cover that will be perfect bound. The clie
-
Exchange 2007 Global Address List
I connect to my organisations Exchange 2007 server. My address book syncs for my personal contacts, appearing in address book as a brown book icon with an @ symbol. However, there is also a blue book icon with an "i" on it. When I click on it, in the
-
Hello everyone! I have a problem with when switch users from one to another on windows xp I get a vga monitor driver fault. I've updated my vga drivers and direct x but I still have the same problem.
-
Can't change photo syncing options
I've recently set up a new computer and managed to sync my iPhone to it without any issues. However, I haven't been able to sync any photos yet because it won't let me select any folders to sync from only those. When I try to select the "Sync Photos