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: 

Doubt in "GUI_FILE_SAVE_DIALOG"

Simha_
Employee
Employee
0 Kudos

Hi All,

(1).When calling this F.M and saving the file , if the file already exists it gives the message "file already exists"

with the tick mark like info message.

If i want the error message "X" what should i do??

(2). What is the extend button for in this F.M when the popup comes??

Regards,

Simha.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

I dont think it is possible to change the message in this std FM.

However, you can always copy it into a Z FM and add your message.

The EXTEND button appends the file if it already exists.

hope it helps.

Regards,

Shashank

9 REPLIES 9

former_member188685
Active Contributor
0 Kudos

Hi,

you can try this way..

  CALL FUNCTION 'GUI_FILE_SAVE_DIALOG'
    IMPORTING
      FULLPATH                = V_FILENAME
      USER_ACTION             = V_RETCODE
    EXCEPTIONS
      OTHERS                  = 1.
  IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ELSEIF V_RETCODE = 9.
    <b>MESSAGE E000 WITH 'Action cancelled'.</b>
    EXIT.
  ENDIF.

Regards

Vijay

0 Kudos

Hi vijay,

I just want the error message in place of the standard info message.

can it be done??

Or i have to copy it to a ZF.M and then change the module??

<b>Extend button is not appending the text to the already exixtig text. It's just replacing the oldtext with the newone.</b>

Regards,

Simha.

Message was edited by: Narasimha Rao Bandla

0 Kudos

Hi,

Then what is the purpose of 'REPLACE' button?

Extend shud append the text to the existing text.

You will have to create a Z FM to create your own error messages.

Regards,

Shashank

0 Kudos

Hi Narasimha,

you can try this way...

  CALL FUNCTION 'GUI_FILE_SAVE_DIALOG' 
   IMPORTING
      FULLPATH      = V_FILENAME 
      USER_ACTION   = V_RETCODE 
   EXCEPTIONS 
     OTHERS     = 1.  
  IF SY-SUBRC <> 0. 
    MESSAGE E000 WITH 'Action cancelled'.
    EXIT.
  ENDIF.

Regards

vijay

0 Kudos

Hi Narasimha,

YOu have to copy the FM into a ZFM to do that.

Copy the whole Function group. You will not be able to copy only the FM.

Go to the line 185 and change the code from

message S027(FES) with dy_fullpath.

to

message E027(FES) with dy_fullpath.

REgards,

Ravi

Former Member
0 Kudos

Hi,

I dont think it is possible to change the message in this std FM.

However, you can always copy it into a Z FM and add your message.

The EXTEND button appends the file if it already exists.

hope it helps.

Regards,

Shashank

0 Kudos

Hi

hope it is not possible to change the message in the Standard FM ...but create a new FM and add your text to that ....the EXTEND button appends the fie if that file already exists

Regards,

Santosh

suresh_datti
Active Contributor
0 Kudos

Hi,

I don't think you can change the message type as it comes out of the std code. The 'extend' button will append the text to a file that already exists.

Regards,

Suresh Datti

Former Member
0 Kudos

Hi,

you cannnot change the message generated by the SAP.

but you can add message by checking the sy-subrc with your requirement.

extend button helps you to append the data in the file if already exists.

you can have the code below for any use.

DATA: LDF_FILENAME TYPE STRING,

LDF_PATH TYPE STRING,

LDF_FULLPATH TYPE STRING,

LDF_FNAME TYPE STRING.

CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG

EXPORTING

  • WINDOW_TITLE =

  • DEFAULT_EXTENSION =

DEFAULT_FILE_NAME = LDF_FNAME

  • FILE_FILTER =

  • INITIAL_DIRECTORY =

  • WITH_ENCODING =

  • PROMPT_ON_OVERWRITE = 'X'

CHANGING

FILENAME = LDF_FILENAME

PATH = LDF_PATH

FULLPATH = LDF_FULLPATH

  • USER_ACTION =

  • FILE_ENCODING =

EXCEPTIONS

CNTL_ERROR = 1

ERROR_NO_GUI = 2

NOT_SUPPORTED_BY_GUI = 3

OTHERS = 4.

regards

-Rakesh