02-12-2009 8:35 AM
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.
02-12-2009 8:39 AM
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
02-12-2009 8:39 AM
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
02-12-2009 8:45 AM
Kalyan,
CALL FUNCTION 'ARCHIVFILE_SERVER_TO_CLIENT' is perfect for my use. Thanks a lot!
08-12-2015 5:45 AM
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.
02-12-2009 8:40 AM
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