<?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: Saving and Reading Text in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-and-reading-text/m-p/1313885#M162922</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have added the call to COMMIT_TEXT, but it still isn't saving it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 May 2006 14:52:25 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-05-17T14:52:25Z</dc:date>
    <item>
      <title>Saving and Reading Text</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-and-reading-text/m-p/1313878#M162915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to save text to text tables, and then read the same text.  It appears as though the save is working (it returns sy-subrc of 0), but I'm not sure, because I can't see the text in the tables (STXH and STXL).  When I try to retrieve the text, it is saying it is not found.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my code for saving the text:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;* Convert a String to TDLINE Table
  CALL FUNCTION 'SOTR_SERV_STRING_TO_TABLE'
    EXPORTING
      TEXT                = qtcomm
      FLAG_NO_LINE_BREAKS = 'X'
      LINE_LENGTH         = 132
      LANGU               = SY-LANGU
    TABLES
      TEXT_TAB            = t_tdline.

* Convert TDLINE to ITAB_LINES and adding the format
  loop at t_tdline into lw_tdline.

    clear wtab_lines.

    if sy-tabix = 1.
      wtab_lines-tdformat = '*'.
    else.
      wtab_lines-tdformat = '/'.
    endif.

    wtab_lines-tdline = lw_tdline.
    append wtab_lines to itab_lines.

  endloop.

* Save Text
  CALL FUNCTION 'INIT_TEXT'
    EXPORTING
      ID       = 'ST'
      LANGUAGE = sy-langu
      NAME     = lv_name
      OBJECT   = 'TEXT'
    IMPORTING
      header   = lv_texthead
    TABLES
      LINES    = itab_lines
    EXCEPTIONS
      OTHERS   = 5.

  if sy-subrc is initial.
  CALL FUNCTION 'SAVE_TEXT'
    EXPORTING
      client          = sy-mandt
      HEADER          = lv_texthead
      SAVEMODE_DIRECT = 'X'
    TABLES
      LINES           = itab_lines
    EXCEPTIONS
      OTHERS          = 5.
  endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my code for retrieving the text:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    CALL FUNCTION 'READ_TEXT'
      EXPORTING
        ID                      = 'ST'
        LANGUAGE                = sy-langu
        NAME                    = lv_tdname
        OBJECT                  = 'TEXT'
      TABLES
        LINES                   = t_tdline
      EXCEPTIONS
        id                      = 1
        language                = 2
        name                    = 3
        not_found               = 4
        object                  = 5
        reference_check         = 6
        wrong_access_to_archive = 7
        others                  = 8.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The read_text is returning a sy-subrc value of 4 (not found).  The tdname value in both the save and the read is "Q0000000161 1". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anybody see any problems with my code?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 May 2006 12:53:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/saving-and-reading-text/m-p/1313878#M162915</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-17T12:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: Saving and Reading Text</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-and-reading-text/m-p/1313879#M162916</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;Try to call the function COMMIT_TEXT after save_text and before read_text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note : Please mark the helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 May 2006 12:56:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/saving-and-reading-text/m-p/1313879#M162916</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-17T12:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: Saving and Reading Text</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-and-reading-text/m-p/1313880#M162917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Which parameters in the COMMIT_TEXT do I need to use?  They are all optional.  Which ones are required?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;        CALL FUNCTION 'COMMIT_TEXT'
*         EXPORTING
*           OBJECT                = '*'
*           NAME                  = '*'
*           ID                    = '*'
*           LANGUAGE              = '*'
*           SAVEMODE_DIRECT       = ' '
*           KEEP                  = ' '
*           LOCAL_CAT             = ' '
*         IMPORTING
*           COMMIT_COUNT          =
*         TABLES
*           T_OBJECT              =
*           T_NAME                =
*           T_ID                  =
*           T_LANGUAGE            =&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 May 2006 12:59:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/saving-and-reading-text/m-p/1313880#M162917</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-17T12:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: Saving and Reading Text</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-and-reading-text/m-p/1313881#M162918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you able to Display the Text using SO10?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suresh Datti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 May 2006 12:59:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/saving-and-reading-text/m-p/1313881#M162918</guid>
      <dc:creator>suresh_datti</dc:creator>
      <dc:date>2006-05-17T12:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: Saving and Reading Text</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-and-reading-text/m-p/1313882#M162919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, it is not appearing in SO10.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 May 2006 13:50:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/saving-and-reading-text/m-p/1313882#M162919</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-17T13:50:32Z</dc:date>
    </item>
    <item>
      <title>Re: Saving and Reading Text</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-and-reading-text/m-p/1313883#M162920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Denise,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try to code something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'SAVE_TEXT'    
  EXPORTING      
    CLIENT          = sy-mandt      
    HEADER          = lv_texthead      
    INSERT          = 'X'    
  TABLES      
    LINES           = itab_lines    
  EXCEPTIONS      
    OTHERS          = 5.

CALL FUNCTION 'COMMIT_TEXT'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Hope this will help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarsd,&lt;/P&gt;&lt;P&gt;Ferry Lianto&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reward points if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 May 2006 14:26:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/saving-and-reading-text/m-p/1313883#M162920</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-17T14:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: Saving and Reading Text</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-and-reading-text/m-p/1313884#M162921</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;you need to call the FM COMMIT_TEXT after your SAVE_TEXT FM call.&lt;/P&gt;&lt;P&gt;then only your text will be saved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 May 2006 14:31:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/saving-and-reading-text/m-p/1313884#M162921</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-17T14:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Saving and Reading Text</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-and-reading-text/m-p/1313885#M162922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have added the call to COMMIT_TEXT, but it still isn't saving it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 May 2006 14:52:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/saving-and-reading-text/m-p/1313885#M162922</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-17T14:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: Saving and Reading Text</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-and-reading-text/m-p/1313886#M162923</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 fact that you are unable to see the data in SO10 could be because its not getting committed, which has a lesser probability of happening or the parameters you are passing need to looked at again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you go in debig mode, make a note of the exact value being passed to SAVE_TEXT and use those exact values in SO10?&lt;/P&gt;&lt;P&gt;&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, 17 May 2006 17:13:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/saving-and-reading-text/m-p/1313886#M162923</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-17T17:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: Saving and Reading Text</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-and-reading-text/m-p/1313887#M162924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I just did this.  Copied the name value, then using that in SO10, and it isn't there.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 May 2006 18:30:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/saving-and-reading-text/m-p/1313887#M162924</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-17T18:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: Saving and Reading Text</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-and-reading-text/m-p/1313888#M162925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I thought INIT_TEXT deletes the line items and only populated the header with some defaults?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I usually build the lines after INIT_TEXT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, can you show is the value of LV_TEXTHEAD just before SAVE_TEXT?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 May 2006 18:40:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/saving-and-reading-text/m-p/1313888#M162925</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-17T18:40:25Z</dc:date>
    </item>
  </channel>
</rss>

