Skip to Content
author's profile photo Former Member
Former Member

Not able to get file from application server with read dataset

Hi,

Firstly i download a file from application server from read data set and then i sent this file as attachment. But problem is that i am able to send .jpg .bmp file but i am not able to send .pdf or .doc file so what can i do for that. ?

My code is like below...

DATA : PATH TYPE STRING.

DATA: E_FILE LIKE RLGRAP-FILENAME.

CONCATENATE '/tmp/' NAME_WITH_EXT INTO E_FILE SEPARATED BY SPACE.

CONDENSE E_FILE NO-GAPS.

IF EXTENSION = 'TXT'.

OPEN DATASET E_FILE FOR INPUT IN TEXT MODE ENCODING DEFAULT WITH WINDOWS LINEFEED . " MESSAGE MSG.

IF SY-SUBRC <> 0.

  • WRITE: SY-SUBRC, MSG, ' LIKE ', C_FNAME.

ELSE.

WHILE SY-SUBRC = 0.

READ DATASET E_FILE INTO WA_C.

IF SY-SUBRC <> 0.

EXIT.

ENDIF.

APPEND WA_C TO IT_C.

ENDWHILE.

CLOSE DATASET E_FILE.

ENDIF.

ELSE.

OPEN DATASET E_FILE FOR INPUT IN BINARY MODE. " ENCODING DEFAULT. " INPUT IN BINARY MODE . " TEXT MODE ENCODING NON-UNICODE.

IF SY-SUBRC = 0.

DO .

READ DATASET E_FILE INTO GS_PDF_TAB.

IF SY-SUBRC = 0.

APPEND GS_PDF_TAB TO GT_PDF_TAB.

ELSE.

EXIT.

ENDIF.

ENDDO.

CLOSE DATASET E_FILE.

ENDIF.

ENDIF.

Regards,

Gurprit Bhatia

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 14, 2008 at 11:40 AM

    delete this line DEFAULT WITH WINDOWS LINEFEED and check this..

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.