<?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 Merging rows in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/merging-rows/m-p/1733312#M319166</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts my problem is &lt;/P&gt;&lt;P&gt;II have a database table and i need read this data base table in to an internal .Here for same time period(one week time period ) and same personnal number there may exists two different reccords i.e with type of time entry : &lt;/P&gt;&lt;P&gt;a)over time or &lt;/P&gt;&lt;P&gt;b)paid time offs &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After this i need compare records in this internal table in such way that&lt;/P&gt;&lt;P&gt;Records having  Same personnal number ,same time period  but with different time entry procedure &lt;/P&gt;&lt;P&gt;i.e Over time and paid time off in my case (Diffrentiation done with this type of time entry)&lt;/P&gt;&lt;P&gt;should be diplayed in one row   with two columns for  Overtime and paid time off&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Dec 2006 19:34:20 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-07T19:34:20Z</dc:date>
    <item>
      <title>Merging rows</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/merging-rows/m-p/1733312#M319166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts my problem is &lt;/P&gt;&lt;P&gt;II have a database table and i need read this data base table in to an internal .Here for same time period(one week time period ) and same personnal number there may exists two different reccords i.e with type of time entry : &lt;/P&gt;&lt;P&gt;a)over time or &lt;/P&gt;&lt;P&gt;b)paid time offs &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After this i need compare records in this internal table in such way that&lt;/P&gt;&lt;P&gt;Records having  Same personnal number ,same time period  but with different time entry procedure &lt;/P&gt;&lt;P&gt;i.e Over time and paid time off in my case (Diffrentiation done with this type of time entry)&lt;/P&gt;&lt;P&gt;should be diplayed in one row   with two columns for  Overtime and paid time off&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 19:34:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/merging-rows/m-p/1733312#M319166</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-07T19:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: Merging rows</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/merging-rows/m-p/1733313#M319167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Prashant,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the followign logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at Itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Initialise the sum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum = sum + Time&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;on change of Personal No. &lt;/P&gt;&lt;P&gt;update ITAB2 with new record and put in teh new time there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endon.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Guru&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 20:15:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/merging-rows/m-p/1733313#M319167</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-07T20:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: Merging rows</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/merging-rows/m-p/1733314#M319168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here are the steps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: BEGIN OF WA,
        OVER_TIME type yourtype
        PAID_TIME type yourtype,
      END OF WA.

DATA: I_FINAL TABLE OF WA&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;1. Select both the records over time and paid time offs from Database table into Itab.

2. READ table itab for over time.

   if sy-subrc EQ 0.
    Assign the value to wa-OVER_TIME.
 endif.

3. READ table itab for paind time

   if sy-subrc EQ 0.
    Assign the value to wa-PAID_TIME.
 endif.

append wa to I_FINAL.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here I_FINAL will have the both over &amp;amp; Paid time in the same column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Raja T&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 20:17:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/merging-rows/m-p/1733314#M319168</guid>
      <dc:creator>raja_thangamani</dc:creator>
      <dc:date>2006-12-07T20:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: Merging rows</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/merging-rows/m-p/1733315#M319169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try something like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

REPORT ztest MESSAGE-ID 00.

DATA: BEGIN OF raw_itab OCCURS 0,
        pno  type ...,
        proc type ...,
        amt  type ...,
      end   of raw_itabr.

DATA: BEGIN OF sum_itab OCCURS 0.
        pno  type ...,
        ot   type ...,
        pto  type ...,
DATA: END   OF sum_itab.

SELECT pno proc amt
  INTO TABLE raw_itab
  WHERE...
  
loop at raw_itab.
  sum_itab-pno = raw_itab-pno.
  
  if raw_itab-proc = 'OT'.
    sum_itab-ot  = raw_itab-amt.
  elseif raw_itab-proc = 'PTO'.
    sum_itab-pto = raw_itab-amt.
  endif.
  
  collect sum_itab.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 20:31:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/merging-rows/m-p/1733315#M319169</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-07T20:31:33Z</dc:date>
    </item>
  </channel>
</rss>

