<?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: Email SapScript : Question on READ_OTF_FROM_MEMORY in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/email-sapscript-question-on-read-otf-from-memory/m-p/1499078#M231382</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;    Comment out memory key parameter form ur function&lt;/P&gt;&lt;P&gt;    module and try.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; memory_key   = nast-objky&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      otf          = lt_otf&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      memory_empty = 1&lt;/P&gt;&lt;P&gt;      OTHERS       = 2.&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;Amole&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Aug 2006 10:18:43 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-08-23T10:18:43Z</dc:date>
    <item>
      <title>Email SapScript : Question on READ_OTF_FROM_MEMORY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/email-sapscript-question-on-read-otf-from-memory/m-p/1499077#M231381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I'm trying to extend my order print program in order to enable the sending by mail of a SapScript.&lt;/P&gt;&lt;P&gt;So :&lt;/P&gt;&lt;P&gt;I'm using :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;READ_OTF_FROM_MEMORY&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Then&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CONVERT_OTF_2_PDF&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SO_NEW_DOCUMENT_ATT_SEND_API1&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;( With a little more code ! ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In debug mode, I can see that the return code of &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;READ_OTF_FROM_MEMORY&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; is &amp;lt;b&amp;gt;1&amp;lt;/b&amp;gt; :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*-- Read OTF from memory
  CALL FUNCTION 'READ_OTF_FROM_MEMORY'
    EXPORTING
      memory_key   = nast-objky
    TABLES
      otf          = lt_otf
    EXCEPTIONS
      memory_empty = 1
      OTHERS       = 2.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which means "memory empty" so I can't retrieve my form.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't understand why ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thx in advance,&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Erwan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Aug 2006 10:11:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/email-sapscript-question-on-read-otf-from-memory/m-p/1499077#M231381</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-23T10:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: Email SapScript : Question on READ_OTF_FROM_MEMORY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/email-sapscript-question-on-read-otf-from-memory/m-p/1499078#M231382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;    Comment out memory key parameter form ur function&lt;/P&gt;&lt;P&gt;    module and try.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; memory_key   = nast-objky&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      otf          = lt_otf&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      memory_empty = 1&lt;/P&gt;&lt;P&gt;      OTHERS       = 2.&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;Amole&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Aug 2006 10:18:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/email-sapscript-question-on-read-otf-from-memory/m-p/1499078#M231382</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-23T10:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: Email SapScript : Question on READ_OTF_FROM_MEMORY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/email-sapscript-question-on-read-otf-from-memory/m-p/1499079#M231383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hum...&lt;/P&gt;&lt;P&gt;No it doesn't work !&lt;/P&gt;&lt;P&gt;return code is always '1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Other idea ?&lt;/P&gt;&lt;P&gt;Thx a lot&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Aug 2006 11:24:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/email-sapscript-question-on-read-otf-from-memory/m-p/1499079#M231383</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-23T11:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Email SapScript : Question on READ_OTF_FROM_MEMORY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/email-sapscript-question-on-read-otf-from-memory/m-p/1499080#M231384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Check sample code ::&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FUNCTION zisa_container_pack_pdf .
*"----------------------------------------------------------------------
*"*"Local interface:
*"  IMPORTING
*"     VALUE(DELIVERY) LIKE  BAPIVBELN-VBELN
*"  TABLES
*"      IT_PDF STRUCTURE  TBL1024
*"      RETURN STRUCTURE  BAPIRET2
*"----------------------------------------------------------------------
  DATA: lt_pdfdata LIKE TABLE OF tline WITH HEADER LINE.
 &amp;lt;b&amp;gt; DATA: lt_otf    TYPE STANDARD TABLE OF itcoo WITH HEADER LINE,&amp;lt;/b&amp;gt;
        lt_doctab TYPE STANDARD TABLE OF docs WITH HEADER LINE,
        lt_otfdata TYPE STANDARD TABLE OF itcoo WITH HEADER LINE.
  DATA: x_nast LIKE  nast,  "Message Status
        x_tnapr LIKE tnapr. "Processing programs for output.
  DATA : len TYPE i.

*-- Calling the Subroutine Entry

*-- Get all the details from NAST table
*-- SALESDOCUMENTIN : Sales Document number (Importing parameter)
  SELECT * UP TO 1 ROWS  INTO nast FROM nast WHERE kappl = 'V2' AND
                                       objky = delivery AND
                                       kschl = 'ZDSP' AND
                                       spras = sy-langu.
  ENDSELECT.


  IF sy-subrc = 0.
