<?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: Conversion for Long text fields in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-for-long-text-fields/m-p/6122094#M1363917</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 something like this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: NEWLINE(4) TYPE X VALUE '0D0A'.

len = strlen( l_text ).          "---------&amp;gt; Length of the long text

if len &amp;gt; 132.
CONCATENATE l_text+0(132) l_text+132(132)  into tdline seperated by NEWLINE.
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vikranth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Aug 2009 14:32:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-08-27T14:32:19Z</dc:date>
    <item>
      <title>Conversion for Long text fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-for-long-text-fields/m-p/6122093#M1363916</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 am doing data mapping.I have a rule like,if the length of a text is more,then split at 132,&lt;/P&gt;&lt;P&gt;move the text(till 132) to the target field and rest again split at 132 move to next line of the target field and so on...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have declared my target field as :&lt;/P&gt;&lt;P&gt;tdline                 TYPE tdline.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone suggest on this.Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2009 13:06:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-for-long-text-fields/m-p/6122093#M1363916</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-27T13:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion for Long text fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-for-long-text-fields/m-p/6122094#M1363917</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 something like this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: NEWLINE(4) TYPE X VALUE '0D0A'.

len = strlen( l_text ).          "---------&amp;gt; Length of the long text

if len &amp;gt; 132.
CONCATENATE l_text+0(132) l_text+132(132)  into tdline seperated by NEWLINE.
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vikranth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2009 14:32:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-for-long-text-fields/m-p/6122094#M1363917</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-27T14:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion for Long text fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-for-long-text-fields/m-p/6122095#M1363918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vikranth,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code will work till the length 264 of the text...suppose I do not know the maximum length,then how to split.Please help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Aug 2009 06:12:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-for-long-text-fields/m-p/6122095#M1363918</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-28T06:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion for Long text fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-for-long-text-fields/m-p/6122096#M1363919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use FM  &lt;STRONG&gt;TR_SPLIT_TEXT&lt;/STRONG&gt; to split the text at desired length &amp;amp; it will return internal table. Then u can loop on internal table for further processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'TR_SPLIT_TEXT'
        EXPORTING
          IV_TEXT  = Text 
          IV_LEN   = 132
        IMPORTING
          ET_LINES = IT_TRTEXTS.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Aug 2009 06:20:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-for-long-text-fields/m-p/6122096#M1363919</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-28T06:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion for Long text fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-for-long-text-fields/m-p/6122097#M1363920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DATA: text type string,&lt;/P&gt;&lt;P&gt;           urtext type tdline,&lt;/P&gt;&lt;P&gt;           len type char3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;text = urtext.&lt;/P&gt;&lt;P&gt;len = strlen( text ).          "----&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt;&amp;gt; Length of the long text&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;if len &amp;gt; 132.&lt;/P&gt;&lt;P&gt;CONCATENATE l_text&lt;EM&gt;0(132) l_text&lt;/EM&gt;132(132)  into tdline seperated by NEWLINE.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then above code works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: AMIT KUMAR on Aug 28, 2009 8:24 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Aug 2009 06:24:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-for-long-text-fields/m-p/6122097#M1363920</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-28T06:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion for Long text fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-for-long-text-fields/m-p/6122098#M1363921</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 can also use this Function Module: RKD_WORD_WRAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Swarna Munukoti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Aug 2009 06:43:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-for-long-text-fields/m-p/6122098#M1363921</guid>
      <dc:creator>former_member217544</dc:creator>
      <dc:date>2009-08-28T06:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion for Long text fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-for-long-text-fields/m-p/6122099#M1363922</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;Well check this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

DATA: NEWLINE(4) TYPE X VALUE '0D0A',
      l_text(200) type c,
      tdline type tdline,
      len type i,
      it_text type trtexts,
      wa like line of it_text,
      v_ind type i value '3'.

data: begin of it_text1 occurs 0,
      f1 type string,
      end of it_text1..

data: wa1 like it_text1.
l_text = 'aaaaaaaaaasdfaskjdfhkjasdkjdfhkjashuiwioeuroiwueroiwuei'.

CALL FUNCTION 'TR_SPLIT_TEXT'
        EXPORTING
          IV_TEXT  = l_text
          IV_LEN   = 5
        IMPORTING
          ET_LINES = IT_TEXT.

loop at it_text into wa.
move wa to it_text1-f1.
append it_text1.
endloop.

loop at it_text1.
if sy-tabix = '1'.
read table it_text1 into wa1 index 2.
concatenate it_text1-f1 wa1-f1 into tdline separated by NEWLINE.
clear wa1.
elseif not sy-tabix = '2'.
read table it_text1 into wa1 index v_ind.
concatenate tdline wa1-f1 into tdline separated by NEWLINE  .
endif.
v_ind = v_ind + 1.
endloop.
write: tdline.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change the length in 'TR_SPLIT_TEXT' as per ur requirement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Aug 2009 06:56:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-for-long-text-fields/m-p/6122099#M1363922</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-28T06:56:18Z</dc:date>
    </item>
  </channel>
</rss>

