<?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 logic needed in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-needed/m-p/3725884#M896763</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an internal table with the following structure and data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fld1   fld2   fld3   fld4     fld5&lt;/P&gt;&lt;P&gt;XY     123  001   line1    tag1&lt;/P&gt;&lt;P&gt;XY     123  002   line2    tag2&lt;/P&gt;&lt;P&gt;XY     234  001   line3    tagx&lt;/P&gt;&lt;P&gt;XY     345  001   linex    tagy&lt;/P&gt;&lt;P&gt;XY     345  002   liney    tagx&lt;/P&gt;&lt;P&gt;XY     345  003   linez    tagz&lt;/P&gt;&lt;P&gt;YX     111  001   abc      def&lt;/P&gt;&lt;P&gt;YX     111  002   abd      yyy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this table, the first two fields r used to create header and the last two as items..in a function module. I need to call a function module and pass header (structure) and items (table) depending upon the third field..&lt;/P&gt;&lt;P&gt;for example, in above itab..&lt;/P&gt;&lt;P&gt;XY and 123 form one header and it has two items 001 and 002 with different fld4 and fld5 values..for this header and item combination i want to call a function module..&lt;/P&gt;&lt;P&gt;similarly, for another group as loop moves further..&lt;/P&gt;&lt;P&gt;any logic??&lt;/P&gt;&lt;P&gt;pls&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Apr 2008 07:20:50 GMT</pubDate>
    <dc:creator>abdulazeez12</dc:creator>
    <dc:date>2008-04-24T07:20:50Z</dc:date>
    <item>
      <title>logic needed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-needed/m-p/3725884#M896763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an internal table with the following structure and data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fld1   fld2   fld3   fld4     fld5&lt;/P&gt;&lt;P&gt;XY     123  001   line1    tag1&lt;/P&gt;&lt;P&gt;XY     123  002   line2    tag2&lt;/P&gt;&lt;P&gt;XY     234  001   line3    tagx&lt;/P&gt;&lt;P&gt;XY     345  001   linex    tagy&lt;/P&gt;&lt;P&gt;XY     345  002   liney    tagx&lt;/P&gt;&lt;P&gt;XY     345  003   linez    tagz&lt;/P&gt;&lt;P&gt;YX     111  001   abc      def&lt;/P&gt;&lt;P&gt;YX     111  002   abd      yyy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this table, the first two fields r used to create header and the last two as items..in a function module. I need to call a function module and pass header (structure) and items (table) depending upon the third field..&lt;/P&gt;&lt;P&gt;for example, in above itab..&lt;/P&gt;&lt;P&gt;XY and 123 form one header and it has two items 001 and 002 with different fld4 and fld5 values..for this header and item combination i want to call a function module..&lt;/P&gt;&lt;P&gt;similarly, for another group as loop moves further..&lt;/P&gt;&lt;P&gt;any logic??&lt;/P&gt;&lt;P&gt;pls&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2008 07:20:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-needed/m-p/3725884#M896763</guid>
      <dc:creator>abdulazeez12</dc:creator>
      <dc:date>2008-04-24T07:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: logic needed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-needed/m-p/3725885#M896764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here you can use ON CHANGE OF command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;on change of fld 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If sy-tabix NE 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lt_header-fld1  =  lt_prev_itab-fld1.&lt;/P&gt;&lt;P&gt;lt_header-fld2 = lt_prev_itab-fld2.&lt;/P&gt;&lt;P&gt;append lt_header.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function &amp;lt;fun_name&amp;gt;&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;  lt_header&lt;/P&gt;&lt;P&gt;  lt_list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;refresh : lt_header ,lt_list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endon.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lt_list-fld1 = itab-fld3.&lt;/P&gt;&lt;P&gt;lt_list-fld2 = itab-fld4.&lt;/P&gt;&lt;P&gt;append lt_list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lt_prev_itab = itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;To call the F/M for the last grp.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;if not lt_header[] is initial.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function &amp;lt;fun_name&amp;gt;&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;  lt_header&lt;/P&gt;&lt;P&gt;  lt_list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THanks,&lt;/P&gt;&lt;P&gt;Pranjal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Pranjal Gadkari on Apr 24, 2008 9:28 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2008 07:27:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-needed/m-p/3725885#M896764</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-24T07:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: logic needed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-needed/m-p/3725886#M896765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi u can use this logic:&lt;/P&gt;&lt;P&gt;say you have str1 structure and itab1 internal table to pass to FM.&lt;/P&gt;&lt;P&gt;sort itab by field1 field2.&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;at first .&lt;/P&gt;&lt;P&gt;continue.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;at new field2.&lt;/P&gt;&lt;P&gt;call Function Module Passing str1 and itab1.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;str1-field1 = itab-field1. &lt;/P&gt;&lt;P&gt;str1-field2 = itab-field2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab1-field3 = itab-field3.&lt;/P&gt;&lt;P&gt;itab1-field4 = itab-field4.&lt;/P&gt;&lt;P&gt;itab1-field5 = itab-field5.&lt;/P&gt;&lt;P&gt;append itab1.&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;call Function Module Passing str1 and itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if useful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2008 07:32:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-needed/m-p/3725886#M896765</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-24T07:32:40Z</dc:date>
    </item>
  </channel>
</rss>