*-- Get all the details from TNAPR table
*-- 'ZDSP' : Output type defined for the Sales order
*-- '1' : Transmission medium : Printer
    SELECT SINGLE * INTO tnapr
    FROM tnapr WHERE kschl = 'ZDSP' AND
                              nacha = '1' AND
                              kappl = 'V2'.

    IF sy-subrc = 0.
*-- Populate the return code as per the standard driver program
      return_code = 999.
      us_screen = 'X'.
*-- Populate the Transaction code in the NAST structure
*-- 'VL03N' : Sales order Display transaction
      &amp;lt;b&amp;gt;nast-tcode = 'VL03N'.&amp;lt;/b&amp;gt;
      PERFORM entry IN PROGRAM zisa_vaddn01_fm USING nast
                                                 tnapr
                                                 return_code
                                                 us_screen.
    ELSE.
      return-type = 'E'.
      return-message = 'No Form found in the TNAPR table'.
      APPEND return.
      CLEAR  return.
    ENDIF.

*-- Read OTF from memory
   &amp;lt;b&amp;gt; CALL FUNCTION 'READ_OTF_FROM_MEMORY'
         EXPORTING
              memory_key   = nast-objky
         TABLES
              otf          = lt_otf
         EXCEPTIONS
              memory_empty = 1
              OTHERS       = 2.&amp;lt;/b&amp;gt;
    IF sy-subrc = 0.
*-- Convert the OTF data to PDF data
      CALL FUNCTION 'CONVERT_OTF_2_PDF'
           EXPORTING
                use_otf_mc_cmd         = 'X'
           IMPORTING
                bin_filesize           = v_bin
           TABLES
                otf                    = lt_otf
                doctab_archive         = it_doctab
                lines                  = lt_pdfdata
           EXCEPTIONS
                err_conv_not_possible  = 1
                err_otf_mc_noendmarker = 2
                OTHERS                 = 3.


      IF sy-subrc &amp;lt;&amp;gt; 0.
        return-type = 'E'.
        return-message =
          'An error occured in Converting OTF Data to PDF Data'.
        APPEND return.
        CLEAR  return.
      ELSE.

*       Converting pdf data to raw data
        CALL FUNCTION 'QCE1_CONVERT'
             TABLES
                  t_source_tab         = lt_pdfdata
                  t_target_tab         = it_pdf
             EXCEPTIONS
                  convert_not_possible = 1
                  OTHERS               = 2.

        LOOP AT  it_pdf.
          len = len + STRLEN( it_pdf ).
        ENDLOOP.
*         if ( v_bin = len ).
*         endif.
      ENDIF.
    ELSE.
      return-type = 'E'.
      return-message =
        'An error occured in retrieving OTF Data from Memory'.
      APPEND return.
      CLEAR  return.
    ENDIF.
  ELSE.
    return-type = 'E'.
    return-message = 'No NAST entry found with this Sales Order'.
    APPEND return.
    CLEAR  return.
  ENDIF.
ENDFUNCTION.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ashok P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Aug 2006 11:28:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/email-sapscript-question-on-read-otf-from-memory/m-p/1499080#M231384</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-23T11:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: Email SapScript : Question on READ_OTF_FROM_MEMORY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/email-sapscript-question-on-read-otf-from-memory/m-p/1499081#M231385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Erwan,&lt;/P&gt;&lt;P&gt;   It means the memory id is indeed empty.&lt;/P&gt;&lt;P&gt;Why do you want to get the otf, when it is readily available in the close_form tables parameters?&lt;/P&gt;&lt;P&gt;Use that otf data and send to the subsequent processing.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Aug 2006 11:30:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/email-sapscript-question-on-read-otf-from-memory/m-p/1499081#M231385</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-23T11:30:34Z</dc:date>
    </item>
    <item>
      <title>Re: Email SapScript : Question on READ_OTF_FROM_MEMORY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/email-sapscript-question-on-read-otf-from-memory/m-p/1499082#M231386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thx a lot&lt;/P&gt;&lt;P&gt;Erwan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Aug 2006 12:19:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/email-sapscript-question-on-read-otf-from-memory/m-p/1499082#M231386</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-23T12:19:15Z</dc:date>
    </item>
  </channel>
</rss>

