<?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: Defaulting variable in select query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/defaulting-variable-in-select-query/m-p/1739528#M321427</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Priyanka / Arun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good to see your reply and Thanks. Yes your are correct, I agree with your answer and that is the way even SAP says. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   But here I am dealing with some over million records in my internal table and for doing this in normal way i.e. like manipulating data with ITAB will taking long time. I am planning cut-down the time that is required for ITAB. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Please do reply only if any thing finds related to this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your reply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Dec 2006 16:16:25 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-19T16:16:25Z</dc:date>
    <item>
      <title>Defaulting variable in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/defaulting-variable-in-select-query/m-p/1739525#M321424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  I am having some different requirement here like, while selecting data from a table, for some column need to deafult some constant value for all lines if the actual value in the DB table has no value. There are some aggregate results like MAX( [DISTINCT] col ), MIN( [DISTINCT] col )...COUNT( * ) (or count(*)) , But there is nothing as such to fill constant value in query time it self while selecting data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Do help me if any one come across such a like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Normal code we write:&lt;/P&gt;&lt;P&gt;   SELECT carrid connid cityfrom cityto &lt;/P&gt;&lt;P&gt;       FROM spfli &lt;/P&gt;&lt;P&gt;       INTO CORRESPONDING FIELDS OF wa. &lt;/P&gt;&lt;P&gt;     WRITE: / wa-carrid, wa-connid, wa-cityfrom, wa-cityto. &lt;/P&gt;&lt;P&gt;   ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Required code need to write:&lt;/P&gt;&lt;P&gt;SELECT NVL(e.carrid,1000) connid cityfrom cityto &lt;/P&gt;&lt;P&gt;       FROM spfli &lt;/P&gt;&lt;P&gt;       INTO CORRESPONDING FIELDS OF wa. &lt;/P&gt;&lt;P&gt;  WRITE: / wa-carrid, wa-connid, wa-cityfrom, wa-cityto. &lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Mohan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Dec 2006 19:33:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/defaulting-variable-in-select-query/m-p/1739525#M321424</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-18T19:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: Defaulting variable in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/defaulting-variable-in-select-query/m-p/1739526#M321425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mohan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      I think you can select the required fields into Internal table and then assign the values needed by looping through the internal table. This will be helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think we cant assign the constant values as if so while selecting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try that once.&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, 19 Dec 2006 03:49:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/defaulting-variable-in-select-query/m-p/1739526#M321425</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-19T03:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Defaulting variable in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/defaulting-variable-in-select-query/m-p/1739527#M321426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi , &lt;/P&gt;&lt;P&gt;  I dont think you can set the default values in the select statement  ,  what you can do is once you have selected it check the value , if it is initial then set the default value to it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Dec 2006 04:15:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/defaulting-variable-in-select-query/m-p/1739527#M321426</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-19T04:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: Defaulting variable in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/defaulting-variable-in-select-query/m-p/1739528#M321427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Priyanka / Arun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good to see your reply and Thanks. Yes your are correct, I agree with your answer and that is the way even SAP says. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   But here I am dealing with some over million records in my internal table and for doing this in normal way i.e. like manipulating data with ITAB will taking long time. I am planning cut-down the time that is required for ITAB. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Please do reply only if any thing finds related to this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your reply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Dec 2006 16:16:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/defaulting-variable-in-select-query/m-p/1739528#M321427</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-19T16:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: Defaulting variable in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/defaulting-variable-in-select-query/m-p/1739529#M321428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The select that you are looking for a Oracle database specific statement, which I don't think is possible in ABAP. You might have to select the data and then loop at the internal table and do the actions accordingly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;P&gt;Note - Please mark all the helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Dec 2006 17:04:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/defaulting-variable-in-select-query/m-p/1739529#M321428</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-19T17:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: Defaulting variable in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/defaulting-variable-in-select-query/m-p/1739530#M321429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mohan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per my knowledge, we do not have the provision of the function that you are looking in ABAP as we have only 5 aggregate functions. Below are the same for your reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. MAX&lt;/P&gt;&lt;P&gt;2. MIN&lt;/P&gt;&lt;P&gt;3. AVG&lt;/P&gt;&lt;P&gt;4. SUM&lt;/P&gt;&lt;P&gt;5. COUNT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can understand your concern on the performance, but i guess there is not other way to go. Since you need to modify only one field, you can try with a logic similar to the below one:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT carrid connid cityfrom cityto 
       FROM spfli 
       INTO TABLE itab.
wa-carrid = '1000'.

MODIF itab FROM wa TRANSPORTING carrid WHERE carrid IS INITIAL.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess this should be even better than modifying in the SELECT itself...&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;Kind Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Dec 2006 03:12:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/defaulting-variable-in-select-query/m-p/1739530#M321429</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-20T03:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Defaulting variable in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/defaulting-variable-in-select-query/m-p/1739531#M321430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Eswar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Thanks for your reply and I am also expecting the same and doing it also the same now. Still our mind sets are almost moving in parallel, good man. May be try to search for something on this, because you looks always for some challenging tasks right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Mohan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Dec 2006 15:55:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/defaulting-variable-in-select-query/m-p/1739531#M321430</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-20T15:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: Defaulting variable in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/defaulting-variable-in-select-query/m-p/1739532#M321431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks for the pleasing words...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Dec 2006 17:31:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/defaulting-variable-in-select-query/m-p/1739532#M321431</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-20T17:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: Defaulting variable in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/defaulting-variable-in-select-query/m-p/1739533#M321432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try using field-symbols to make the necessary Internal table modifications...&lt;/P&gt;&lt;P&gt;as fields symbols use common memory space..like Pointers in C and it should not cause much impact on ABAP source code performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at t_itab assigning &amp;lt;fs_itab&amp;gt;.&lt;/P&gt;&lt;P&gt; &amp;lt;fs_itab&amp;gt;-f1 = new_value1.&lt;/P&gt;&lt;P&gt; &amp;lt;fs_itab&amp;gt;-f2 = new_value2.&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;&lt;/P&gt;&lt;P&gt;cheers!!&lt;/P&gt;&lt;P&gt;Prabhu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        prabhu soundara pandian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Dec 2006 18:30:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/defaulting-variable-in-select-query/m-p/1739533#M321432</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-21T18:30:21Z</dc:date>
    </item>
  </channel>
</rss>

