Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Disable 'Cancel' button in cl_gui_frontend_services=>file_save_dialog...

aris_hidalgo
Contributor
0 Kudos
655

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!

1 ACCEPTED SOLUTION

Former Member
0 Kudos
239

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.

6 REPLIES 6

Former Member
0 Kudos
240

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.

Former Member
0 Kudos
239

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.

Former Member
0 Kudos
239

Hi,

There is no such option

former_member195383
Active Contributor
0 Kudos
239

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

faisal_altaf2
Active Contributor
0 Kudos
239

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

Former Member
0 Kudos
239

Another way to enforce your requirement is to receive the file name in an OBLIGATORY field in the beginning of the program.