cancel
Showing results for 
Search instead for 
Did you mean: 

Converting Xstring to PDF and showing it on CRM web UI.

Former Member
0 Kudos
840

Hi All,

I have a requirement where SAP CRM will receive a PDF in binary format. SAP has to convert that in PDF and show it on CRM Web UI. I tried various option like but nothing seems to work. Could anyone of you experts please help me here, i have the below questions

1) How do i change the Xstring to PDF, and display it on CRM Web UI?

2) What would be the format of xstring in SAP(debugger) coming from PI? i mean how it should look like, as of now PI is passing some value in stub, which i think may not be correct.(PI is sending some character string, but i can see a numberic string in debugger)

3) How do i create an xstring from a PDF for demo purpose. So that i can create and give it to PI to send it back?

Please help.

Regards,

Sami.

View Entire Topic
frankoverip
Explorer
0 Kudos

Hi Sami,

I'm not sure if I fully understand you but I guess the Xstring does already contain the PDF document as a binary string.

If this is correct, you will find a detailed tutorial on how to create a download under this link:

http://www.plantogether.de/downloads-in-webui-anwendungen/ I'm afraid I only described it in German language but with the code fragments you should get the point.

Basically, you create a link in your application pointing to the path /sap/webcuif/uif_callback on your server supplying a class implementing interface IF_CRM_WEB_CALLBACK.

In this implementation you create a response with your download data:

* Set filename proposed to the user

ir_server->response->set_header_field(

  name = 'Content-Disposition'"#EC NOTEXT

  value = 'attachment; filename=umsatz_2013.csv').

* Tell the browser what type of file will be provided

ir_server->response->set_header_field(

  name = 'Content-Type'"#EC NOTEXT

  value = 'application/pdf' ).

* Provide the content as a Xstring

ir_server->response->set_data( data = lv_content_bin ).

Maybe this helps...

Regards,

Frank