Application Development and Automation 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: 
Read only

F4 Help for Application Server Path

Former Member
0 Likes
1,554

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

4 REPLIES 4
Read only

Former Member
0 Likes
604

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

Read only

Former Member
0 Likes
604

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.

Read only

Former Member
0 Likes
604

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.

Read only

0 Likes
604

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.