<?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: function SAVE_TEXT in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-save-text/m-p/2078721#M431083</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;Check this code. It is to save header note text on sales document. It insert text line by line instead of concatenating them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;----------------------------------------------------------------------*
----------------------------------------------------------------------*
DATA: l_objname LIKE thead-tdname,
      l_vbeln   LIKE vbak-vbeln.

DATA: lst_header LIKE thead.    "Target Text Header

*" internal table for text to be inserted
DATA: lit_textline  LIKE tline OCCURS 10 WITH HEADER LINE.

*" move sales document number
l_vbeln = 'Pass Sales document number here'.
l_objname = l_vbeln. "(or you can directly assing VBELN value here)

*" Create text header
lst_header-tdobject = 'VBBK'.
lst_header-tdname   = l_objname.
lst_header-tdid     = '0001'.
lst_header-tdspras  = sy-langu.

lit_textline-tdformat = '*'.  "User tdformat = '*', this means 'DEFAULT PARAGRATH'
lit_textline-tdline   = 'This is 1st line'.
APPEND lit_textline.

lit_textline-tdformat = '*'.
lit_textline-tdline   = 'This is 2nd line'.
APPEND lit_textline.

lit_textline-tdformat = '*'.
lit_textline-tdline   = 'This is 3rd line'.
APPEND lit_textline.

lit_textline-tdformat = '*'.
lit_textline-tdline   = 'This is 4th line'.
APPEND lit_textline.

* Save text
CALL FUNCTION 'SAVE_TEXT'
     EXPORTING
          client          = sy-mandt
          header          = lst_header
          insert          = 'X'
          savemode_direct = 'X'
     TABLES
          lines           = lit_textline.
IF sy-subrc &amp;lt;&amp;gt; 0.
*  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
----------------------------------------------------------------------*
----------------------------------------------------------------------*&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;RS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 15 Apr 2007 17:15:33 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-15T17:15:33Z</dc:date>
    <item>
      <title>function SAVE_TEXT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-save-text/m-p/2078719#M431081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using this function in order to save text in sales order.&lt;/P&gt;&lt;P&gt;When i pass the table lines to the function it has for example 4 lines.&lt;/P&gt;&lt;P&gt;After saving i can see that the 4 lines where concatenated to each other.&lt;/P&gt;&lt;P&gt;I want to create a situation where the 4 lines will be one after the other.&lt;/P&gt;&lt;P&gt;Is it possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Yifat Bar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Apr 2007 12:06:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-save-text/m-p/2078719#M431081</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-15T12:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: function SAVE_TEXT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-save-text/m-p/2078720#M431082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you concatenate cl_abap_char_utilities=&amp;gt;cr_lf  at the end of each line to insert line breaks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i guess this can also be achived by passing proper tdformat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Raja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Apr 2007 12:34:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-save-text/m-p/2078720#M431082</guid>
      <dc:creator>athavanraja</dc:creator>
      <dc:date>2007-04-15T12:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: function SAVE_TEXT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-save-text/m-p/2078721#M431083</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;Check this code. It is to save header note text on sales document. It insert text line by line instead of concatenating them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;----------------------------------------------------------------------*
----------------------------------------------------------------------*
DATA: l_objname LIKE thead-tdname,
      l_vbeln   LIKE vbak-vbeln.

DATA: lst_header LIKE thead.    "Target Text Header

*" internal table for text to be inserted
DATA: lit_textline  LIKE tline OCCURS 10 WITH HEADER LINE.

*" move sales document number
l_vbeln = 'Pass Sales document number here'.
l_objname = l_vbeln. "(or you can directly assing VBELN value here)

*" Create text header
lst_header-tdobject = 'VBBK'.
lst_header-tdname   = l_objname.
lst_header-tdid     = '0001'.
lst_header-tdspras  = sy-langu.

lit_textline-tdformat = '*'.  "User tdformat = '*', this means 'DEFAULT PARAGRATH'
lit_textline-tdline   = 'This is 1st line'.
APPEND lit_textline.

lit_textline-tdformat = '*'.
lit_textline-tdline   = 'This is 2nd line'.
APPEND lit_textline.

lit_textline-tdformat = '*'.
lit_textline-tdline   = 'This is 3rd line'.
APPEND lit_textline.

lit_textline-tdformat = '*'.
lit_textline-tdline   = 'This is 4th line'.
APPEND lit_textline.

* Save text
CALL FUNCTION 'SAVE_TEXT'
     EXPORTING
          client          = sy-mandt
          header          = lst_header
          insert          = 'X'
          savemode_direct = 'X'
     TABLES
          lines           = lit_textline.
IF sy-subrc &amp;lt;&amp;gt; 0.
*  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
----------------------------------------------------------------------*
----------------------------------------------------------------------*&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;RS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Apr 2007 17:15:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-save-text/m-p/2078721#M431083</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-15T17:15:33Z</dc:date>
    </item>
  </channel>
</rss>

