<?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 How to convert table type element to String in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-type-element-to-string/m-p/7398038#M1546454</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a requirement where i have to convert table type element to String and then update it in the workflow container as workflow container can take type string or character of 255 or integer, ect&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do i convert Table type element to Char of 255? the data in the table is always a sentence or just a string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lavanya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Oct 2010 13:30:50 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-10-18T13:30:50Z</dc:date>
    <item>
      <title>How to convert table type element to String</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-type-element-to-string/m-p/7398038#M1546454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a requirement where i have to convert table type element to String and then update it in the workflow container as workflow container can take type string or character of 255 or integer, ect&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do i convert Table type element to Char of 255? the data in the table is always a sentence or just a string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lavanya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Oct 2010 13:30:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-type-element-to-string/m-p/7398038#M1546454</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-18T13:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert table type element to String</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-type-element-to-string/m-p/7398039#M1546455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A simple MOVE or CONCATENATE operation will work from the source to the target...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Oct 2010 14:25:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-type-element-to-string/m-p/7398039#M1546455</guid>
      <dc:creator>brad_bohn</dc:creator>
      <dc:date>2010-10-18T14:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert table type element to String</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-type-element-to-string/m-p/7398040#M1546456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It throws an error saying element can not be converted to a table type element.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here i have my data in Ptex type tablet.&lt;/P&gt;&lt;P&gt;I have Ptext1(225) type C.&lt;/P&gt;&lt;P&gt;I am trying to move from ptext to Ptext1, it says " The type of "PTEXT" cannot be converted to the type of "PTEXT1".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lavanya.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Oct 2010 15:00:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-type-element-to-string/m-p/7398040#M1546456</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-18T15:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert table type element to String</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-type-element-to-string/m-p/7398041#M1546457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't know what type 'tablet' is - what type is your PTEXT field?  Give more info and you'll get a better answer &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Oct 2010 15:08:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-type-element-to-string/m-p/7398041#M1546457</guid>
      <dc:creator>brad_bohn</dc:creator>
      <dc:date>2010-10-18T15:08:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert table type element to String</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-type-element-to-string/m-p/7398042#M1546458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DATA: lv_Begda1 TYPE BEGDA,&lt;/P&gt;&lt;P&gt;      lv_ENDDA1 TYPE ENDDA,&lt;/P&gt;&lt;P&gt;       PTEXT TYPE RP50M-TEXT1 OCCURS 0,&lt;/P&gt;&lt;P&gt;      TX-KEY LIKE PSKEY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if lv_tmart = 'J2'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT SINGLE&lt;/P&gt;&lt;P&gt;   Begda Endda from PA0019&lt;/P&gt;&lt;P&gt;    INTO (lv_Begda1 , lv_ENDDA1)&lt;/P&gt;&lt;P&gt;    where  pernr = lv_pernr AND tmart = 'J2' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; TX-KEY-PERNR  = lv_pernr.&lt;/P&gt;&lt;P&gt; TX-KEY-INFTY  = '0019'.&lt;/P&gt;&lt;P&gt; TX-KEY-SUBTY  = 'J2'.&lt;/P&gt;&lt;P&gt; TX-KEY-ENDDA  =  lv_Begda1.&lt;/P&gt;&lt;P&gt; TX-KEY-BEGDA  =  lv_ENDDA1.&lt;/P&gt;&lt;P&gt; TX-KEY-SEQNR  =  '000'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   IMPORT ptext FROM DATABASE pcl1(tx) ID tx-key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     DATA: Ptext1(225) TYPE C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Ptext1 = ptext .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Move 'Abs_Reason' TO itab_wf-element.&lt;/P&gt;&lt;P&gt;MOVE  ptext1 to itab_wf-Value.&lt;/P&gt;&lt;P&gt;APPEND itab_wf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Move 'Abs_Begda' TO itab_wf-element.&lt;/P&gt;&lt;P&gt;MOVE  lv_Begda1 to itab_wf-Value.&lt;/P&gt;&lt;P&gt;APPEND itab_wf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Move 'Abs_Endda' TO itab_wf-element.&lt;/P&gt;&lt;P&gt;MOVE  lv_ENDDA1 to itab_wf-Value.&lt;/P&gt;&lt;P&gt;APPEND itab_wf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my code. I am importing ptext from a cluster table and then move it to  Ptext1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Oct 2010 04:04:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-type-element-to-string/m-p/7398042#M1546458</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-19T04:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert table type element to String</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-type-element-to-string/m-p/7398043#M1546459</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 use the class CL_ABAP_CONTAINER_UTILITIES --&amp;gt;method FILL_CONTAINER_C to convert a structure to string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The variables ptext and ptext1 are of different types. One is a structure/ internal table and the other is a CHAR.&lt;/P&gt;&lt;P&gt;So instead of using " ptext1 = ptext ", you must loop at each record in the internal table and concatenate all the fields in the record into ptext1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this solves.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Teja.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Oct 2010 09:31:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-type-element-to-string/m-p/7398043#M1546459</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-22T09:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert table type element to String</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-type-element-to-string/m-p/7398044#M1546460</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;Is it something like this that you are looking for&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  convert_table_to_string
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
FORM convert_table_to_string .
  DATA: str TYPE string,
        len TYPE i,
        tot_len TYPE i.

TYPES : BEGIN OF ty_text ,
        tdformat TYPE tline-tdformat,
        tdline TYPE tline-tdline,
        END OF ty_text.

data: g_t_text TYPE STANDARD TABLE OF ty_text WITH HEADER LINE,

 FIELD-SYMBOLS &amp;lt;fs1&amp;gt; TYPE ANY.


  IF g_t_ekpo-ebeln IS NOT INITIAL.
    CONCATENATE g_t_ekpo-ebeln  g_t_ekpo-ebelp  INTO g_ebeln. "CRQ94538-Capture text
    SHIFT g_ebeln LEFT DELETING LEADING space.
    PERFORM read_text USING g_ebeln g_t_text[].

    IF g_t_text[] IS NOT INITIAL.
      CLEAR: len,
             tot_len,
              str.
      DO.
        ASSIGN COMPONENT sy-index OF STRUCTURE g_t_text TO &amp;lt;fs1&amp;gt;.
        IF sy-subrc NE 0.
          EXIT.
        ENDIF.
        DESCRIBE FIELD &amp;lt;fs1&amp;gt; LENGTH len IN CHARACTER MODE.
        ADD len TO tot_len.
      ENDDO.
      CALL FUNCTION 'CONVERT_TABLE_TO_STRING'
        EXPORTING
          i_tabline_length = tot_len
        IMPORTING
          e_string         = str
        TABLES
          it_table         = g_t_text[].
      IF sy-subrc = 0.
        g_t_ekpo-text = str.

      ENDIF.
    ELSE.
      CLEAR: g_t_ekpo-text,
             tot_len,
             len,
             str.     .
    ENDIF.
  ENDIF.
ENDFORM.                    " convert_table_to_string

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Oct 2010 09:42:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-table-type-element-to-string/m-p/7398044#M1546460</guid>
      <dc:creator>kiran_k8</dc:creator>
      <dc:date>2010-10-22T09:42:42Z</dc:date>
    </item>
  </channel>
</rss>

