cancel
Showing results for 
Search instead for 
Did you mean: 

displaying an attachment

Former Member
0 Kudos

Hi,

I have the imported contents of an attachment in an internal table,using SCMS_R3DB_IMPORT fm into an internal table.Now,how do I display the contents of this table which contains data in RAW format ? Please help.

Should I use open dataset ?

Regards,

Ananya Mukherjee

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

The document may be of any type:PDF,DOC,JPEG anything..

Is there any common function module ?

Regards,

Ananya

Former Member
0 Kudos

Hi,

I have already referred to these blogs.Problem in my case is ,the file content is in a table whose line type is RAW.Hence cached_response->set_data( file_content )

statement is not accepted.How do I convert the table of raw contents to xstring ?

Regards,

Ananya

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

The function modules from function group SCMS_CONV are great general purpose converters. They can be used to go to or from strings, binary string, character tables, binary tables, etc. Have a look there.

I think SCMS_BINARY_TO_XSTRING would be an excellent place to start.

Message was edited by: Thomas Jung

Former Member
0 Kudos

Hi

I have done it. But still not working.The document is not opening at all.

Regards,

Ananya

Former Member
0 Kudos

Hello Thomas or anyone,

I am trying to open a PDF document that has been stored in binary table format as an attachment in CRM. I am using SAPGUI in an ABAP environment, not WebDynpro. I am trying to open this document in a custom container using ALV, although I know I can also open it in the attachments.

I have tried several ways, and still nothing. At least now, I am not getting an error message, or an invalid format message, etc. It just displays a blank container. The file is stored with a class CRM_P_ORD. I am trying to use method DISPLAY_IO in class CL_CRM_SINGLE_IO to open this document within the container.

Does anyone have any clues? Thanks a lot for your help..

Becky

athavanraja
Active Contributor
0 Kudos

what type of document is it. you need to set proper MIME type and set the binary content as the response object of the page. IE will decide which application to use based of MIME type for example application/pdf it will use adobe acrobat reader.

check out this weblog on how MIME type parameters are set and how the binary content is set as response object.

/people/sap.user72/blog/2004/11/10/bsphowto-generate-pdf-output-from-a-bsp

/people/mark.finnern/blog/2003/09/23/bsp-programming-handling-of-non-html-documents

Regards

Raja