<?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 Re: Convert text file on application server to binary (send mail in background) in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-text-file-on-application-server-to-binary-send-mail-in-background/m-p/6890764#M1480016</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;further analysis, it was found that the problem occurs when we convert the file data from text to binary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Still not able to get your issue......If your data is saved in application server in text mode, why you are converting it to binary?&lt;/P&gt;&lt;P&gt;Is there any special reason...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you said, the file is perfect in application server and the problem is with email. How are you sending the data through email?&lt;/P&gt;&lt;P&gt;You must be sending the same data via email and writing it to application server. Then why reading application server is required when email can be sent using the internal table contents directly?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Apr 2010 13:15:25 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-04-30T13:15:25Z</dc:date>
    <item>
      <title>Convert text file on application server to binary (send mail in background)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-text-file-on-application-server-to-binary-send-mail-in-background/m-p/6890761#M1480013</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;I have a report that does the foll:&lt;/P&gt;&lt;P&gt;1. Foreground &lt;/P&gt;&lt;P&gt;             u2022 ALV&lt;/P&gt;&lt;P&gt;             u2022 Download data into a text file on desktop&lt;/P&gt;&lt;P&gt;             u2022 Send data as email text file attachment&lt;/P&gt;&lt;P&gt;2.  Background&lt;/P&gt;&lt;P&gt;             u2022 Generate spool &lt;/P&gt;&lt;P&gt;             u2022 Download data into a text file on application server&lt;/P&gt;&lt;P&gt;             u2022 Send data as email text file attachment&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The report runs correctly in foreground.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in background, when I try to send the email, the data is not properly formatted.  Further, many records are absent in the email attachment. The file on the application server is properly formatted and contains all records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On further analysis, it was found that the problem occurs when we convert the file data from text to binary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cannot use the function module u2018GUI_UPLOADu2019 (which I have used in foreground)as the file is on the application server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried using the function module u2018SCMS_TEXT_TO_BINARYu2019, but the problem persists.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried using u2018OPEN DATASET filename FOR INPUT IN BINARY MODEu2019 and read the file data. Still the records are truncated, and formatting is incorrect. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On comparing the files from foreground and background, while debugging, it was seen that the internal table is a standard table of TLINE, with fields TDFORMAT (CHAR2), and TDLINE (CHAR132).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In foreground, the data is stored in both fields, while in background the data is either stored in TDFORMAT or in TDLINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please help me with the file conversion from text to binary, retaining the proper formatting and the no. of records?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Smruthi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S : I have searched on SDN as well as on Google but have not found any relevant solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Apr 2010 07:30:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-text-file-on-application-server-to-binary-send-mail-in-background/m-p/6890761#M1480013</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-30T07:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: Convert text file on application server to binary (send mail in background)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-text-file-on-application-server-to-binary-send-mail-in-background/m-p/6890762#M1480014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The data downloaded to application server is in which format ? Could you post the code for reading data from application server?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Apr 2010 10:21:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-text-file-on-application-server-to-binary-send-mail-in-background/m-p/6890762#M1480014</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-30T10:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: Convert text file on application server to binary (send mail in background)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-text-file-on-application-server-to-binary-send-mail-in-background/m-p/6890763#M1480015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Satyajit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for going through the thread.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data downloaded to application server is in textformat &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code for reading data from application server:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA : record(132) TYPE c.

* Open the dataset
    OPEN DATASET text_file FOR INPUT IN BINARY MODE.

    DO.
      READ DATASET text_file INTO record.
      IF sy-subrc &amp;lt;&amp;gt; 0.
        EXIT.
      ELSEIF sy-subrc EQ 0.
        wa_itab-tdline = record.
        APPEND wa_itab TO itab.
        CLEAR wa_itab.
      ENDIF.
    ENDDO&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Smruthi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Apr 2010 12:08:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-text-file-on-application-server-to-binary-send-mail-in-background/m-p/6890763#M1480015</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-30T12:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: Convert text file on application server to binary (send mail in background)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-text-file-on-application-server-to-binary-send-mail-in-background/m-p/6890764#M1480016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;further analysis, it was found that the problem occurs when we convert the file data from text to binary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Still not able to get your issue......If your data is saved in application server in text mode, why you are converting it to binary?&lt;/P&gt;&lt;P&gt;Is there any special reason...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you said, the file is perfect in application server and the problem is with email. How are you sending the data through email?&lt;/P&gt;&lt;P&gt;You must be sending the same data via email and writing it to application server. Then why reading application server is required when email can be sent using the internal table contents directly?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Apr 2010 13:15:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-text-file-on-application-server-to-binary-send-mail-in-background/m-p/6890764#M1480016</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-30T13:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: Convert text file on application server to binary (send mail in background)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-text-file-on-application-server-to-binary-send-mail-in-background/m-p/6890765#M1480017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for taking time out to help me, Satyajit.  &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;The problem is solved now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Smruthi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 May 2010 10:24:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-text-file-on-application-server-to-binary-send-mail-in-background/m-p/6890765#M1480017</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-03T10:24:28Z</dc:date>
    </item>
  </channel>
</rss>

