Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

pdf file uploading

HI ,

I need to store the "pdf " file from the PC to Unix directory. For this purpose what stanard program I can use.

Swarna

Tags:
replied

There is not standard program i believe. And also i am not sure about the PDF file update. but we are using for txt file. check the code below to upload a file from PC to unix server.

REPORT ZCOPY_PC_TO_UNIX LINE-SIZE 255

LINE-COUNT 65 MESSAGE-ID ZCRM_DEVELOP.

DATA: BEGIN OF zfred OCCURS 0,

z(1500),

END OF zfred.

DATA: filename like RLGRAP-FILENAME,

w_filesize like sy-index,

w_cancel,

w_mess type string.

PARAMETERS: P_unix(255) lower case memory id ZUNIX.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_unix.

get parameter id 'ZUNIX' field p_unix.

CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'

EXPORTING

I_LOCATION_FLAG = 'A'

I_PATH = P_UNIX

fileoperation = 'W'

IMPORTING

O_PATH = P_UNIX

EXCEPTIONS

others = 1.

IF sy-subrc = 0.

set parameter id 'ZUNIX' field p_unix.

ENDIF.

start-of-selection.

CALL FUNCTION 'UPLOAD'

EXPORTING

filename = filename

filetype = 'ASC'

IMPORTING

act_filename = filename

FILESIZE = w_filesize

cancel = w_cancel

TABLES

data_tab = zfred

EXCEPTIONS

conversion_error = 1

invalid_table_width = 2

invalid_type = 3

no_batch = 4

unknown_error = 5

OTHERS = 6.

IF sy-subrc NE 0.

MESSAGE s001 DISPLAY LIKE 'E' WITH 'Upload Error:' sy-subrc.

ENDIF.

check w_cancel is initial.

OPEN DATASET p_unix FOR OUTPUT IN TEXT MODE ENCODING DEFAULT message w_mess.

IF sy-subrc NE 0.

MESSAGE S001 DISPLAY LIKE 'E' WITH

w_mess '-' P_UNIX(50) p_unix+50(50).

stop.

ELSE.

LOOP AT zfred.

TRANSFER zfred TO p_unix.

ENDLOOP.

MESSAGE s001 WITH w_filesize 'bytes transfered'.

ENDIF.

Regards

Muthu

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question