<?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: internal table concatenation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-concatenation/m-p/8519245#M1655599</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you need to first breakdown data table into another internal table, before merging them back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for identification sake, i named the table as below:&lt;/P&gt;&lt;P&gt;- CUDC_DATA, your original table&lt;/P&gt;&lt;P&gt;- CUDC_BREAKDOWN, the breakdown data table&lt;/P&gt;&lt;P&gt;- CUDC_RESULT, result table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Concatenate the DATA for each set of CUDC from CUDC_DATA table into a string variable (e.g. tmpstring)&lt;/P&gt;&lt;P&gt;2) Process each CUDC's tmpstring into CUDC_BREAKDOWN where you should&lt;/P&gt;&lt;P&gt;     - get every single group of hhmmss:xx:xx, the delimiter should be '-'. Use SPLIT function&lt;/P&gt;&lt;P&gt;     - break the group to 2 different fields, where the 1st 4 char(HHMM) is field #1, and the remaining field #2&lt;/P&gt;&lt;P&gt;     - append the current CUDC value, field #1 and field #2 into CUDC_BREAKDOWN&lt;/P&gt;&lt;P&gt;3) Repeat the process until all CUDC's DATA has been breakdown into CUDC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, you should merge back the data back to CUDC_RESULT, from CUDC_BREAKDOWN table&lt;/P&gt;&lt;P&gt;4) For every CUDC, it would indicate a start of a new record&lt;/P&gt;&lt;P&gt;5) For each new set of field #1 encountered, concatenate the HHMM value to the data field in CUDC_RESULT&lt;/P&gt;&lt;P&gt;6) Then concatenate every field #2 to the data field in CUDC_RESULT&lt;/P&gt;&lt;P&gt;7) Do until all CUDC are completed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Jan 2012 09:38:37 GMT</pubDate>
    <dc:creator>former_member777515</dc:creator>
    <dc:date>2012-01-30T09:38:37Z</dc:date>
    <item>
      <title>internal table concatenation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-concatenation/m-p/8519237#M1655591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can I concatenate the data where CUDC = 1. Sample data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CUDC	RECORD                	DATA&lt;/P&gt;&lt;P&gt;1	              1	002232:2:1-002223:2:3-002346:2:2-002306:2:3-002314:6:8-002321:6:8-002346:6:6-002333:7:3-002433:8:3-            &lt;/P&gt;&lt;P&gt;                                002433:9:3-002413:10:10-002435:10&lt;/P&gt;&lt;P&gt;1	              2	:3-002431:19:3-002430:20:3-002431:21:3-002431:22:3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;expected result&lt;/P&gt;&lt;P&gt;1	              1	[0022]32:2:1-23:2:3-46:2:2-[0023]06:2:3-14:6:8-21:6:8-46:6:6-[0024]33:7:3-33:8:3-33:9:3-13:10:10-35:10:3-&lt;/P&gt;&lt;P&gt;                                31:19:3-30:20:3-31:21:3-31:22:3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: kapishr on Jan 26, 2012 3:22 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jan 2012 14:22:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-concatenation/m-p/8519237#M1655591</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-01-26T14:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: internal table concatenation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-concatenation/m-p/8519238#M1655592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;let itab1 and itab2 both be copies of same data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itab1 by cudc and delete adjacent duplicates comparing cudc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at itab1.

loop at itab2 where cudc = itab1-cudc.
   concatenate itab1-record itab2-record to itab1-record.
endloop.

