<?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 Read the data from READ_TEXT FM into single string. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-the-data-from-read-text-fm-into-single-string/m-p/5644112#M1284447</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Friends,&lt;/P&gt;&lt;P&gt;I am having a Internal table with field text length 200 CH,&lt;/P&gt;&lt;P&gt;And I am looping this itab to get the long text with using READ_TEXT FM, Now I am having the 5 rows of Descr in another itab2 which we got from this FM.&lt;/P&gt;&lt;P&gt;Now I want to modify the looping Itab with this text in single line.&lt;/P&gt;&lt;P&gt;Exp : data from read_text FM.&lt;/P&gt;&lt;P&gt;Itab2 first 40 Chars ( First row )  =  some text 1.&lt;/P&gt;&lt;P&gt;Itab2 first 40 Chars ( Second row )  =  some text 2.&lt;/P&gt;&lt;P&gt;Itab2 first 40 Chars ( third row )  =  some text 3.&lt;/P&gt;&lt;P&gt;Itab2 first 40 Chars ( fourth row )  =  some text 4.&lt;/P&gt;&lt;P&gt;Itab2 first 40 Chars ( Fifth row )  =  some text 5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This data should go into my main Itab which is I am looping like:&lt;/P&gt;&lt;P&gt;Itab-text = some text 1                    some text 2                   some text 3                 some text 4                                   some text 5.&lt;/P&gt;&lt;P&gt;Itab-text is 200 Chrs length field and first 40 chars is Itab2 First row  and second 40 Chars Itab2 second row  ....... like the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to do this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sridhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 May 2009 06:59:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-13T06:59:42Z</dc:date>
    <item>
      <title>Read the data from READ_TEXT FM into single string.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-the-data-from-read-text-fm-into-single-string/m-p/5644112#M1284447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Friends,&lt;/P&gt;&lt;P&gt;I am having a Internal table with field text length 200 CH,&lt;/P&gt;&lt;P&gt;And I am looping this itab to get the long text with using READ_TEXT FM, Now I am having the 5 rows of Descr in another itab2 which we got from this FM.&lt;/P&gt;&lt;P&gt;Now I want to modify the looping Itab with this text in single line.&lt;/P&gt;&lt;P&gt;Exp : data from read_text FM.&lt;/P&gt;&lt;P&gt;Itab2 first 40 Chars ( First row )  =  some text 1.&lt;/P&gt;&lt;P&gt;Itab2 first 40 Chars ( Second row )  =  some text 2.&lt;/P&gt;&lt;P&gt;Itab2 first 40 Chars ( third row )  =  some text 3.&lt;/P&gt;&lt;P&gt;Itab2 first 40 Chars ( fourth row )  =  some text 4.&lt;/P&gt;&lt;P&gt;Itab2 first 40 Chars ( Fifth row )  =  some text 5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This data should go into my main Itab which is I am looping like:&lt;/P&gt;&lt;P&gt;Itab-text = some text 1                    some text 2                   some text 3                 some text 4                                   some text 5.&lt;/P&gt;&lt;P&gt;Itab-text is 200 Chrs length field and first 40 chars is Itab2 First row  and second 40 Chars Itab2 second row  ....... like the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to do this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sridhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 06:59:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-the-data-from-read-text-fm-into-single-string/m-p/5644112#M1284447</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-13T06:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: Read the data from READ_TEXT FM into single string.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-the-data-from-read-text-fm-into-single-string/m-p/5644113#M1284448</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;u can use offset...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab-text+0(40) = text1.&lt;/P&gt;&lt;P&gt;itab-text+41(80) = text2.&lt;/P&gt;&lt;P&gt;itab-text+81(120) = text3.&lt;/P&gt;&lt;P&gt;itab-text+121(160) = text4.&lt;/P&gt;&lt;P&gt;itab-text+161(200) = text5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 07:05:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-the-data-from-read-text-fm-into-single-string/m-p/5644113#M1284448</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-13T07:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: Read the data from READ_TEXT FM into single string.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-the-data-from-read-text-fm-into-single-string/m-p/5644114#M1284449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hai , reddy&lt;/P&gt;&lt;P&gt;u can concatenate the rows in to a single line&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;afzal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 07:13:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-the-data-from-read-text-fm-into-single-string/m-p/5644114#M1284449</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-13T07:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: Read the data from READ_TEXT FM into single string.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-the-data-from-read-text-fm-into-single-string/m-p/5644115#M1284450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Sridhar,&lt;/P&gt;&lt;P&gt;Follow this example of READ_TEXT functions reading tables PBIM - Independent requirements for material.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT ZTEXT .

