2006 Sep 25 2:03 PM
Hello Friends,
tell me the FM name for selecting particular file from specific folder or saving a file to a specific folder. i mean user can decide to save or select the file from disk.
Thanks
Marmik
Hello Friends,
tell me the FM name for selecting particular file from specific folder or saving a file to a specific folder. i mean user can decide to save or select the file from disk.
Thanks
Marmik
2006 Sep 25 2:05 PM
hi Shah,
Check out this code..
DATA ITAB_FILE1_TABLE TYPE FILETABLE.
DATA W_WSU_FILENAME01 TYPE STRING.
DATA RC_FILE TYPE I.
W_WSU_FILENAME01 = PR_IFILE.
CALL METHOD <b>CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG</b>
EXPORTING
DEFAULT_FILENAME = W_WSU_FILENAME01
CHANGING
FILE_TABLE = ITAB_FILE1_TABLE
RC = RC_FILE
EXCEPTIONS
FILE_OPEN_DIALOG_FAILED = 1
CNTL_ERROR = 2
ERROR_NO_GUI = 3
NOT_SUPPORTED_BY_GUI = 4
others = 5.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
DATA W_WSD_FILENAME02 TYPE STRING.
DATA W_WSD_FILETYPE02 TYPE CHAR10.
DATA W_WSD_FNAME TYPE STRING.
DATA W_WSD_PATH TYPE STRING.
DATA W_WSD_FPATH TYPE STRING.
DATA W_WSD_APPEND02 TYPE CHAR01.
CONSTANTS C_CANCEL TYPE C VALUE 'X'.
W_WSD_FILENAME02 = PR_EFILE.
W_WSD_FILETYPE02 = 'ASC'.
W_WSD_APPEND02 = 'A' .
IF W_WSD_APPEND02 = 'A' .
W_WSD_APPEND02 = 'X' .
ENDIF.
CALL METHOD <b>CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG</b>
EXPORTING
DEFAULT_FILE_NAME = W_WSD_FILENAME02
CHANGING
FILENAME = W_WSD_FNAME
PATH = W_WSD_PATH
FULLPATH = W_WSD_FPATH
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,
Santosh
Message was edited by: Santosh Kumar P
2006 Sep 25 2:05 PM
You can try something like this.
selection-screen begin of block b1 with frame title text-002.
parameters: p_file type localfile default
'C:test.txt'.
selection-screen end of block b1.
at selection-screen on value-request for p_file.
call function 'KD_GET_FILENAME_ON_F4'
exporting
static = 'X'
changing
file_name = p_file.
Regards,
Rich Heilman
2006 Sep 25 2:08 PM
PARAMETERS: p_file LIKE rlgrap-filename.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = ' '
IMPORTING
file_name = p_file.
2006 Sep 25 2:09 PM
Hi,
the FMs:
<b>F4_DXFILENAME_TOPRECURSION</b> for a file on the presentation- oder applicationserver
<b>WS_FILENAME_GET</b> for a file on the presentationserver
Regards,
Stefan
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |