2009 May 12 12:22 PM
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!
2009 May 12 1:04 PM
No as such - I would simply wrap into a WHILE loop and check for the CHANGING parameter
USER_ACTION = CL_GUI_FRONTEND_SERVICES=>ACTION_OK.
2009 May 12 1:04 PM
No as such - I would simply wrap into a WHILE loop and check for the CHANGING parameter
USER_ACTION = CL_GUI_FRONTEND_SERVICES=>ACTION_OK.
2009 May 12 1:33 PM
Try like this :
AT SELECTION-SCREEN ON VALUE-REQUEST FOR F_PATH.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
CHANGING
file_table = file
rc = rtrncode
user_action = action
EXCEPTIONS
file_open_dialog_failed = 1
cntl_error = 2
error_no_gui = 3
not_supported_by_gui = 4
others = 5
.
if action = 9.
MESSAGE : 'FILE CANCLED BY USER' TYPE 'S'.
ENDIF.
2009 May 12 1:34 PM
2009 May 12 1:39 PM
If Such an option is needed, then go for OLE technique, there the pop up will not appear while saving.
Edited by: Rudra Prasanna Mohapatra on May 13, 2009 6:44 AM
2009 May 12 2:22 PM
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
2009 May 12 2:29 PM
Another way to enforce your requirement is to receive the file name in an OBLIGATORY field in the beginning of the program.