<?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: Select MARA ordered by select-options? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-mara-ordered-by-select-options/m-p/8337064#M1638702</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;Use ascending /descing in query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from mara where matnr in s_matnr ORDER BY matnr descending&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from mara where matnr in s_matnr ORDER BY matnr asceneding&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Praphull&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: T Praphull on Dec 6, 2011 10:27 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Dec 2011 09:13:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-12-06T09:13:51Z</dc:date>
    <item>
      <title>Select MARA ordered by select-options?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-mara-ordered-by-select-options/m-p/8337059#M1638697</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;it try to get the data from mara ordered by the select-option, is this possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Normally i use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TABLES: MARA.
*
SELECT-OPTIONS:   S_MATNR FOR MARA-MATNR.
*
select * from mara where matnr in s_matnr.
  write: / mara-matnr.
endselect.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any FM, BAPI or any parameter for "ORDER BY" which i get use?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, dieter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Dec 2011 16:10:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-mara-ordered-by-select-options/m-p/8337059#M1638697</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-05T16:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: Select MARA ordered by select-options?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-mara-ordered-by-select-options/m-p/8337060#M1638698</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;change the select query like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from mara where matnr in s_matnr ORDER BY matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are not using order by clause in select query by default it takes sorted values from table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Priyanka&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2011 03:51:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-mara-ordered-by-select-options/m-p/8337060#M1638698</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-06T03:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Select MARA ordered by select-options?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-mara-ordered-by-select-options/m-p/8337061#M1638699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Deiter,&lt;/P&gt;&lt;P&gt;your question is not very clear. what do you mean by order by select option?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2011 05:25:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-mara-ordered-by-select-options/m-p/8337061#M1638699</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-06T05:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: Select MARA ordered by select-options?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-mara-ordered-by-select-options/m-p/8337062#M1638700</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;thanks for your answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What i mean is this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In selection screen i insert this value: 3, 2, 4, 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the output is 1, 2, 3, 4, but i will get this: 3, 2, 4, 1 like my selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Dieter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2011 08:07:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-mara-ordered-by-select-options/m-p/8337062#M1638700</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-06T08:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: Select MARA ordered by select-options?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-mara-ordered-by-select-options/m-p/8337063#M1638701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not possible through select query - Read SAP help. Try to do it in the coding if required.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2011 08:13:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-mara-ordered-by-select-options/m-p/8337063#M1638701</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2011-12-06T08:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: Select MARA ordered by select-options?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-mara-ordered-by-select-options/m-p/8337064#M1638702</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;Use ascending /descing in query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from mara where matnr in s_matnr ORDER BY matnr descending&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from mara where matnr in s_matnr ORDER BY matnr asceneding&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Praphull&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: T Praphull on Dec 6, 2011 10:27 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2011 09:13:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-mara-ordered-by-select-options/m-p/8337064#M1638702</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-06T09:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: Select MARA ordered by select-options?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-mara-ordered-by-select-options/m-p/8337065#M1638703</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;you can use asc or desc :-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select &amp;lt;field &amp;gt; from mara order by &amp;lt;field&amp;gt; asc/desc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;by default it is asc thats why u were gertting 1 2 3 4 like that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards ,&lt;/P&gt;&lt;P&gt;somesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2011 09:30:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-mara-ordered-by-select-options/m-p/8337065#M1638703</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-06T09:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: Select MARA ordered by select-options?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-mara-ordered-by-select-options/m-p/8337066#M1638704</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;Not possible.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use in your coding section .. &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&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2011 09:43:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-mara-ordered-by-select-options/m-p/8337066#M1638704</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-06T09:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: Select MARA ordered by select-options?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-mara-ordered-by-select-options/m-p/8337067#M1638705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It would be pretty difficult to do even with coding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What do you do if the user has entered patterns, or exclusions or NEs?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2011 14:42:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-mara-ordered-by-select-options/m-p/8337067#M1638705</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-06T14:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: Select MARA ordered by select-options?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-mara-ordered-by-select-options/m-p/8337068#M1638706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just for the fun&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TABLES: mara.
* data def
DATA: t1_mara TYPE TABLE OF mara WITH HEADER LINE,
      t2_mara TYPE TABLE OF mara WITH HEADER LINE,
      s2_matnr TYPE RANGE OF mara-matnr.
* selection screen
SELECT-OPTIONS so_matnr FOR mara-matnr.

START-OF-SELECTION.
* load wholde data in temp itab
  SELECT * INTO TABLE t1_mara FROM mara
    WHERE matnr IN so_matnr
    ORDER BY matnr.
* now final itab
  REFRESH t2_mara.
* for every Include select option, process its own records
  LOOP AT so_matnr WHERE sign = 'I'.
    REFRESH s2_matnr.
    APPEND so_matnr TO s2_matnr.
    LOOP AT t1_mara WHERE matnr IN s2_matnr.
      APPEND t1_mara TO t2_mara.
      DELETE t1_mara.
    ENDLOOP.
  ENDLOOP.
* If there is no "I" records,
  IF t1_mara[] IS NOT INITIAL.
    APPEND LINES OF t1_mara TO t2_mara.
  ENDIF.
* free memory
  REFRESH t1_mara. " FREE
* Proof of concept
  LOOP AT t2_mara.
    WRITE: / t2_mara-matnr.
  ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raymond&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2011 15:12:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-mara-ordered-by-select-options/m-p/8337068#M1638706</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2011-12-06T15:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: Select MARA ordered by select-options?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-mara-ordered-by-select-options/m-p/8337069#M1638707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And what do you do if there are overlapping ranges:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1-10&lt;/P&gt;&lt;P&gt;5-20&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2011 15:18:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-mara-ordered-by-select-options/m-p/8337069#M1638707</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-06T15:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: Select MARA ordered by select-options?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-mara-ordered-by-select-options/m-p/8337070#M1638708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First selection will win, if you accept duplicates, just remove the  "DELETE t1_mara."&lt;/P&gt;&lt;P&gt;(only for 5-20 then 1-10, else no problem)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raymond&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2011 15:20:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-mara-ordered-by-select-options/m-p/8337070#M1638708</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2011-12-06T15:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: Select MARA ordered by select-options?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-mara-ordered-by-select-options/m-p/8337071#M1638709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, I mean that the requirements are contradictory. Do the entries 5-10 come after 1-4 because they are in the first select-options or after 1-10 because they are in the second.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2011 15:29:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-mara-ordered-by-select-options/m-p/8337071#M1638709</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-06T15:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: Select MARA ordered by select-options?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-mara-ordered-by-select-options/m-p/8337072#M1638710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;- If you keep the delete, they come after 1-4 cause they are in the first range and will only appear once&lt;/P&gt;&lt;P&gt;- If you remove the delete they will come twice &lt;/P&gt;&lt;P&gt;The request should be completed for "duplicated selections", are they to be displayed once or as many times they were selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But honestly, no user ever dared to make such a request (am I too harsh?) &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raymond&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2011 15:34:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-mara-ordered-by-select-options/m-p/8337072#M1638710</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2011-12-06T15:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: Select MARA ordered by select-options?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-mara-ordered-by-select-options/m-p/8337073#M1638711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But honestly, no user ever dared to make such a request (am I too harsh?) &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;No, but the first thing a developer has to do after receiving new specs is to question them and make sure that the user understands exactly what they are asking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only start coding after this is done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2011 15:45:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-mara-ordered-by-select-options/m-p/8337073#M1638711</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-06T15:45:07Z</dc:date>
    </item>
  </channel>
</rss>

