Skip to Content
0
Jun 17, 2009 at 07:43 PM

Using xString to display as PDF in a custom container

839 Views

Hello gurus,

I have a SmartForm that was converted to xstring using CONVERT_OTF, I want to use the xstring now to display it as PDF inside a custom container.

I tried using class cl_gui_html_viewer together with cl_gui_custom_container but the form always turns up blank.


Convert xstring to binary table to pass to the LOAD_DATA method
  call function 'SCMS_XSTRING_TO_BINARY'
    exporting
      buffer     = lv_content
    tables
      binary_tab = lt_data.

  call method pdf_html_control->load_data
    exporting
      url          = l_myurl
      size         = l_pdf_size
      type         = 'application'                          "#EC NOTEXT
      subtype      = 'pdf'                                  "#EC NOTEXT
    importing
      assigned_url = l_url
    changing
      data_table   = l_pdf_data
    exceptions
      others       = 1.

  call method g_html_control->show_url( url = lv_url
    in_place = 'X' ).

Need advice on how to accomplish this, or is there another way to do this?

Thanks in advance.