cancel
Showing results for 
Search instead for 
Did you mean: 

Smart Forms - IC WebClient

Former Member
0 Kudos

Hi,

I am trying to calling a smart form from a bsp view.

The smart form has been converted from OTF to PDF using the function module CONVERT_OTF.

How do I use the binary file to show the PDF in a new window? I wish to trigger the action using a button event trigger.

Thanks,

Krish !

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

IF ( display_type = 'html' OR display_type = "window" ) AND

XSTRLEN( file_content ) > 0.

DO the required

ENDIF.

Next, add the code in the layout to open the new window. This is quickly done with:

<% IF display_type = 'window' AND display_url IS NOT INITIAL. %>

<script language="Javascript">

window.open("<%=display_url%>").focus();

</script>

<% ENDIF. %>

</htmlb:page>

</htmlb:content>

DATA: conv TYPE REF TO CL_ABAP_CONV_IN_CE.

conv = CL_ABAP_CONV_IN_CE=>CREATE( input = Xcontent ).

conv->READ( importing data = content len = len ).

<!code> CALL FUNCTION 'GIME_PDF' RECEIVING table_of_pdf_data.

LOOP AT table_of_pdf_data INTO line.

CONCATENATE content line INTO content into character mode.

ENDLOOP.

Nigel_James
Active Contributor
0 Kudos

Krish,

Happy to help but you really should make use of the search functionality on this site.

I solved this problem myself the other day using Craigs fine blog on this subject which refers to another equally fine blog by Brian.

Here is the blog ...

<a href="/people/sap.user72/blog/2004/11/10/bsphowto-generate-pdf-output-from-a-bsp">Awesome smartform PDF blog</a>

If you have any other questions sing out and everyone is more than happy to help.

Nigel

Former Member
0 Kudos

Hi Nigel,

I have infact read Craig's blog regarding smart forms. I constantly get a syntax error while creating a display url

at these following methods.

cached_response->set_status( code = 200 reason = 'OK' ).

cached_response->server_cache_expire_rel(

expires_rel = 180 ).

cl_http_server=>server_cache_upload( url = display_url

response = cached_response ).

Are these set methods really important?

Krish.

Nigel_James
Active Contributor
0 Kudos

What sort of error?

Yes they are important. They are the methods that put the created document into the tempory server cache for the user to download.

Nigel

Nigel_James
Active Contributor
0 Kudos

Krish have you created the cached_response variable?


data:
  cached_response type ref to if_http_response.

N