cancel
Showing results for 
Search instead for 
Did you mean: 

Display PDF on Web via ITS.

Former Member
0 Kudos

Hello everyone,

I am trying to display a pdf that I am converting from OTF on web directly via ITS in SAP GUI for HTML based IAC. The following is the code behind scenes.


CALL FUNCTION 'CONVERT_OTF'
  EXPORTING
    format = 'PDF'
    max_linewidth = 132
  IMPORTING
    bin_filesize = g_bin
*    BIN_FILE =
  TABLES
    otf = p_T_OTF
    lines = t_lines
    EXCEPTIONS
      err_max_linewidth = 1
      err_format = 2
      err_conv_not_possible = 3
      err_bad_otf = 4
      OTHERS = 5.

CALL FUNCTION 'ALEWEB_DOWNLOAD'
    EXPORTING
      data_len                = g_bin
      mime_type               = 'application/pdf'
      DATA_TYPE               = 'BIN'
    tables
      data_tab                = t_lines.

Then the following garbage is getting displayed.

•ä‘†â´±â¸³à´Šâ—¢îíŒà¨²â€°â¯æ‰ªà´Šã°¼

But if I use GUI_DOWNLOAD as shown below, then the PDF is getting downloaded into my local PC without any problem and I am able to read the PDF also.


CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = g_bin
filename = 'test.pdf'
filetype = 'BIN'
TABLES
data_tab = t_lines.

I am using ECC 5.0 and ITS 6.20 Patch 23. What should I do to see the PDF on web.

Thanks,

-Bharath

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Bharath,

Please use the following code:


CALL FUNCTION 'ALEWEB_DOWNLOAD'
    EXPORTING
      data_len                = g_bin
      mime_type             = 'application/pdf'
      DATA_TYPE          = '<b>RAW</b>'
    tables
      data_tab                = t_lines.

You may also find the following OSS Note helpful: "Note 608489 - ALEWEB_DOWNLOAD: File download revised".

Regards,

- Vik.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi

I have a doubt so thought i will ask you. I am creating a spool request number through VF02. How can get the OTF format in to my internal table using the spool request number to use this function module. I am using the FM CONVERT_OTFSPOOLJOB_2_PDF and getting the PDF in to the internal table but i am getting some authorization problems in reading the spool request can you help me on this.

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

format = 'PDF'

max_linewidth = 132

IMPORTING

bin_filesize = g_bin

  • BIN_FILE =

TABLES

otf = p_T_OTF

lines = t_lines

EXCEPTIONS

err_max_linewidth = 1

err_format = 2

err_conv_not_possible = 3

err_bad_otf = 4

OTHERS = 5.

Thanks in Adv.

Regards

Lakshmikanth.T.V

Former Member
0 Kudos

Thanks allot Vik...this is what I exactly looking for. Very helpful

Thank you,

-Bharath

Former Member
0 Kudos

Hi Bharath,

I am also working on the same kind of requirment. If you get it please let me know how to go about it.

Regards,

Lakshmikanth.