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: 

Download PDF file from AL11 directory to drive c:\temp

Former Member
0 Kudos

I have a PDF file in \folder1\abc,pdf in AL11. How to download this abc.pdf to c:\temp folder?

Can paste some code here?

Thanks.

1 ACCEPTED SOLUTION

Former Member

Hi Paul,

Please Check the Code Below


............
............
............
PARAMETERS: Source_file TYPE SAPB-SAPPFAD
default '\folder1\abc,pdf'.
 
PARAMETERS: target_lfile TYPE SAPB-SAPPFAD
default 'c:\temp\xyx.pdf'.
 
 
START-OF-SELECTION.
  CALL FUNCTION 'ARCHIVFILE_SERVER_TO_CLIENT'
    EXPORTING
      path             = source_file
     TARGETPATH        = target_lfile
 EXCEPTIONS
   ERROR_FILE       = 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.
............
............

Or

Go to Transcation CG3Y Download data App server to Local System..

Hope this will be Helpful

Thanks

kalyan

4 REPLIES 4

Former Member

Hi Paul,

Please Check the Code Below


............
............
............
PARAMETERS: Source_file TYPE SAPB-SAPPFAD
default '\folder1\abc,pdf'.
 
PARAMETERS: target_lfile TYPE SAPB-SAPPFAD
default 'c:\temp\xyx.pdf'.
 
 
START-OF-SELECTION.
  CALL FUNCTION 'ARCHIVFILE_SERVER_TO_CLIENT'
    EXPORTING
      path             = source_file
     TARGETPATH        = target_lfile
 EXCEPTIONS
   ERROR_FILE       = 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.
............
............

Or

Go to Transcation CG3Y Download data App server to Local System..

Hope this will be Helpful

Thanks

kalyan

0 Kudos

Kalyan,

CALL FUNCTION 'ARCHIVFILE_SERVER_TO_CLIENT' is perfect for my use. Thanks a lot!

0 Kudos

Hi Kalyan,

I'm using the same code given by you to download PDF from AL11 to local and PDF is being downloaded but while opening PDF file it is showing as unsupported file type.

I have tried for multiple files but same problem.

Can you please let me know any alternate solution.

Regards,

Khaja Miyamdad.

Former Member
0 Kudos

hi,

1) Read the file on the application server using OPEN DATASET & READ DATASET.

2) Transfer the contents to an internal table of required structure.

3) Download this internal table to your presentation server using 'GUI_DOWNLOAD'.

Thanks

Sharath