How can replace IF condition for a Select query in my reports?

IF s_bukrs-LOW = '4312' OR s_bukrs-LOW = '4313' OR s_bukrs-LOW = '4349'  .
ELSEIF s_bukrs-LOW = '4310' OR s_bukrs-LOW = '4311' OR s_bukrs-LOW = '4587'.
ENDIF.
What if I want to use select query in place of IF condition, in my report for a Z -table in which I have made entries of ZZUSEREXIT-my progam name ,VAR1-4310,VAR2-4311,VAR3-4312,VAR4-4313,VAR5-4349,VAR6-4587?

HI
U can do this by two ways-
(1) Using Two SELECT statementsie. one for IF statements and second for ELSEIF statements.
Like--
    SELECT < field name>,
WHERE s_bukrs-LOW = '4312' OR s_bukrs-LOW = '4313' OR s_bukrs-LOW = '4349' 
SELECT < field name>,
WHERE s_bukrs-LOW = '4310' OR s_bukrs-LOW = '4311' OR s_bukrs-LOW = '4587'.
(2) U can do this in using IF with select statements.
This will help u

Similar Messages

  • How can i maintain conditions for vendor sub-ranges

    Hi All,
    How can i maintain conditions for vendor sub-ranges. These conditions apply to all materials from vendor's sub-range.
    Eg: vendor X has the two subranges R1 & R2. I want to maintain separate conditions for R1 & R2. When ever i created PO with ref to particular subrange that Vendor conditions has to be appeared.
    How can i achieve this?
    Could u pls suggest?
    Thanks & Regards
    Anilkumar Dalai

    Hi,
    First Create a Condition Table with field "Vendor sub-range" in M/03
    Then create an Access Sequence using this Condition Table in M/07
    Then assign this Access Sequence in the Gross Price Condition Type in M/06
    Then assign this Condition type in Calculation Schema in M/08
    Then maintain condition record for this condition type in MEK1
    And then select the appropriate VSR Code in ME21N and check the Pricing.

  • How can i use SUM aggregate in select query?

    HI,
    GURUS,
    How can i use SUM function in Select Query and i want to store that value into itab.
    for ex:
    TABLES: vbap.
    types: begin of ty_vbap,
           incluse type vbap,
           sum type string,
          end of ty_vbap.
    data: i_vbap type TABLE OF ty_vbap,
          w_vbap type ty_vbap.
    SELECT sum(posnr) FROM vbap into table i_vbap up to 5 rows.
                            (or)
    SELECT sum(posnr) FROM vbap into table i_vbap group by vbeln.
      loop at i_vbap into w_vbap
    " which variable have to use to display summed value.
      endloop.
    if above code is not understandable pleas give ome sample code on  above query.
    Thank u,
    shabeer ahmed.

    Hi,
    Check this sample code.
    TABLES SBOOK.
    DATA:  COUNT TYPE I, SUM TYPE P DECIMALS 2, AVG TYPE F.
    DATA:  CONNID LIKE SBOOK-CONNID.
    SELECT CONNID COUNT( * ) SUM( LUGGWEIGHT ) AVG( LUGGWEIGHT )
           INTO (CONNID, COUNT, SUM, AVG)
           FROM SBOOK
           WHERE
             CARRID   = 'LH '      AND
             FLDATE   = '19950228'
           GROUP BY CONNID.
      WRITE: / CONNID, COUNT, SUM, AVG.
    ENDSELECT.
    Regards,
    Sravanthi

  • How can i use param in my select query ( see code)

    Hi ,
    I need to use the param instead of hardcoding the value in the select query , when i did that it is working .
    I think the limit of args is only till the end of main and my select query is in a method called Load() .
    How can i use the param in my select query .
    public static void main(String[] args){
    name = args[0];
    class= args[1];
    new Load();
    }//end of main
    public Load()
              try {
                   Class.forName(JDBC_DRIVER);
                   connection = DriverManager.getConnection(DATABASE_URL,"username","pw");
                   statement = connection.createStatement();
                   //First Query : pin and ticket number
                   ResultSet resultSet = statement.executeQuery("SELECT pin , ticketnumber from airport ,year where "+                                                                      "year.year_name= Here i need to use the param (instead of hardcoding) and year.class_year= Here too i need to use param");
    }// end of method Load()Edited by: 1sai on Sep 24, 2008 7:34 AM
    Edited by: 1sai on Sep 24, 2008 7:35 AM

    Might I suggest you change the structure of your program to the following:
    public class Load {
      private Connection conn;
      private PreparedStatement statement;
      public Load(String sql) {
        init(sql);
      protected void init(String sql) throws Exception {
        Class.forName(JDBC_DRIVER);
        conn = DriverManager.getConnection(DATABASE_URL, "username", "pw");
        statement = conn.prepareStatement(sql);
      public ResultSet execute(String p1, String p2) throws Exception {
        statement.setString(1, p1);
        statement.setString(2, p2);
        return statement.executeQuery();
      public void close() throws Exception {
        if (statement != null)
          statement.close();
        statement = null;
        if (conn != null)
          conn.close();
        conn = null;
      public static void main(String[] args) throws Exception {
        String sql = args[0];
        String param1 = args[1];
        String param2 = args[2];
        Load load = new Load(sql);
        ResultSet rs = load.execute(param1, param2);
        while (rs.next())
          System.out.println(rs.get(0));
        rs.close();
        load.close();
    }This allows you to use the same "Load" object for multiple queries with different parameters.
    I do not recommend you actually use the code above in any sort of production application. You should really take a look at Spring Framework along with an ORM tool like Hibernate or Ibatis to simplify your DAO layer.
    Hope this helps,
    David

  • How can i set dynamice for week on Selection screen..pls help me..Urgent

    Hi..All
    please Help me .. i am very  confused..
    i need to set a varient for week which is dynamic on selection screen.
    b) Week from current week to current week + 2. (<b>Dynamic selection)</b>how can i set dynamice for week on Selection screen,,
    how can i do this..i am alrady set dynamice variant for Date.. there is option for D.. but in case of week there is a no option.
    pls help me..urgent
    thamks in advance.
    mayukh

    Hi,
    I think the way out is use the dynamic select option while setting up the varinat and use sy-datum to sy-datum+9 which should essentially serve the purpose.
    While saving the variant, for that particular date field check the Selection variable checkbox, then Choose D
    option and then choose current days + or - option from there.
    Rgds,
    HR

  • How can I get width that multiple selected items?

    How can I get width that multiple selected items? (Not grouped.)
    //---------- source code ----------
    var mm = 2.83464566929134 //unit conversion. (point->milimeter)
    var W = docRef.selection[0].width/mm;
    alert(W);
    //---------- source code ----------

    That's right Carlos
    @kimDino8,
    my script in Carlos link creates a green rectangle around the selected items. If you don't need this rectangle than you can remove this lines:
    var newRGBColor = new RGBColor();
    newRGBColor.red = 0;
    newRGBColor.green = 255;
    newRGBColor.blue = 0;
    and replace this:
    var aRectangle = aDoc.pathItems.rectangle(vBounds_Ob, vBounds_Li, vBounds_Re - vBounds_Li, vBounds_Ob - vBounds_Un);
    aRectangle.strokeColor = newRGBColor;
    aRectangle.strokeWidth= 2;
    aRectangle.filled = false;
    aRectangle.stroked = true;
    aDoc.selection = null;
    with this:
    var mmFactor = 2.83464567;
    alert("width = "+ (vBounds_Re - vBounds_Li)/mmFactor);
    alert("height = "+ (vBounds_Ob - vBounds_Un)/mmFactor);
    Further you only have to do: create a function for rounding of the result.

  • Can we put condition for color in bex query designer

    hi all,
    can any one guide me how to put a condition for color settings in query designer
    for example:
    i have a key figure like ANSWERED%.in analyser it should display in red if  answered% exceeds 95%.
    please help me in this issue.
    regards
    Vamshi D Krishna.

    Hi,
    Use Exceptions while designing your Query.
    Please go through the link
    http://help.sap.com/saphelp_nw04s/helpdata/en/43/21b4cd14cd06f4e10000000a422035/frameset.htm

  • How can i use AME for the new OAF page.

    Dear all,
    I have developed a new OAF page and registered under Employee Self Service.
    How can i use AME for the approval process.
    Appreciate your ideas?
    zamora

    I will try to answer based on my experience of working with iProcurement and AME. It depends on how you want to make a call to AME , directly from OAF Page or from Workflow and your requirement. You didn't specify what you want to show the users on OAF Page and your business requirement.
    Before calling AME Engine from the OAF page or workflow, I guess you did already setup AME Transaction Type and it's Approval Groups, Conditions, Action Types and Rules. Do some testing from AME Business Analyst Test Workbench. Please note that, AME provides lot of PL/SQL API's that you have to call from your programs (java or workflow pl/sql)
    Let's look at the workflow and putting an OAF Page as notification.
    As Sameer said, you have kick-off workflow process from PR of CO and with in the workflow function, you make a call to AME Engine API's with the AME Transaction ID. This transactionId belongs to the AME Transsaction Type that you setup. Based on the rules setup, AME Engine generates list of approvers/approver and stores them AME Tables for that transactionId. Then, it sends a notification to the approver.
    In the workflow, where that notification is defined, in the message body you have to put an attribute(&XX_WF_FWK_RN) of type document/send. And this attribute will have the constant JSP:/OA_HTML/OA.jsp?OAFunc=XX_FUNC&paramId=-&DOCUMENT_ID-. This function is SSWA Jsp function that makes a web html call to your OAF Region.
    If your requirement is to just show the list of approvers on the OAF Page, you may have to call AME API diectly passing your AME TrasnactionId with other parameters. Then AME generates list of approvers and stores them in AME tables with each approver status. You can pickup those approvers using VO and show them on OAF Page.
    Hope this gives some idea.

  • How can I find ringtones for sale in iTunes? I don't see it as a category anywhere.

    how can I find ringtones for sale in iTunes? I don't see it as a category anywhere.

    Ferretbite wrote:
    You could also download the Ringtone Maker all for iPhone in the AppStore and create your own custom ringtones and message tones.
    Not needed.
    Easy enough to do in iTunes.
    Find the song you want and note the start/stop time you want the ring tone.
    Right click - get info, click the Options tab and set the start/stop times as above.
    Right click - Create AAC version. This creates a new file.
    Drag this new file from the iTunes window to the desktop.
    Delete the file from iTunes and also select Delete from hard drive.
    On the desktop, rename the file whateveryouwant.m4r (first part you can change to whatever you want & change the extension to .m4r).
    Drag the file back to the iTunes library at top left.
    Make sure iTunes prefs > General has Tones ticked.

  • How can you change your line access selection?  I have found where you can change your plan selection, but can you change the line access fee or is that a set amount?

    How can you change your line access selection?  I have found where you can change your plan selection, but can you change the line access fee or is that a set amount?

        DIVAB71,
    Great question. The line access fees for the account are a set amount and can not be changed unless you are going from a basic to a smartphone or vice versa. If you are wondering about adding the month to month discount if you are out of contract Ann154 has provided great information on how to access and add the feature.
    LindseyT_VZW
    Follow us on Twitter @VZWSupport

  • How to create greater_or_equal condition for file_io storage

    Dear experts,
    Please tell me the how to create greater_or_equal condition for query in file_io as RationalOperatorType.GREATER_OR_EQUAL is not supported for file_IO storage.
    thanks n regards,
    Kapoorchand.

    Hi,
    not sure if I got you correctly, but in
    com.sap.ip.me.api.persist.query.RelationalOperatorType
    There is no condition available that you are looking for. Why do you not work with
    public interface Condition
    Represents a condition for a query. This can either be a single condition, as FIELD = VALUE and / or a composite condition, as ( ( FIELD1 = VALUE1 OR FIELD2 = VALUE2 ) AND FIELDE 3 <> VALUE3 ).
    Hope this helps!
    Regards,
    Oliver

  • How can I save passwords for URL's

    How can I save passwords for URL's? I just installed 10.6.7 Snow Leopard. I also had to format my HD drive and reinstall my software.

    Hi,
    From the Safari menu bar click Safari / Preferences then select the Autofill tab. Select the box next to:
    User names and passwords.
    Navigate to a site you normally log into with the user name and password. Click Yes when prompted. That will save that information to a new keychain for you.
    Passwords are actually stored in your Keychain Access application. (Applications/Utilities)
    Carolyn

  • How to set the condition for dynamic Xquery in OSB11g

    Hi to all,
    I have a requirement like three different requests all are converted in to standard format.For this scenario I use dyamic X-query transformation.For Example RequestA,RequestB and RequesrC what ever request it should be converted into one standard format say Response.For this I create three X-Query transformations,and proxy service.If i get the request from RequestA related XQuery will execute (RequstA to Response transformation).
    RequestA------Response
    RequestB------Response
    RequestC------Response
    Actually my idea is based on requset schema name (like RequestA) it will convert,for this scenario how can I set condition in dynamicXquery.
    Thanks in advance.

    Hi,
    Can u plz tel how make the x-query for an XML file,basically i follow the below link
    http://beatechnologies.wordpress.com/2010/12/01/dynamic-xquery-in-oracle-service-bus/
    In this example I'm creating the routing rulesXML file in Eclipse,I'm unable to assigning this xml file to an variable.I create a Xquery for this XML with any type,And I create GetRouting.XQ.can u pls tel which is correct method to Xquery with any type for this XML or else i send my jar file,tell me any modifications are required.
    Thanks in advance

  • How can I find services for object for PM Notification

    Hi all
    How can I find services for object(attached files ) for PM Notification  ?
    I can see then,for examle ,using transaction Iw22 :System---->Services for object
      My requirement are : 1. open attached file of selected notification for display ( if exists one)
                                     2. If user wants to attach file as service of object
                                           what function exists for it ?
    Please your help

    Hi SD,
    I have checked in SUIM and SU24 also. But I didn't find.  Could you please tell me any other way to finding out the authorization objects.
    Thanks,
    bsv.

  • How can i apply border for fluid grid layout div

    How can i apply border for fluid grid layout div

    <!doctype html>
    <!--[if lt IE 7]> <html class="ie6 oldie"> <![endif]-->
    <!--[if IE 7]>    <html class="ie7 oldie"> <![endif]-->
    <!--[if IE 8]>    <html class="ie8 oldie"> <![endif]-->
    <!--[if gt IE 8]><!-->
    <html class="">
    <!--<![endif]-->
    <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Untitled Document</title>
    <link href="boilerplate.css" rel="stylesheet" type="text/css">
    <link href="CSS/Layout.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="flexslider.css" type="text/css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
    <script src="jquery.flexslider.js"></script>
    <!-- Place in the <head>, after the three links -->
    <script type="text/javascript" charset="utf-8">
      $(window).load(function() {
        $('.flexslider').flexslider();
    </script>
    <!--
    To learn more about the conditional comments around the html tags at the top of the file:
    paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
    Do the following if you're using your customized build of modernizr (http://www.modernizr.com/):
    * insert the link to your js here
    * remove the link below to the html5shiv
    * add the "no-js" class to the html tags at the top
    * you can also remove the link to respond.min.js if you included the MQ Polyfill in your modernizr build
    -->
    <!--[if lt IE 9]>
    <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <script src="respond.min.js"></script>
    </head>
    <body>
    <div class="gridContainer clearfix">
      <div id="LayoutDiv1"><img src="SJV-Images/Banners/Dark-green-curved-header.png"/></div>
      <div id="LayoutDiv2">
      <div class="flex-container">
      <div class="flexslider">
        <ul class="slides">
          <li>
            <img src="SJV-Images/Stud1.jpg"/>
          </li>
          <li>
            <img src="SJV-Images/Stud2.jpg" />
          </li>
          <li>
            <img src="SJV-Images/Stud3.jpg" />
          </li>
        </ul>
      </div>
    </div> </div>
      <div id="Nav">This is the content for Layout Div Tag "Nav"</div>
      <div id="Special_Features"><h3 align="center">SPECIAL FEATURES</h3>
      <ul>
      <li>
      It is one of the oldest school.</li>
      <li>It was first started as an orphanage for the children of British soldiers, and later moved to its current location.</li>
       <li>Rich in Anglo-Indian tradition dating back to three centuries.</li>
      <li>The campus now has separate buildings within the campus for year 1 to  year 8 (Junior and Sub Junior block) and year 9 to year 12 (Senior and   Super Senior block).</li>
      <li>The school has montessori facilities in a separate building.</li>
      <li>The School also has boarding facilities for students from distant places.</li>
      </ul></div>
      <div id="History"><img src="SJV-Images/His_Image.png" alt="Hisimage" class="floatleft">
      <h3>HISTORY OF OUR SCHOOL</h3><P>In 1750 – a very long time ago,a missionary and a teacher, Christian Frederick Schwartz came to India to work in the Danish Mission at Tranquebar.Due to his own personal charm, genius and integrity, soon he became a trusted envoy to the court of Princes ,both hostile and friendly. He even helped in the training and education of Serfogee Rajah, the adopted son of the Tanjore Raja Tuljagee.</P></div>
    <div id="Photo_Gall"><center>
        <strong>PHOTO GALLERY</strong>
    </center>
      <p><img src="SJV-Images/Photogall.png" width="174" height="70" class="floatright"/></p>
    </div>
      <div id="News_Events"><center>
        <strong>NEWS & EVENTS</strong>
      </center><center>Annual Day<br><center>
        Alumni Meet<br>
        Exam Time Table<br>Parents-Teacher's Meet</center>
      </center>
      <br></div>
      <div id="footer">This is the content for Layout Div Tag "footer"</div>
    </div>
    </body>
    </html>

Maybe you are looking for