<?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: SAVE_TEXT function in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/save-text-function/m-p/8499615#M1653877</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thats allready done, it checks if the text is allready in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If sy-subrc ne 0 then it will add another line to the lt_lines table and it will be processed by SAVE_TEXT function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that the code runs, no errors are given but i dont find the text.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Feb 2012 13:20:08 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2012-02-10T13:20:08Z</dc:date>
    <item>
      <title>SAVE_TEXT function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/save-text-function/m-p/8499609#M1653871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a problem regarding the save_text function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If, for an outbound delivery, in the header, texts tab i have more than one text for the shipping instruction, English and German for example and in an user exit i am trying to modify the text for English (add a new text and also keep the old one) function SAVE_TEXT + COMMIT_TEXT does not save anything.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have noticed that if you delete one of the shipping instructions texts, German for example, the english text is updated, otherwise no update.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did someone encounter this behaviour before ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Cristian.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2012 13:17:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/save-text-function/m-p/8499609#M1653871</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-02-09T13:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: SAVE_TEXT function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/save-text-function/m-p/8499610#M1653872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Cris,&lt;/P&gt;&lt;P&gt;           This FM is not a very reliable one, although if you wish to use , you should write a commit work (BAPI_TRANSACTION_COMMIT). To check it best idea will be create a program in SE38 call this FM with some default values, and then CALL BAPI_TRANNSACTION_COMMIT this will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Tapodipta Khan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2012 23:17:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/save-text-function/m-p/8499610#M1653872</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-02-09T23:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: SAVE_TEXT function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/save-text-function/m-p/8499611#M1653873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The SAVEMODE_DIRECT parameter of this FM should help you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2012 23:47:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/save-text-function/m-p/8499611#M1653873</guid>
      <dc:creator>Tamas_Hoznek</dc:creator>
      <dc:date>2012-02-09T23:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: SAVE_TEXT function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/save-text-function/m-p/8499612#M1653874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2012 04:53:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/save-text-function/m-p/8499612#M1653874</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-02-10T04:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: SAVE_TEXT function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/save-text-function/m-p/8499613#M1653875</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;This is the code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*** shipping instructions ***
    ls_head-tdid        = '0012'.
    ls_head-tdspras     = ls_kna1-spras.
    ls_head-tdname      = likp-vbeln.
    ls_head-tdobject    = 'VBBK'.
    ls_head-tdform      = 'SYSTEM'.
    ls_head-tdlinesize  = 72.

    CLEAR: lt_lines[],
           ls_lines.

    CALL FUNCTION 'READ_TEXT'
      EXPORTING
        client                  = sy-mandt
        id                      = ls_head-tdid
        language                = ls_head-tdspras
        name                    = ls_head-tdname
        object                  = ls_head-tdobject
      TABLES
        lines                   = lt_lines[]
      EXCEPTIONS
        id                      = 1
        language                = 2
        name                    = 3
        not_found               = 4
        object                  = 5
        reference_check         = 6
        wrong_access_to_archive = 7
        OTHERS                  = 8.

    CASE sy-subrc.
      WHEN 4.

        ls_lines-tdformat = '*'.
        ls_lines-tdline = lv_text.
        APPEND ls_lines TO lt_lines.

        CALL FUNCTION 'SAVE_TEXT'
          EXPORTING
            client = sy-mandt
            header = ls_head
            insert = 'X'
          TABLES
            lines  = lt_lines[].

        CALL FUNCTION 'COMMIT_TEXT'
          EXPORTING
            object          = ls_head-tdobject
            name            = ls_head-tdname
            id              = ls_head-tdid
            language        = ls_head-tdspras
            savemode_direct = 'X'.

      WHEN 0.

        READ TABLE lt_lines INTO ls_lines WITH KEY tdline = lv_text.

        IF sy-subrc NE 0.

          ls_lines-tdformat = '*'.
          ls_lines-tdline = lv_text.
          APPEND ls_lines TO lt_lines.

          CALL FUNCTION 'SAVE_TEXT'
            EXPORTING
             client                = sy-mandt
              header                = ls_head
*             insert                =
            TABLES
              lines                 = lt_lines[].

          CALL FUNCTION 'COMMIT_TEXT'
            EXPORTING
              object          = ls_head-tdobject
              name            = ls_head-tdname
              id              = ls_head-tdid
              language        = ls_head-tdspras
              savemode_direct = 'X'.

        ENDIF.
    ENDCASE.
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the code would be wrong, i suppose the update should not work even if i have only one language in the shipping instruction. But it works for one language, not working for more than one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Cristian Boartes on Feb 10, 2012 9:29 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2012 08:29:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/save-text-function/m-p/8499613#M1653875</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-02-10T08:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: SAVE_TEXT function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/save-text-function/m-p/8499614#M1653876</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;By using this code, I am able to update the text for which both languages values are already maintained in the delivery header for that text id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
WHEN 0.
 
        READ TABLE lt_lines INTO ls_lines WITH KEY tdline = lv_text.
 
        IF sy-subrc NE 0.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check whether the value in lv_text is already available in intenal table lt_lines (Already that value is maintained in the text id for that language).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2012 10:06:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/save-text-function/m-p/8499614#M1653876</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-02-10T10:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: SAVE_TEXT function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/save-text-function/m-p/8499615#M1653877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thats allready done, it checks if the text is allready in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If sy-subrc ne 0 then it will add another line to the lt_lines table and it will be processed by SAVE_TEXT function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that the code runs, no errors are given but i dont find the text.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2012 13:20:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/save-text-function/m-p/8499615#M1653877</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-02-10T13:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: SAVE_TEXT function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/save-text-function/m-p/8499616#M1653878</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 creating a Z program with the same code and hardcoding the ls_head-tdspras &amp;amp; ls_head-tdname. Put a value "TEST' in variable lv_text. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now for a delivery where initialy there is no value maintained for the text id, execute the program with 'EN' language and also execute with 'DE' language. Now two values will be created for the text id in the delivery one with EN language and another with DE language with the same value "TEST".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now change the value of lv_text to "TESTING" and execute  the program with EN language. Now the new value TESTING will be updated along with the value TEST in the delivery header text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to execute this scenario with your code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2012 13:45:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/save-text-function/m-p/8499616#M1653878</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-02-10T13:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: SAVE_TEXT function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/save-text-function/m-p/8499617#M1653879</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;You are right, it should work as there is no rocket science for this code but the problem is that in the user exit is not working and i have no clue why in a Z program it works and in the user exit it does not....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2012 14:44:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/save-text-function/m-p/8499617#M1653879</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-02-10T14:44:32Z</dc:date>
    </item>
  </channel>
</rss>

