<?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: Data from selection into table in FM in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-from-selection-into-table-in-fm/m-p/4287753#M1022805</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the below code, assuming only two prices will be there for a product:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT t_select.&lt;/P&gt;&lt;P&gt;AT new of prod_name.&lt;/P&gt;&lt;P&gt;clear lw_count.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;fill all other fields&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;if lw_count eq 1.&lt;/P&gt;&lt;P&gt;t_final-price1 = t_select-price.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;t_final-price2 = t_select-price.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;lw_count = lw_count + 1.&lt;/P&gt;&lt;P&gt;AT END OF prod_name.&lt;/P&gt;&lt;P&gt;Append t_final.&lt;/P&gt;&lt;P&gt;ENDAT.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: kiran Bobbala on Aug 5, 2008 12:53 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Aug 2008 10:53:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-08-05T10:53:46Z</dc:date>
    <item>
      <title>Data from selection into table in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-from-selection-into-table-in-fm/m-p/4287752#M1022804</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;I have a selection that retrieves the data like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Product     Prod.Name    Product Price&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;101           A                  100&lt;/P&gt;&lt;P&gt;101           A                  125&lt;/P&gt;&lt;P&gt;202           B                  200&lt;/P&gt;&lt;P&gt;202           B                  250&lt;/P&gt;&lt;P&gt;303           C                  300&lt;/P&gt;&lt;P&gt;303           C                  350&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The structure that are to receive the data needs to hold it like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Product    Prod.Name    Prod.Price1   Prod.Price2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;101          A                  100               125&lt;/P&gt;&lt;P&gt;202          B                  200               250&lt;/P&gt;&lt;P&gt;303          C                  300               350&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can the selected data be written to the structure within my FM so it is in the format with one line per product ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Aug 2008 10:24:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-from-selection-into-table-in-fm/m-p/4287752#M1022804</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-05T10:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: Data from selection into table in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-from-selection-into-table-in-fm/m-p/4287753#M1022805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the below code, assuming only two prices will be there for a product:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT t_select.&lt;/P&gt;&lt;P&gt;AT new of prod_name.&lt;/P&gt;&lt;P&gt;clear lw_count.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;fill all other fields&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;if lw_count eq 1.&lt;/P&gt;&lt;P&gt;t_final-price1 = t_select-price.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;t_final-price2 = t_select-price.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;lw_count = lw_count + 1.&lt;/P&gt;&lt;P&gt;AT END OF prod_name.&lt;/P&gt;&lt;P&gt;Append t_final.&lt;/P&gt;&lt;P&gt;ENDAT.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: kiran Bobbala on Aug 5, 2008 12:53 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Aug 2008 10:53:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-from-selection-into-table-in-fm/m-p/4287753#M1022805</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-05T10:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: Data from selection into table in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-from-selection-into-table-in-fm/m-p/4287754#M1022806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi peter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;create another internal table itab2. and use the following logic:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1.&lt;/P&gt;&lt;P&gt;at end of field1.&lt;/P&gt;&lt;P&gt;itab2-field1 = ita1-field1.&lt;/P&gt;&lt;P&gt;itab2-field2 = ita1-field2.&lt;/P&gt;&lt;P&gt;itab2-field3 = ita1-field3.&lt;/P&gt;&lt;P&gt;append itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Aug 2008 11:01:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-from-selection-into-table-in-fm/m-p/4287754#M1022806</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-05T11:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: Data from selection into table in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-from-selection-into-table-in-fm/m-p/4287755#M1022807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter .,&lt;/P&gt;&lt;P&gt; I think the price variation depends on Some pricing condition ( May be time Period ) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; if so , it may require to put the oldest price in Price1 and the latest in Price2 .&lt;/P&gt;&lt;P&gt;  if this is the case  then you can achive it .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Select Prod Prod.name Price  (pricing conditon) &lt;/P&gt;&lt;P&gt;      into itab .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itab by prod  (pricing Conditon) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab  .&lt;/P&gt;&lt;P&gt;wa_final-prod = itab-prod .&lt;/P&gt;&lt;P&gt;wa_final-prod.name = itab-prod.name  .&lt;/P&gt;&lt;P&gt;if wa_final-pric1 is initial .&lt;/P&gt;&lt;P&gt;wa_final-Price1      = itab-price .&lt;/P&gt;&lt;P&gt;else .&lt;/P&gt;&lt;P&gt;wa_final-Price2      = itab-price .&lt;/P&gt;&lt;P&gt;append wa_final to it_final .&lt;/P&gt;&lt;P&gt;clear wa_final .&lt;/P&gt;&lt;P&gt;endif .&lt;/P&gt;&lt;P&gt;endloop .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if it is not sure that for each prod there would be  2 prices . we can use at end of prod event .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt; Sreenivas Reddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Aug 2008 11:03:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-from-selection-into-table-in-fm/m-p/4287755#M1022807</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-05T11:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: Data from selection into table in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-from-selection-into-table-in-fm/m-p/4287756#M1022808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter .,&lt;/P&gt;&lt;P&gt; I think the price variation depends on Some pricing condition ( May be time Period ) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; if so , it may require to put the oldest price in Price1 and the latest in Price2 .&lt;/P&gt;&lt;P&gt;  if this is the case  then you can achive it .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Select Prod Prod.name Price  (pricing conditon) &lt;/P&gt;&lt;P&gt;      into itab .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort itab by prod  (pricing Conditon) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab  .&lt;/P&gt;&lt;P&gt;wa_final-prod = itab-prod .&lt;/P&gt;&lt;P&gt;wa_final-prod.name = itab-prod.name  .&lt;/P&gt;&lt;P&gt;if wa_final-pric1 is initial .&lt;/P&gt;&lt;P&gt;wa_final-Price1      = itab-price .&lt;/P&gt;&lt;P&gt;else .&lt;/P&gt;&lt;P&gt;wa_final-Price2      = itab-price .&lt;/P&gt;&lt;P&gt;append wa_final to it_final .&lt;/P&gt;&lt;P&gt;clear wa_final .&lt;/P&gt;&lt;P&gt;endif .&lt;/P&gt;&lt;P&gt;endloop .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if it is not sure that for each prod there would be  2 prices . we can use at end of prod event .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt; Sreenivas Reddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Aug 2008 11:04:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-from-selection-into-table-in-fm/m-p/4287756#M1022808</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-05T11:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: Data from selection into table in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-from-selection-into-table-in-fm/m-p/4287757#M1022809</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;Check the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF LINE,&lt;/P&gt;&lt;P&gt;COL1(10) TYPE N,&lt;/P&gt;&lt;P&gt;COL2(10) TYPE C,&lt;/P&gt;&lt;P&gt;END OF LINE.&lt;/P&gt;&lt;P&gt;DATA ITAB LIKE STANDARD TABLE OF LINE&lt;/P&gt;&lt;P&gt;WITH NON-UNIQUE KEY COL2.&lt;/P&gt;&lt;P&gt;LINE-COL1 = 4500000327.&lt;/P&gt;&lt;P&gt;LINE-COL2 = '5000000539'.&lt;/P&gt;&lt;P&gt;APPEND LINE TO ITAB.&lt;/P&gt;&lt;P&gt;LINE-COL1 = 4500000327. LINE-COL2 = '5000000542'.  APPEND LINE TO ITAB.&lt;/P&gt;&lt;P&gt;LINE-COL1 = 4500000327. LINE-COL2 = '5000000543'.  APPEND LINE TO ITAB.&lt;/P&gt;&lt;P&gt;LINE-COL1 = 4500000329. LINE-COL2 = '5000000554'.  APPEND LINE TO ITAB.&lt;/P&gt;&lt;P&gt;LINE-COL1 = 4500000329. LINE-COL2 = '5000000554'.  APPEND LINE TO ITAB.&lt;/P&gt;&lt;P&gt;LINE-COL1 = 4500000303. LINE-COL2 = '5000000550'.  APPEND LINE TO ITAB.&lt;/P&gt;&lt;P&gt;LINE-COL1 = 4500000303. LINE-COL2 = '5000000551'.  APPEND LINE TO ITAB.&lt;/P&gt;&lt;P&gt;LINE-COL1 = 4500000334. LINE-COL2 = '5000000556'.  APPEND LINE TO ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM LIST.&lt;/P&gt;&lt;P&gt;FORM LIST.&lt;/P&gt;&lt;P&gt;data: cl like line-col1.&lt;/P&gt;&lt;P&gt;SKIP TO LINE 3.&lt;/P&gt;&lt;P&gt;LOOP AT ITAB INTO LINE.&lt;/P&gt;&lt;P&gt;if cl NE line-col1.&lt;/P&gt;&lt;P&gt;write : / line-col1.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;write : ''.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;write : line-col2.&lt;/P&gt;&lt;P&gt;cl = line-col1.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bhaskar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Bhaskar Chikine on Aug 5, 2008 4:41 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Aug 2008 11:10:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-from-selection-into-table-in-fm/m-p/4287757#M1022809</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-05T11:10:07Z</dc:date>
    </item>
  </channel>
</rss>

