<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Convert to PDF in background Processing in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-to-pdf-in-background-processing/m-p/3748635#M901964</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help.  I've been on it for days and I can't seem to find any solution.  Here's the scenario,  &lt;/P&gt;&lt;P&gt;1.  I get all the finished status spool in table TBTCO.&lt;/P&gt;&lt;P&gt;2.  Match with TBTCP to get the spool number.&lt;/P&gt;&lt;P&gt;3.  Open the graphical display of the spool to get the office &lt;/P&gt;&lt;P&gt;     code using FM RSPO_RETURN_ABAP_SPOOLJOB.&lt;/P&gt;&lt;P&gt;4.  Create a folder in the presentation folder for that office &lt;/P&gt;&lt;P&gt;     code.&lt;/P&gt;&lt;P&gt;5.  Create a pdf output for that spool.&lt;/P&gt;&lt;P&gt;6.  Save all pdf output with the same office codes in the  &lt;/P&gt;&lt;P&gt;     created the presentation folder.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is that an error keeps popping out.  It says "Error calling Data provider".  Maybe it's because I do it in background process, but I have to because if I don't, I get an "ABAP Runtime error."  O please help me.  Below are the FMs I used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        src_spoolid              = itab-sp_numb&lt;/P&gt;&lt;P&gt;        no_dialog                = c_no&lt;/P&gt;&lt;P&gt;        dst_device               = c_device&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;        pdf_bytecount            = gd_bytecount&lt;/P&gt;&lt;P&gt;      TABLES&lt;/P&gt;&lt;P&gt;        pdf                      = it_pdf_output&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        err_no_abap_spooljob     = 1&lt;/P&gt;&lt;P&gt;        err_no_spooljob          = 2&lt;/P&gt;&lt;P&gt;        err_no_permission        = 3&lt;/P&gt;&lt;P&gt;        err_conv_not_possible    = 4&lt;/P&gt;&lt;P&gt;        err_bad_destdevice       = 5&lt;/P&gt;&lt;P&gt;        user_cancelled           = 6&lt;/P&gt;&lt;P&gt;        err_spoolerror           = 7&lt;/P&gt;&lt;P&gt;        err_temseerror           = 8&lt;/P&gt;&lt;P&gt;        err_btcjob_open_failed   = 9&lt;/P&gt;&lt;P&gt;        err_btcjob_submit_failed = 10&lt;/P&gt;&lt;P&gt;        err_btcjob_close_failed  = 11&lt;/P&gt;&lt;P&gt;        OTHERS                   = 12.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    AT NEW sp_name.&lt;/P&gt;&lt;P&gt;      CONCATENATE: p_file itab-sp_name '\' INTO p_file.&lt;/P&gt;&lt;P&gt;    ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    AT NEW br_code.&lt;/P&gt;&lt;P&gt;      PERFORM get_brcode.&lt;/P&gt;&lt;P&gt;      CONCATENATE: p_file brc '\' INTO p_file.&lt;/P&gt;&lt;P&gt;    ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    AT NEW dumon.&lt;/P&gt;&lt;P&gt;      CONCATENATE: p_file itab-dumon '\' INTO p_file.&lt;/P&gt;&lt;P&gt;    ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      IF p_pres EQ 'X'.&lt;/P&gt;&lt;P&gt;        MOVE p_file TO lv_file.&lt;/P&gt;&lt;P&gt;        CALL FUNCTION 'GUI_DOWNLOAD'&lt;/P&gt;&lt;P&gt;          EXPORTING&lt;/P&gt;&lt;P&gt;            filename = lv_file&lt;/P&gt;&lt;P&gt;            filetype = 'BIN'&lt;/P&gt;&lt;P&gt;          TABLES&lt;/P&gt;&lt;P&gt;            data_tab = it_pdf_output.&lt;/P&gt;&lt;P&gt;        IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;          MESSAGE e398(00) WITH 'Error creating file' p_file.&lt;/P&gt;&lt;P&gt;        ELSE.&lt;/P&gt;&lt;P&gt;          MESSAGE i398(00) WITH 'File Created' p_file.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;      ELSE.&lt;/P&gt;&lt;P&gt;        APPEND LINES OF it_pdf_output TO lt_conv.&lt;/P&gt;&lt;P&gt;        IF lt_conv[] IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;          OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.&lt;/P&gt;&lt;P&gt;          IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;            LOOP AT lt_conv INTO lv_string.&lt;/P&gt;&lt;P&gt;              TRANSFER lv_string TO p_file.&lt;/P&gt;&lt;P&gt;            ENDLOOP.&lt;/P&gt;&lt;P&gt;            CLOSE DATASET p_file.&lt;/P&gt;&lt;P&gt;            IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;              MESSAGE i398(00) WITH 'File Created' p_file.&lt;/P&gt;&lt;P&gt;            ELSE.&lt;/P&gt;&lt;P&gt;              MESSAGE e398(00) WITH 'Error closing file' p_file.&lt;/P&gt;&lt;P&gt;            ENDIF.&lt;/P&gt;&lt;P&gt;          ELSE.&lt;/P&gt;&lt;P&gt;            MESSAGE e398(00) WITH 'Error creating file' p_file.&lt;/P&gt;&lt;P&gt;          ENDIF.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Points will be rewarded to the best answer.  Points will also be to those who bothered.  Thanks a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Apr 2008 08:54:07 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-22T08:54:07Z</dc:date>
    <item>
      <title>Convert to PDF in background Processing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-to-pdf-in-background-processing/m-p/3748635#M901964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help.  I've been on it for days and I can't seem to find any solution.  Here's the scenario,  &lt;/P&gt;&lt;P&gt;1.  I get all the finished status spool in table TBTCO.&lt;/P&gt;&lt;P&gt;2.  Match with TBTCP to get the spool number.&lt;/P&gt;&lt;P&gt;3.  Open the graphical display of the spool to get the office &lt;/P&gt;&lt;P&gt;     code using FM RSPO_RETURN_ABAP_SPOOLJOB.&lt;/P&gt;&lt;P&gt;4.  Create a folder in the presentation folder for that office &lt;/P&gt;&lt;P&gt;     code.&lt;/P&gt;&lt;P&gt;5.  Create a pdf output for that spool.&lt;/P&gt;&lt;P&gt;6.  Save all pdf output with the same office codes in the  &lt;/P&gt;&lt;P&gt;     created the presentation folder.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is that an error keeps popping out.  It says "Error calling Data provider".  Maybe it's because I do it in background process, but I have to because if I don't, I get an "ABAP Runtime error."  O please help me.  Below are the FMs I used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        src_spoolid              = itab-sp_numb&lt;/P&gt;&lt;P&gt;        no_dialog                = c_no&lt;/P&gt;&lt;P&gt;        dst_device               = c_device&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;        pdf_bytecount            = gd_bytecount&lt;/P&gt;&lt;P&gt;      TABLES&lt;/P&gt;&lt;P&gt;        pdf                      = it_pdf_output&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        err_no_abap_spooljob     = 1&lt;/P&gt;&lt;P&gt;        err_no_spooljob          = 2&lt;/P&gt;&lt;P&gt;        err_no_permission        = 3&lt;/P&gt;&lt;P&gt;        err_conv_not_possible    = 4&lt;/P&gt;&lt;P&gt;        err_bad_destdevice       = 5&lt;/P&gt;&lt;P&gt;        user_cancelled           = 6&lt;/P&gt;&lt;P&gt;        err_spoolerror           = 7&lt;/P&gt;&lt;P&gt;        err_temseerror           = 8&lt;/P&gt;&lt;P&gt;        err_btcjob_open_failed   = 9&lt;/P&gt;&lt;P&gt;        err_btcjob_submit_failed = 10&lt;/P&gt;&lt;P&gt;        err_btcjob_close_failed  = 11&lt;/P&gt;&lt;P&gt;        OTHERS                   = 12.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    AT NEW sp_name.&lt;/P&gt;&lt;P&gt;      CONCATENATE: p_file itab-sp_name '\' INTO p_file.&lt;/P&gt;&lt;P&gt;    ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    AT NEW br_code.&lt;/P&gt;&lt;P&gt;      PERFORM get_brcode.&lt;/P&gt;&lt;P&gt;      CONCATENATE: p_file brc '\' INTO p_file.&lt;/P&gt;&lt;P&gt;    ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    AT NEW dumon.&lt;/P&gt;&lt;P&gt;      CONCATENATE: p_file itab-dumon '\' INTO p_file.&lt;/P&gt;&lt;P&gt;    ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      IF p_pres EQ 'X'.&lt;/P&gt;&lt;P&gt;        MOVE p_file TO lv_file.&lt;/P&gt;&lt;P&gt;        CALL FUNCTION 'GUI_DOWNLOAD'&lt;/P&gt;&lt;P&gt;          EXPORTING&lt;/P&gt;&lt;P&gt;            filename = lv_file&lt;/P&gt;&lt;P&gt;            filetype = 'BIN'&lt;/P&gt;&lt;P&gt;          TABLES&lt;/P&gt;&lt;P&gt;            data_tab = it_pdf_output.&lt;/P&gt;&lt;P&gt;        IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;          MESSAGE e398(00) WITH 'Error creating file' p_file.&lt;/P&gt;&lt;P&gt;        ELSE.&lt;/P&gt;&lt;P&gt;          MESSAGE i398(00) WITH 'File Created' p_file.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;      ELSE.&lt;/P&gt;&lt;P&gt;        APPEND LINES OF it_pdf_output TO lt_conv.&lt;/P&gt;&lt;P&gt;        IF lt_conv[] IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;          OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.&lt;/P&gt;&lt;P&gt;          IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;            LOOP AT lt_conv INTO lv_string.&lt;/P&gt;&lt;P&gt;              TRANSFER lv_string TO p_file.&lt;/P&gt;&lt;P&gt;            ENDLOOP.&lt;/P&gt;&lt;P&gt;            CLOSE DATASET p_file.&lt;/P&gt;&lt;P&gt;            IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;              MESSAGE i398(00) WITH 'File Created' p_file.&lt;/P&gt;&lt;P&gt;            ELSE.&lt;/P&gt;&lt;P&gt;              MESSAGE e398(00) WITH 'Error closing file' p_file.&lt;/P&gt;&lt;P&gt;            ENDIF.&lt;/P&gt;&lt;P&gt;          ELSE.&lt;/P&gt;&lt;P&gt;            MESSAGE e398(00) WITH 'Error creating file' p_file.&lt;/P&gt;&lt;P&gt;          ENDIF.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Points will be rewarded to the best answer.  Points will also be to those who bothered.  Thanks a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Apr 2008 08:54:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-to-pdf-in-background-processing/m-p/3748635#M901964</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-22T08:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: Convert to PDF in background Processing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-to-pdf-in-background-processing/m-p/3748636#M901965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problems comes from the use of function module GUI_DOWNLOAD. You can't use it in background .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to download the file in background use Abap Instruction "OPEN DATASET" and so on. I suggest you to use also Logical File it's a better solution .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this help you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Apr 2008 10:49:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-to-pdf-in-background-processing/m-p/3748636#M901965</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-22T10:49:57Z</dc:date>
    </item>
  </channel>
</rss>

