‎2008 Apr 17 7:01 PM
Hi,
I have a requirement where i need to download the content of an ABAP Report to a file on the Application Server.
I need to provide a Search-help for the Path on the Application Server.
I have a separate field for the File name and will append it to the path later on, before opening the dataset.
Is there any FM that implements this logic?
Any pointers will be helpful.
Thanks in advance.
Regards,
Keerthi
‎2008 Apr 17 7:07 PM
hi check this..
IF P_UNIX = 'X'.
F4 help for UNIX
CALL FUNCTION 'F4_DXFILENAME_4_DYNP'
EXPORTING
DYNPFIELD_FILENAME = 'P_FILE'
DYNAME = SY-CPROG
DYNUMB = SY-DYNNR
FILETYPE = 'P'
LOCATION = 'A'
SERVER = ''.
IF SY-SUBRC <> 0.
MESSAGE E000 WITH TEXT-E01 P_FILE.
ENDIF.
regards,
venkat
‎2008 Apr 17 7:42 PM
Check out F4_dxfilename_toprecursion FM ...
*----
-
Sample code ..
CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
EXPORTING
I_LOCATION_FLAG = 'A' "(A) Servidor (P) Presentación
* I_SERVER = '?'
* I_PATH =
* FILEMASK = '*.*'
* FILEOPERATION = 'R'
* IMPORTING
* O_LOCATION_FLAG =
* O_SERVER =
* O_PATH =
* ABEND_FLAG =
EXCEPTIONS
RFC_ERROR = 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.You can even use
CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
IMPORTING
serverfile = p_log
EXCEPTIONS
canceled_by_user = 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.
‎2008 Apr 17 7:42 PM
This is code I use regularly for this.
*_________________________________________________ AT SELECTION-SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR zfile.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
def_filename = ' '
def_path = zfile
mask = ',*.*,*.*.'
mode = '0'
title = 'Download path'
IMPORTING
filename = zfile
EXCEPTIONS
inv_winsys = 1
no_batch = 08
selection_cancel = 12
selection_error = 16.
*
IF sy-subrc NE 0.
MESSAGE i028(pc).
ENDIF.
‎2012 Aug 22 10:08 PM
Hi:
I'm having a similar requirement, and paths and filenames are not given, since we are downloading the file without defaults.
Is there a FM that allows me to select the path and the filename to be created?
Thanks so much.
Tere.