modify itab1. or use field symbols.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;above code is psuedocode, check respective syntaxes while implementing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jan 2012 14:36:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-concatenation/m-p/8519238#M1655592</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-01-26T14:36:47Z</dc:date>
    </item>
    <item>
      <title>Re: internal table concatenation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-concatenation/m-p/8519239#M1655593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi kapishr,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you make your tables more readable?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jan 2012 14:48:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-concatenation/m-p/8519239#M1655593</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-01-26T14:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: internal table concatenation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-concatenation/m-p/8519240#M1655594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The three column of internal table are CUDC RECORD and DATA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CUDC   &lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RECORD&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data  &lt;/P&gt;&lt;P&gt;002232:2:1-002223:2:3-002346:2:2-002306:2:3-002314:6:8-002321:6:8-002346:6:6-002333:7:3-002433:8:3-002433:9:3-002413:10:10-002435:10&lt;/P&gt;&lt;P&gt;:3-002431:19:3-002430:20:3-002431:21:3-002431:22:3&lt;/P&gt;&lt;P&gt;002232:2:1-002223:2:3-002346:2:2-002306:2:3-002314:6:8-002321:6:8-002346:6:6-002333:7:3-002433:8:3-002433:9:3-002413:10:10-002435:10&lt;/P&gt;&lt;P&gt;:3-002431:19:3-002430:20:3-002431:21:3-002431:22:3:002431:19:3-000030:20:3-0000031:21:3-000031:22:3:000031:19:3-000030:20:3-000031:21:3&lt;/P&gt;&lt;P&gt;002431:19:3-002430:20:3-002431:21:3-002431:22:3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to concatenate the data based on CUDC and sort the record column accordingly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: kapishr on Jan 26, 2012 4:43 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Rob Burbank on Jan 26, 2012 11:47 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jan 2012 15:40:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-concatenation/m-p/8519240#M1655594</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-01-26T15:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: internal table concatenation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-concatenation/m-p/8519241#M1655595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming the DATA has a field length of 20, and for each CUDC. its corresponding DATA has values of maximum 20... Therefore, may I ask how should your concatenated result be like?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I simplify your internal table as such(using ~ as delimiter), correct me if I'm wrong&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CUDC(x1)&lt;SUB&gt;RECORD(x1)&lt;/SUB&gt;DATA(x6)&lt;/P&gt;&lt;P&gt;1&lt;SUB&gt;1&lt;/SUB&gt;AAAAA&lt;/P&gt;&lt;P&gt;1&lt;SUB&gt;2&lt;/SUB&gt;BBBBBB&lt;/P&gt;&lt;P&gt;2&lt;SUB&gt;1&lt;/SUB&gt;CCCCCC&lt;/P&gt;&lt;P&gt;2&lt;SUB&gt;2&lt;/SUB&gt;DDDDDD&lt;/P&gt;&lt;P&gt;3&lt;SUB&gt;1&lt;/SUB&gt;EEEEEE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using the above example, please explain how should the result be?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: bloodcool on Jan 27, 2012 11:44 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2012 03:43:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-concatenation/m-p/8519241#M1655595</guid>
      <dc:creator>former_member777515</dc:creator>
      <dc:date>2012-01-27T03:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: internal table concatenation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-concatenation/m-p/8519242#M1655596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Kapishr,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a code you can use :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data : wa_tab like line of itab, "work area of your itab.
          temp1(50) type c, "itab - your internal table that is containing above fields.
          temp2(50) type c,  "assuming data length can not be more than 50 chars.
           " 
           "
         tempn(50) type c.


Loop at itab into wa_tab.
     Case wa_tab-CUDC.
            When '1'
                      Concatenate temp1 wa_tab-DATA into temp1.
            When '2'
                       Concatenate temp2 wa_tab-DATA into temp2.
             "
             "
             "
            When 'n'
                        Concatenate tempn wa_tab-DATA into tempn.
     Endcase.
Endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After using above code you can use temp1-temp2-......tempn data wherever you want. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;Kerim.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Kerim Merih Kılıç on Jan 27, 2012 7:23 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2012 06:22:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-concatenation/m-p/8519242#M1655596</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-01-27T06:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: internal table concatenation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-concatenation/m-p/8519243#M1655597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for helping me, I am new to programming and so I m having trouble explaining..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the data that I have&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CUDC&lt;SUB&gt;RECORD&lt;/SUB&gt;DATA~LENGTH&lt;/P&gt;&lt;P&gt;1&lt;SUB&gt;1&lt;/SUB&gt;002232:2:1-002223:2:3-002246:2:2-002306:2:3-002314:6:8-002321:6:8-002346:6:6-002433:7:3-002433:8:3-002433:9:3-002413:10:10-002435:10~132&lt;/P&gt;&lt;P&gt;1&lt;SUB&gt;2&lt;/SUB&gt;:3-002431:19:3-002430:20:3-002431:21:3-002431:22:3~50&lt;/P&gt;&lt;P&gt;2&lt;SUB&gt;1&lt;/SUB&gt;002232:2:1-002223:2:3-002246:2:2-002306:2:3-002314:6:8-002321:6:8-002346:6:6-002433:7:3-002433:8:3-002433:9:3-002413:10:10-002435:10~length&lt;/P&gt;&lt;P&gt;2&lt;SUB&gt;2&lt;/SUB&gt;:3-002431:19:3-002430:20:3-002431:21:3-002431:22:3-002431:19:3-000030:20:3-0000031:21:3-000031:22:3:000031:19:3-000030:20:3-000031:21:3~length&lt;/P&gt;&lt;P&gt;3&lt;SUB&gt;1&lt;/SUB&gt;002431:19:3-002430:20:3-002431:21:3-002431:22:3~length&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Required output&lt;/P&gt;&lt;P&gt;CUDC&lt;SUB&gt;RECORD&lt;/SUB&gt;DATA~LENGTH&lt;/P&gt;&lt;P&gt;1&lt;SUB&gt;1&lt;/SUB&gt;(0022)32:2:1-23:2:3-46:2:2-(0023)06:2:3-14:6:8-21:6:8-46:6:6-(0024)33:7:3-33:8:3-33:9:3-13:10:10-35:10:3-31:19:3-30:20:3-31:21:3-31:22:3~102&lt;/P&gt;&lt;P&gt;2&lt;SUB&gt;1&lt;/SUB&gt;(0022)32:2:1-23:2:3-46:2:2-(0023)06:2:3-14:6:8-21:6:8-46:6:6-(0024)33:7:3-33:8:3-33:9:3-13:10:10-35:10:3-31:19:3-30:20:3-31:21:3-31:22:3-31:19:3-(0000)30:20:3-31:21:3-31:22:3-31:19:3-30:20:3-31:21:3~length&lt;/P&gt;&lt;P&gt;3&lt;SUB&gt;1&lt;/SUB&gt;(0024)31:19:3-30:20:3-31:21:3-21:22:3~length&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the length at end of each row is for calculating the length of the data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first six digits is for time hhmmss, &lt;/P&gt;&lt;P&gt;I need to club (hhmm)ss-ss... and so on and club the records based on CUDC as well.&lt;/P&gt;&lt;P&gt;the digits after colon(&lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt; is not to be analysed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks and regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2012 06:39:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-concatenation/m-p/8519243#M1655597</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-01-27T06:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: internal table concatenation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-concatenation/m-p/8519244#M1655598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use the code I wrote above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;temp1-temp2-temp3 contains data that you want. If you don't want to concatenate data after ':' then you can take the part before it:.(ie concatenate tempx itab-DATA+6 into tempx)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;Kerim.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2012 06:43:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-concatenation/m-p/8519244#M1655598</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-01-27T06:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: internal table concatenation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-concatenation/m-p/8519245#M1655599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you need to first breakdown data table into another internal table, before merging them back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for identification sake, i named the table as below:&lt;/P&gt;&lt;P&gt;- CUDC_DATA, your original table&lt;/P&gt;&lt;P&gt;- CUDC_BREAKDOWN, the breakdown data table&lt;/P&gt;&lt;P&gt;- CUDC_RESULT, result table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Concatenate the DATA for each set of CUDC from CUDC_DATA table into a string variable (e.g. tmpstring)&lt;/P&gt;&lt;P&gt;2) Process each CUDC's tmpstring into CUDC_BREAKDOWN where you should&lt;/P&gt;&lt;P&gt;     - get every single group of hhmmss:xx:xx, the delimiter should be '-'. Use SPLIT function&lt;/P&gt;&lt;P&gt;     - break the group to 2 different fields, where the 1st 4 char(HHMM) is field #1, and the remaining field #2&lt;/P&gt;&lt;P&gt;     - append the current CUDC value, field #1 and field #2 into CUDC_BREAKDOWN&lt;/P&gt;&lt;P&gt;3) Repeat the process until all CUDC's DATA has been breakdown into CUDC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, you should merge back the data back to CUDC_RESULT, from CUDC_BREAKDOWN table&lt;/P&gt;&lt;P&gt;4) For every CUDC, it would indicate a start of a new record&lt;/P&gt;&lt;P&gt;5) For each new set of field #1 encountered, concatenate the HHMM value to the data field in CUDC_RESULT&lt;/P&gt;&lt;P&gt;6) Then concatenate every field #2 to the data field in CUDC_RESULT&lt;/P&gt;&lt;P&gt;7) Do until all CUDC are completed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jan 2012 09:38:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-concatenation/m-p/8519245#M1655599</guid>
      <dc:creator>former_member777515</dc:creator>
      <dc:date>2012-01-30T09:38:37Z</dc:date>
    </item>
  </channel>
</rss>

