<?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 Report program in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/report-program/m-p/1767804#M331722</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider the two fields person and ssn.For a particular ssn value if exists two or more different person values,then i want to put that details as a duplicate records to the internal table.Kindly help me in making this.Thanx in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Dec 2006 07:11:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-04T07:11:42Z</dc:date>
    <item>
      <title>Report program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/report-program/m-p/1767804#M331722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider the two fields person and ssn.For a particular ssn value if exists two or more different person values,then i want to put that details as a duplicate records to the internal table.Kindly help me in making this.Thanx in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Dec 2006 07:11:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/report-program/m-p/1767804#M331722</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-04T07:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: Report program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/report-program/m-p/1767805#M331723</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;select * from PA0002 into table itab where perid   = &amp;lt;var&amp;gt;&lt;/P&gt;&lt;P&gt;                                                              begda &amp;lt;= sy-datum&lt;/P&gt;&lt;P&gt;                                                              endda &amp;gt;= sy-datum.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;this will call all values in table itab now you can get your pernr there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Dec 2006 07:15:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/report-program/m-p/1767805#M331723</guid>
      <dc:creator>amit_khare</dc:creator>
      <dc:date>2006-12-04T07:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: Report program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/report-program/m-p/1767806#M331724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Satheesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plz use the following code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lets assume you have the data in LT_DATA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Sort WA_DATA by SSN.

loop at LT_DATA into WA_DATA.
if lv_ssn equals to WA_DATA-SSN.
 lv_flag  = 1.
endif.
lv_ssn = WA_DATA-ssn.
At new ssn.
 if lv_flag = 1.
* --&amp;gt; Please place your duplicate related code here
 endif.
endat.
clear lv_flag.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Bhupal Reddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Dec 2006 07:19:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/report-program/m-p/1767806#M331724</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-04T07:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: Report program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/report-program/m-p/1767807#M331725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx for ur comments. one small correction there will be more ssn values in the table and for each entry i have to validate if there are more persons assigned an d there by i have to send the duplicate records for the single SSN value .In that case i can't assign the local variable as you all mentioned.Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Dec 2006 08:05:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/report-program/m-p/1767807#M331725</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-04T08:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: Report program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/report-program/m-p/1767808#M331726</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;find duplicates by inserting into table with unique key. Something like that:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data:
* define unstructured hashed tables to check duplicates
  lt_ssn type hashed table of ssn
   with unique key table_line,
  lt_ssn_dup  type hashed table of ssn
   with unique key table_line.

loop at itab.
  insert itab-ssn into table  lt_ssn.
  if sy-subrc &amp;lt;&amp;gt; 0.
* insert fails because ssn already exists -&amp;gt; duplicate
      insert itab-ssn into table  lt_ssn_dup.
  endif.
endloop.
* now all duplicates are in lt_ssn_dup.
loop at itab.
  read table lt_ssn_dup transporting no fields
    with key table_line = itab-ssn.
  if sy-subrc = 0.
* process duplicate ssn here...
  else.
* process unique ssn here...
  endif.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would prefer to use LOOP AT itab ASSIGNING &amp;lt;field-symbol&amp;gt; but many colleagues are just frightened by field-symbols - you must get used to the performance gain...&lt;/P&gt;&lt;P&gt;Instead of TYPE ssn use the data element linked to field ssn.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Dec 2006 08:37:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/report-program/m-p/1767808#M331726</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2006-12-04T08:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: Report program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/report-program/m-p/1767809#M331727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Li,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx for valuable information.Can i able to do the same with field symbols..I am new to this..just gimme the same example in terms of the field symbols please.Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Dec 2006 09:11:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/report-program/m-p/1767809#M331727</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-04T09:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: Report program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/report-program/m-p/1767810#M331728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Satheesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just a slight difference. Looping tables usually means a copy of the table record to the header line for each loop, using field-symbols just puts an address pointer to the actual record. Then you can access it directly. If (not here!) you modify a table, changing the field-symbols content means changing the table record - so no modify is will be used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
field-symbols:
  &amp;lt;itab&amp;gt; like itab.
loop at itab assigning &amp;lt;itab&amp;gt;.
  insert &amp;lt;itab&amp;gt;-ssn into table  lt_ssn.
  if sy-subrc &amp;lt;&amp;gt; 0.
* insert fails because ssn already exists -&amp;gt; duplicate
      insert &amp;lt;itab&amp;gt;-ssn into table  lt_ssn_dup.
  endif.
endloop.
* now all duplicates are in lt_ssn_dup.
loop at itab assigning &amp;lt;itab&amp;gt;.
  read table lt_ssn_dup transporting no fields
    with key table_line = &amp;lt;itab&amp;gt;-ssn.
  if sy-subrc = 0.
* process duplicate ssn here...
  else.
* process unique ssn here...
  endif.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: If you use field-symbol looping at hashed or sorted table, you can not change the key fields - in debugger they are greyed out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have fun with field-symbols!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Li is the family name, so please Clemens or Mr. Li)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Dec 2006 13:22:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/report-program/m-p/1767810#M331728</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2006-12-04T13:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Report program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/report-program/m-p/1767811#M331729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Clemens,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       Thank you for ur valuable information.sorry for the mistake.:).I am using the internal with work area is it possible to assign the field symbol to a work area for the same example you gave me...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2006 09:44:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/report-program/m-p/1767811#M331729</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-05T09:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Report program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/report-program/m-p/1767812#M331730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Satheesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can assign the field-symbol to any data area. It does not matter if you declared your internal table with or without header line. I think you mean header line when you say work area. A work area usually is declared separately:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data:
  itab1 type table of whatever,
  itab_wa type whatever,
  itab2 type table of whatever with header line.
field-symbols:
  &amp;lt;whatever&amp;gt; type whatever.
* internal table without header line using work area
loop at itab1 into itab_wa.
  itab_wa-field1 = 'XYZ'.
  modify itab1 from itab_wa.
endloop.

* internal table with header line (implicit work area)
loop at itab2.
  itab2-field1 = 'XYZ'.
  modify itab2.
endloop.

* internal table without header line using field-symbol
loop at itab1[] assigning &amp;lt;whatever&amp;gt;.
  &amp;lt;whatever&amp;gt;-field1 = 'XYZ'.
endloop.

* internal table with header line using field-symbol
loop at itab2 assigning &amp;lt;whatever&amp;gt;.
  &amp;lt;whatever&amp;gt;-field1 = 'XYZ'.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is all the same. Internal tables with header line are not allowed in object-oriented context, i.e. declared within classes because the internal table has the same name as the header line. in non-OO-context you can distinguish between table body and headerline with the addition of square brackets [] for table body.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The field-symbols alternative is a lot faster. Using explicit (work area) or implicit header line means to copy all fields from body to header line/work area for each loop and copy all fields from header line/work area back to the boy using the modify statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using the field symbols with LOOP...ASSIGNING means to have direct access to the actual record in table body.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2006 10:19:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/report-program/m-p/1767812#M331730</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2006-12-05T10:19:47Z</dc:date>
    </item>
  </channel>
</rss>

