cancel
Showing results for 
Search instead for 
Did you mean: 

I get empty pdf by CONVERT_ABAPSPOOLJOB_2_PDF and CONVERT_OTFSPOOLJOB_2_PDF

former_member1161170
Participant
0 Kudos

I have followed the boards that I found in the thread:

But the pdf that I get is empty.

If I stop the execution between:


IF ( t_tsp01-rq0name = 'SMART' OR t_tsp01-rq0name = 'SCRIPT' ).
*  For Scripts and Smartforms.
      CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
        EXPORTING
          src_spoolid                    = t_tsp01-rqident
       TABLES
         pdf                            = it_pdf.
    ELSEIF t_tsp01-rq0name = 'LIST1S'.
*for Reports.
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
        EXPORTING
          src_spoolid = t_tsp01-rqident
        TABLES
          pdf         = it_pdf.
    ENDIF.

and:


    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename = gv_string
        filetype = 'BIN'
      TABLES
        data_tab = it_pdf.

I can see several rows in my it_pdf. After the gui_download, I find a new .pdf in the expected folder, but it is empty.

I tried both, sapscript spools (SCRIPT) and normal report spools (LIST1S), but I got the same result.

What can be the problem?

Another thing: I find some spools SAP08 (neither LIST1S nor SMART/SCRIPT), what must i use for these files?

Iu2019m working by the 4.6c u2026

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member1161170
Participant
0 Kudos

I have solved!

I was missing the BIN_FILESIZE parameter.

Thanks to all

Former Member
0 Kudos

Give it a try with the code below for the transfer from your pdf-tab to the file


    PERFORM download_w_ext(rstxpdft) TABLES pdf_tab
                                     USING p_file
                                           '.pdf'
                                           'BIN'
                                           binfilesize
                                           cancel.
 

former_member1161170
Participant
0 Kudos

> Give it a try with the code below for the transfer from your pdf-tab to the file

I believe it is the final solution ... in another release.

In 4.6c I find the program RSTXPDFT with only three forms, and no one is "download_w_ext".

If I look the same program in another server with the rel. 7.00, I can find the form.

Now I'll try to study the "download_w_ext" to understand if I can carry it from 7.00 to 4.6c.

Thank you.

Former Member
0 Kudos

I just checked the code of the form download_w_ext myself and I hopes it works, but I fear for it...

i don't see anything special, only the GUI_DOWNLOAD. Strange... Because I had the same problem in the past and with using that function it worked.

I must be missing something...

former_member225631
Active Contributor
0 Kudos

Try rq-rqdoctype = 'SMART' or rq-rqdoctype = 'OTF'.

former_member1161170
Participant
0 Kudos

> Try rq-rqdoctype = 'SMART' or rq-rqdoctype = 'OTF'.

Ok: I have seen the field value and it is 'OTF' for my "SAP08" spool. So I have modified the code:


IF ( t_tsp01-rq0name = 'SMART' OR t_tsp01-rq0name = 'SCRIPT' 
      OR t_tsp01-rq0name = 'SAP08').
*  For Scripts and Smartforms.
      CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'

But the main problem remains: the pdf files continue to be empty.

Boths the kinds of files, from 'CONVERT_ABAPSPOOLJOB_2_PDF' and from 'CONVERT_OTFSPOOLJOB_2_PDF', are empty.

Perhaps the problem is gui_download: must I do something on the "tline" table before downloading?

Thank you for the board!

Regards.