cancel
Showing results for 
Search instead for 
Did you mean: 

ATTACH_FILE_TO_RESPONSE to display PDF

Former Member
0 Kudos

Hi,

We are trying to display PDF from ABAP Web Dynpro. Its stored in the table as hex and we using following to display it

WDR_TASK=>CLIENT_WINDOW->CLIENT->ATTACH_FILE_TO_RESPONSE(

I_FILENAME = 'test.pdf'

I_CONTENT = XTEXT

I_MIME_TYPE = 'pdft'

).

When we trying to open it we getting an error "There was an error oppeneing this document."

If we save it as plain txt we can see that the data is some thing like this

%PDF-1.4

%âãÏÓ

34 0 obj <</Linearized 1/L 33832/O 36/E 6746/N 8/T 33105/H >>

endobj

............................

there is whole big file i don't want to post it here.

What can we do to be able to open this in PDF properly.

Thanks,

Oleg

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks all.

Issue was resolved. That was just corrupted data in xtext

Thanks,

Oleg

sankar_roy
Participant
0 Kudos

Hi,

How did you convert the table of Hexadecimel values to Xstring??

I am also facing the same problem as my requirement is same as you.

The i_content in attach_file_to_response method is a structure and i am getting the values in a table (Hexadecimal Values). I tried with looping the Hexadecimal table into a structure. After executing it gives the error as "The file is corrupted and it cant be opened".

Can you help me with this.

Thanks in advance.

Regards,

Sankar

Former Member
0 Kudos

We loop through table and concatenate everytjing into to STRING var.. At the end we just move STRING to XSTRING var.

Thanks,

Oleg

Florian
Active Contributor
0 Kudos

You also can search the SE37. There are some Functions delivered with your system.

Use *TO*XSTRING* for searching there.

I'm not sure, but i think, that is what you are looking for

SCMS_BINARY_TO_XSTRING

Regards

Florian

sankar_roy
Participant
0 Kudos

Hi..

Thanks for the information...

Its working fine now..

Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi ,

The MIME type for PDF document is application/pdf

WDR_TASK=>CLIENT_WINDOW->CLIENT->ATTACH_FILE_TO_RESPONSE(

I_FILENAME = 'test.pdf'

I_CONTENT = XTEXT

I_MIME_TYPE = 'pdft'

Use application/pdf instead of pdft and check it..

Priya

Former Member
0 Kudos

Check the Sample Webdynpro component - DEMO_ADOBE_OFFLINE, here they are using interactive form and when you click on Upload Button to select any adobe form it reads that form into XString and displays the form using Interactive Form UI element.