TABLES: PBIM.

* stxh, stxl, stxb - trans tables for text
* ttxit - text on text-ids
* ttxot - Short texts on text objects
* Transaction MD63
SELECT-OPTIONS: S_MATNR FOR PBIM-MATNR,
                S_WERKS FOR PBIM-WERKS.

DATA: BEGIN OF HTEXT.
        INCLUDE STRUCTURE THEAD.
DATA: END OF HTEXT.

DATA: BEGIN OF LTEXT OCCURS 50.
        INCLUDE STRUCTURE TLINE.
DATA: END OF LTEXT.

DATA: BEGIN OF DTEXT OCCURS 50.
DATA:   MATNR LIKE PBIM-MATNR.
        INCLUDE STRUCTURE TLINE.
DATA: END OF DTEXT.

DATA: TNAME LIKE THEAD-TDNAME.

SELECT * FROM PBIM WHERE WERKS IN S_WERKS.
  MOVE PBIM-BDZEI TO TNAME.
  CALL FUNCTION 'READ_TEXT'
       EXPORTING
*           CLIENT                  = SY-MANDT
          ID                      = 'PB'
          LANGUAGE                = 'E'
          NAME                    = TNAME
          OBJECT                  = 'PBPT'
*         ARCHIVE_HANDLE          = 0
     IMPORTING
          HEADER                  = HTEXT
     TABLES
          LINES                   = LTEXT
     EXCEPTIONS
          ID                      = 1
          LANGUAGE                = 2
          NAME                    = 3
          NOT_FOUND               = 4
          OBJECT                  = 5
          REFERENCE_CHECK         = 6
          WRONG_ACCESS_TO_ARCHIVE = 7
          OTHERS                  = 8.
  LOOP AT LTEXT.
    IF LTEXT-TDLINE NE ''.
      MOVE LTEXT-TDLINE TO DTEXT-TDLINE.
      MOVE PBIM-MATNR TO DTEXT-MATNR.
      APPEND DTEXT.
    ENDIF.
  ENDLOOP.
ENDSELECT.
LOOP AT DTEXT.
  WRITE:/ DTEXT-MATNR, DTEXT-TDLINE.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If it is smartform or script you can include the text object directly with out using READ_TEXT FM.&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 07:15:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-the-data-from-read-text-fm-into-single-string/m-p/5644115#M1284450</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-13T07:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: Read the data from READ_TEXT FM into single string.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-the-data-from-read-text-fm-into-single-string/m-p/5644116#M1284451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;U can do like this.&lt;/P&gt;&lt;P&gt;take a new variable or free itab-text.&lt;/P&gt;&lt;P&gt;Loop at Itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate  itab-text itab2-text into itab-text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So that every time u loop text will be appended to itab text and finally u will get as u wanted to&lt;/P&gt;&lt;P&gt;itab-text = sometext1sometext2.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;V S PhaniRam G.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 07:16:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-the-data-from-read-text-fm-into-single-string/m-p/5644116#M1284451</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-13T07:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: Read the data from READ_TEXT FM into single string.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-the-data-from-read-text-fm-into-single-string/m-p/5644117#M1284452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.. i can do this by using offset and concatination like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and for modifing an internal table u have to read that internal table instead if looping.&lt;/P&gt;&lt;P&gt; so create one temporary internal table (TEMP) of type ITAB. then write code like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at ITAB.&lt;/P&gt;&lt;P&gt; TEMP-field1 = ITAB-field1.&lt;/P&gt;&lt;P&gt; .&lt;/P&gt;&lt;P&gt; .&lt;/P&gt;&lt;P&gt; .&lt;/P&gt;&lt;P&gt; concatinate text1 text2 text3 text4 text5&lt;/P&gt;&lt;P&gt;                  into TEMP-text.&lt;/P&gt;&lt;P&gt; append TEMP.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;clear ITAB.&lt;/P&gt;&lt;P&gt;free ITAB.&lt;/P&gt;&lt;P&gt;refresh ITAB.&lt;/P&gt;&lt;P&gt;ITAB[] = TEMP[].&lt;/P&gt;&lt;P&gt;clear TEMP.&lt;/P&gt;&lt;P&gt;free TEMP.&lt;/P&gt;&lt;P&gt;refresh TEMP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;KP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 07:17:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-the-data-from-read-text-fm-into-single-string/m-p/5644117#M1284452</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-13T07:17:34Z</dc:date>
    </item>
  </channel>
</rss>

