Skip to Content
0
Former Member
Dec 07, 2009 at 08:29 AM

PDF File Opening Problem after Open DataSet

300 Views

Hi All,,

Below is my code. Am I doing something wrong or Am I missing something.

DATA : lt_value LIKE tline OCCURS 0 WITH HEADER LINE.

  • Read file

OPEN DATASET cmd FOR INPUT IN BINARY MODE.

DO.

READ DATASET cmd INTO LT_VALUE-TDLINE.

IF sy-subrc NE 0.

EXIT.

ENDIF.

APPEND lt_value.

ENDDO.

close dataset cmd.

  • Get File Lenght in bytes

CALL FUNCTION 'EPS_GET_FILE_ATTRIBUTES'

EXPORTING

file_name = 'BIO2C0348.pdf'

dir_name = '/<unix dir>/'

IMPORTING

file_size = flen

CALL FUNCTION 'WS_DOWNLOAD'

EXPORTING

bin_filesize = flen

filename = 'C:\TEST1.PDF'

filetype = 'BIN'

IMPORTING

filelength = flen

TABLES

data_tab = lt_value.

Pls Note : I've tried GUI_DOWNLOAD Also. gives the same error that : file is damaged or type not supported.

Regds.