Get Min value and another column value from the same row

hi all - for each customer and product, I need to grab the row that has the min value for field Value1. I could've just done group by on customer and product and min on Value1, but I also need to grab Vlaue2 from the same row where the minimum value for
Value1 lies.
DECLARE @Temp TABLE (CustomerID INT, ProductID VARCHAR(10), Trans_Date Date, Value1 INT, Value2 INT)
INSERT INTO @Temp VALUES (123, 'ABC', '1/1/2013', 10, 100)
INSERT INTO @Temp VALUES (456, 'ASD', '1/1/2013', 40, 500)
INSERT INTO @Temp VALUES (456, 'ASD', '2/1/2013', 90, 700)
INSERT INTO @Temp VALUES (123, 'ABC', '2/1/2013', 20, 700)
SELECT * FROM @Temp
The output should be
123, ABC, 10, 100
456, ASD, 40, 500
I know that I can just join the table to itself and get the desired output but I am dealing with a table that has millions of rows and I was hoping there is more efficient way to do this. any help would be highly appreciated...

Here is a correction on your DDL to make it into nearly valid table.
CREATE TABLE Sales
(customer_id INTEGER NOT NULL,
product_id CHAR(10) NOT NULL,
transaction_date DATE NOT NULL,
PRIMARY KEY (customer_id, product_id, transaction_date),
value1 INTEGER NOT NULL,
value2 INTEGER NOT NULL);
Here is the current syntax for insertion:
INSERT INTO Sales
VALUES (123, 'abc', '2013-01-01', 10, 100),
(456, 'asd', '2013-01-01', 40, 500),
(456, 'asd', '2013-02-01', 90, 700),
(123, 'abc', '2013-02-01', 20, 700);
WITH
X
AS
(SELECT customer_id, product_id, transaction_date, value1, value2,
MIN(value1) OVER () AS value1_min
FROM Sales)
SELECT X.*
FROM X
WHERE X.value1_min = X.value1;
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL

Similar Messages

  • How could I play and transmit a stream from the same camera

    How could I play and transmit a stream from the same camera?

    Hi,
    As I said, you can use the method getVisualComponent() of the Processor to get a preview Window.
    You create a Processor, prepare it to generate an appropriate output DataSource for what you want to do (saving, TXing, etc).
    Then, for this Processor you extract an AWT Component where the stream will be previewed using the method getVisualComponent().
    Some of the player examples in the JMF guide use this technique. I'm still not write my own player. I'm using an adaptation of the RTPPlayer, but I'm planning to use the above technique to create a Player where I can apply some effects to the stream and then save it if the user wants to.
    If someone already did that, please, correct me if my procedure isn't right!
    By the way, thanks for your help! I was using the DataSource returned from Manager.createCloneableDataSource only to create the clones. I was feeding my main Processor with the original DataSource. That was the problem!
    RGB

  • Safari and Firefox on my desktop suddenly stopped combine ting to any website.  IPad and IPhone work fine from the same wifi. Any ideas.

    Safari and Firefox will not connect to website On desktop. IPad and IPhone work fine from the same wifi.

    Restart your router.

  • When trying to upload pictures from my camera I get this message although I have uploaded from the same camera in the pastiPhoto cannot import your photos because there was a problem downloading an image.

    When trying to upload pictures from my camera I get this message although I have uploaded from the same camera in the past, "iPhoto cannot import your photos because there was a problem downloading an image."

    Can you access the images with Image Capture (in your Applications Folder) ?

  • How to generate a value to field in a row based on another two fields in the same row ???

    I have a quantity and unit price and there is also a field in the same row called total price. I want to get the value automatically of total price from multiplying quantity and unit price.

    Here you go:
    page code
                            <af:panelGroupLayout id="pgl2" layout="horizontal" styleClass="AFStretchWidth">
                                <af:inputText label="Quantity" id="quantity" value="#{bindings.quantity1.inputValue}" autoSubmit="true"
                                              valueChangeListener="#{SetItemBean.valueChangeListenerItem}"/>
                                <af:spacer width="10" height="10" id="s1"/>
                                <af:inputText label="Price" id="price" value="#{bindings.price1.inputValue}" autoSubmit="true"
                                              valueChangeListener="#{SetItemBean.valueChangeListenerItem}"/>
                                <af:spacer width="10" height="10" id="s2"/>
                                <af:inputText label="Sum" id="total" value="#{bindings.total1.inputValue}" partialTriggers="quantity price" readOnly="true"/>
                            </af:panelGroupLayout>
    page bindings
    <?xml version="1.0" encoding="UTF-8" ?>
    <pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel" version="12.1.2.66.68" id="SetItemPageDef" Package="de.hahn.blogtest12c.view.pageDefs">
      <parameters/>
      <executables>
        <variableIterator id="variables">
          <variable Name="quantity" Type="java.lang.Number"/>
          <variable Name="price" Type="java.lang.Number"/>
          <variable Name="total" Type="java.lang.Number"/>
        </variableIterator>
      </executables>
      <bindings>
        <attributeValues IterBinding="variables" id="quantity1">
          <AttrNames>
            <Item Value="quantity"/>
          </AttrNames>
        </attributeValues>
        <attributeValues IterBinding="variables" id="price1">
          <AttrNames>
            <Item Value="price"/>
          </AttrNames>
        </attributeValues>
        <attributeValues IterBinding="variables" id="total1">
          <AttrNames>
            <Item Value="total"/>
          </AttrNames>
        </attributeValues>
      </bindings>
    </pageDefinition>
    and bean code
        public void valueChangeListenerItem(ValueChangeEvent valueChangeEvent) {
            String comp = valueChangeEvent.getComponent().getId();
            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
            // get an ADF attributevalue from the ADF page definitions
            AttributeBinding attr = (AttributeBinding) bindings.getControlBinding("quantity1");
            Number q = (Number) attr.getInputValue();
            if (q == null)
                q = 0;
            attr = (AttributeBinding) bindings.getControlBinding("price1");
            Number p = (Number) attr.getInputValue();
            if (p == null)
                p = 0;
            if ("price".equals(comp)) {
                p = (Number) valueChangeEvent.getNewValue();
            } else {
                q = (Number) valueChangeEvent.getNewValue();
            // set new value
            attr = (AttributeBinding) bindings.getControlBinding("total1");
            Number t = q.doubleValue() * p.doubleValue();
            attr.setInputValue(t);
            // update Total
            FacesContext facesCtx = FacesContext.getCurrentInstance();
            UIComponent ui = facesCtx.getViewRoot().findComponent("total");
            if (ui != null) {
                // PPR refresh a jsf component
                AdfFacesContext.getCurrentInstance().addPartialTarget(ui);
    Timo

  • Upload image to directory and data to database from the same form

    Hello all
    I'm playing at building a shopping cart (never done one
    before) from a tutorial by Gordon Knapp at www.webthang.com.
    I have created the site and it works perfectly. Now I want to
    extend it.
    There is a form that allows the user to add data to the
    database. I would also like to be able to upload an image to a
    directory on the server and add the data to the database at the
    same time from the same form. It would be good if the input field
    "<input name="product_picture" type="text" id="product_picture"
    tabindex="6" size="50" />" could be populated automatically by
    the filename of the image being uploaded, but this isn't a
    neccessity.
    I have looked at various ASP Upload packages and I can upload
    an image alone but none of them make it clear how to upload the
    image and add data to the database at the same time.
    As this is a private project I need any suggestions to by
    free.
    The tutorial shows how to create the site in Ultra Dev but
    worked perfectly well in DW. The page concerned looks like this. It
    is named 'admin_add.asp':
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
    <!--#include file="../Connections/con_ecom.asp" -->
    <%
    Dim MM_editAction
    MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
    If (Request.QueryString <> "") Then
    MM_editAction = MM_editAction & "?" &
    Server.HTMLEncode(Request.QueryString)
    End If
    ' boolean to abort record edit
    Dim MM_abortEdit
    MM_abortEdit = false
    %>
    <%
    ' IIf implementation
    Function MM_IIf(condition, ifTrue, ifFalse)
    If condition = "" Then
    MM_IIf = ifFalse
    Else
    MM_IIf = ifTrue
    End If
    End Function
    %>
    <%
    If (CStr(Request("MM_insert")) = "add_form") Then
    If (Not MM_abortEdit) Then
    ' execute the insert
    Dim MM_editCmd
    Set MM_editCmd = Server.CreateObject ("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_con_ecom_STRING
    MM_editCmd.CommandText = "INSERT INTO products
    (product_category, product_name, product_price, product_briefdesc,
    product_fulldesc, product_picture) VALUES (?, ?, ?, ?, ?, ?)"
    MM_editCmd.Prepared = true
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param1", 202, 1, 50,
    Request.Form("product_category")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param2", 202, 1, 50,
    Request.Form("product_name")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param3", 5, 1, -1,
    MM_IIF(Request.Form("product_price"),
    Request.Form("product_price"), null)) ' adDouble
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param4", 203, 1, 536870910,
    Request.Form("product_briefdesc")) ' adLongVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param5", 203, 1, 536870910,
    Request.Form("product_fulldesc")) ' adLongVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param6", 202, 1, 50,
    Request.Form("product_picture")) ' adVarWChar
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close
    ' append the query string to the redirect URL
    Dim MM_editRedirectUrl
    MM_editRedirectUrl = "admin_control.asp"
    If (Request.QueryString <> "") Then
    If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0)
    Then
    MM_editRedirectUrl = MM_editRedirectUrl & "?" &
    Request.QueryString
    Else
    MM_editRedirectUrl = MM_editRedirectUrl & "&" &
    Request.QueryString
    End If
    End If
    Response.Redirect(MM_editRedirectUrl)
    End If
    End If
    %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN"
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=utf-8" />
    <title>Administration - Add Product</title>
    <link href="../scripts/admin.css" rel="stylesheet"
    type="text/css" />
    <script type="text/javascript"
    src="../scripts/ecom.js"></script>
    </head>
    <body onLoad="adminTitle()">
    <div id="wrapper">
    <div id="pageHeading">ADMINISTRATION - ADD
    PRODUCT</div>
    <div id="navBar"><a
    href="admin_control.asp">Control</a> | Add | <a
    href="admin_view.asp">View</a> | <a
    href="admin_update1.asp">Update</a> | <a
    href="admin_delete1.asp">Delete</a> | <a
    href="../Default.asp">Shop</a></div>
    <br />
    <form name="add_form" id="add_form" method="POST"
    action="<%=MM_editAction%>">
    <table border="1" align="center" id="tblArea">
    <tr>
    <td class="tdLabel">Product Category</td>
    <td colspan="2"><input name="product_category"
    type="text" id="product_category" tabindex="1" size="50"
    /></td>
    </tr>
    <tr>
    <td class="tdLabel">Product Name</td>
    <td colspan="2"><input name="product_name"
    type="text" id="product_name" tabindex="2" size="50"
    /></td>
    </tr>
    <tr>
    <td class="tdLabel">Product Price</td>
    <td class="tdContent" colspan="2"><input
    type="text" name="product_price" id="product_price" tabindex="3"
    size="50" /></td>
    </tr>
    <tr>
    <td class="tdLabel">Product Short
    Desciption</td>
    <td class="tdContent" colspan="2"><textarea
    name="product_briefdesc" id="product_briefdesc" cols="47" rows="4"
    tabindex="4"></textarea></td>
    </tr>
    <tr>
    <td class="tdLabel">Product Full
    Description</td>
    <td class="tdContent" colspan="2"><textarea
    name="product_fulldesc" id="product_fulldesc" cols="47" rows="5"
    tabindex="5"></textarea></td>
    </tr>
    <tr>
    <td class="tdLabel">Product Image File Name</td>
    <td class="tdContent" colspan="2"><input
    name="product_picture" type="text" id="product_picture"
    tabindex="6" size="50" /></td>
    </tr>
    <tr>
    <td class="tdLabel"> </td>
    <td align="center"><input type="reset" name="Reset"
    id="Reset" value="Reset Form" /></td>
    <td align="center"><input type="submit"
    name="Submit" id="Submit" value="Add To Shop" /></td>
    </tr>
    </table>
    <input type="hidden" name="MM_insert" value="add_form"
    />
    </form>
    </div>
    </body>
    </html>
    Hope you can help.
    Warm regards
    Martin

    Got it sorted.
    Found an excellent tutorial at Webthang.
    http://www.webthang.co.uk/tuts/tuts_dmx/rob15/rob15.asp

  • Access two EAS with different Essbase versions and different java versions from the same p.c.

    Hi,
    I need to regularly access Essbase 11.1.2.2. and Essbase 11.1.2.3 EAS from the same client machine.
    They are on, and must be on, different versions of java, is there a way to have both versions of java installed but each using the correct version and without the two java versions causing any kind of problems?
    thanks,
    Robert.

    Hi Robert...  I assume this is web-launched?
    I spent a day or so trying understand the intricacies of the JNLP protocol and create shortcuts that will invoke web-launched EAS with the appropriate version of Java.  I can get one version of EAS to use the 1.6 Java Web Launcher, and the other version of EAS to use the 1.7 Java Web Launcher - but both Web Launchers eventually invoke the same version of Java!  There are switches in the JNLP syntax that seem like they should allow you choose the actual Java version that gets invoked, but I just could not make it work.
    You can use the Java Control Panel (in Control Panel) to enable and disable the relevant versions before launching EAS.
    If you find otherwise I would love to know (or if you find out how to control which versions are enabled or disabled via command-line script).

  • How to select a layer mask (not its contents) and another layer/folder at the same time?

    I can do one or another, but both at the same time?
    It is annoying because a mask selection turns into layer selection when you select a second layer/folder.

    Well a layer mask is just that for that layer. If you want to apply that mask to a new layer, you can drag it or alt drag to drag a copy to the new layer. Then it will have its own layer mask. When your done, if needed you can then remove that mask from that new layer, if for some reason you only wanted to see a temporary mask.

  • Calculating a count of rows where value matches another column value in the same table

    Hi,
    I'm struggling to do something in DAX that seems to me should be super easy (coming from a SQL world)!
    That is to count all rows in column 1 where the value matches the current value for column 1?
    E.g something like this:
    [Col2]=Count of rows in [Col1] where value = this.[Col1]
    Where the results are as in the table below:
    Col1, Col2
    A, 2
    A, 2
    B, 1
    Anyone?
    Martin Laukkanen
    Nearbaseline blog - nearbaseline.com/blog
    Bulk Edit and other Apps - nearbaseline.com/apps

    Thanks, that's perfect! 
    I knew it had to be something so simple, but after spending over an hour banging my head against those exact functions I couldn't get anything working!
    Martin Laukkanen
    Nearbaseline blog - nearbaseline.com/blog
    Bulk Edit and other Apps - nearbaseline.com/apps

  • How can I get an item and it's attachments from the current list using SP's JavaScript Client Object Model on newform.aspx?

    I only recently learned/read about SharePoint's JavaScript Client Object Model. I'm reading online trying to figure this out but not having much luck.
    On newform.aspx (and dispform.aspx) I want to get the
    current list,
    the last item created, and it's attachments. I now the CAML query I need to get the last item created, but first I have to get the current list and I am not sure how to do that.
    I tried this but it returns null:
    SP.ListOperation.Selection.getSelectedList()

    Hi,
    For your issue, you can get the list name from the new form url and retrieve the list last created item :
    https://social.msdn.microsoft.com/Forums/office/en-US/b90a64f8-2255-41b0-9d91-78335dd4a4cf/get-list-name-from-list-url-through-javascript?forum=sharepointdevelopmentprevious
    http://msdn.microsoft.com/en-us/library/office/hh185007(v=office.14).aspx
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • I have lost an email. It has something to do with threads. I have not read the email and would like to get it back and continue receiving emails from the sender

    Please excuse me if you have already received this query. I have lost an email which I clicked on quickly to see what it was about and intended coming back to read it later. It disappeared from my inbox and a caption related to the email appeared at the bottom of my subsequent emails. I have been unable to find the original email. Could you please advise if it is possible to retrieve it and if so how it may be done. Thank you
    sharon

    Hello Mogulman46,
    So what that means is when you have Do Not Disturb turned on, you may have an alert depending on the setting and how you are using your iPhone. So if it is set to Always, then that means that no matter what, your iPhone will not be notified. If it set to Only while the iPhone is locked, then that means that you will not get notification when your iPhone is locked but you will get notifications if your iPhone is being used. Also keep in mind the settings All Calls From can be set to certain contacts like Favorites, Everyone or no one. If you are using Do Not Disturb and you do not need it, then turn it off. 
    Use Do Not Disturb on your iPhone, iPad, or iPod touch
    http://support.apple.com/kb/ht5463
    Regards,
    -Norm G. 

  • I have lost  years worth of music  and pictures not all from the same pc how can i get it back

    I have lost years worth of music and pictures from my ipod how can i retrieve them ?

    - If photos were in your iPod Camera Roll, just restoe from backup. If they were synced to the iPOd you have to get them from where you got them the first place
    - For itunes pruchsed music see:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    - For other music you will hae to get it from where you got it the first time.

  • If I change my Apple ID, can I get my iTune and App purchases transferred from the old to the new ID?

    I have a child who is now of age to create an Apple ID.  If I create a new Apple ID, can I tranfer the iTune and App Store purchases from my existing Apple ID to the new one for my child?

    No, it's not currently possible to transfer content from one account to another account - all items remain tied to the account that originally bought/downloaded them, so they will remain tied to your account.
    As long as your account is authorised on the computer's iTunes that he/she syncs to, and those items are in its library, then he/she should be able to continue to have them on their device (though only your account will be able to download updates to those apps)

  • Can I use SubPanels to display and run multiple executables from the same GUI?

    I have two Labview executables that performs some A/D I/O, each using an independent USB-6008.  I would like to run both of these executables from a single UI.  Is this possible usin SubPanels?  Or some other method?
    I found KB regarding exe's and VI Server but can't seem to get the suggested workarounds implemented.
    http://digital.ni.com/public.nsf/allkb/8545726A00272EB0862571DA005B896C?OpenDocument
    I am using Labview2009
    Thanks
    Dan
    Solved!
    Go to Solution.

    DBerry wrote:
    No, of course I am not sure yet.  I have only begun testing this method. 
    Not sharing common hardware (separate USM-6008s).
    Here is the whole picture:
    I have developed a top-level VI that performs Daqmx IO using a single USB-6008.  The top-level VI references a Project Daqmx Task that points to the desired 6008.  I would like to create a single UI that uses this top-level VI to control twoUSB-6008s simultaneously.  I thought I could build the top-level VI into 2 separate exes, where the only difference between the exes is the hardware it points to (one exe to each of the 6008s).  But I have been unsuccessful at running these two exes within a single UI.  I attempted use subpanels on a tab control to do this but I am unable to obtain a reference to the top-level vis once they have been built into an exe.  I have also tried building a dll and exporting the top-level vi from the dll build but i can't seem to get that to work either.  In both of these cases my Open VI reference function returns errors (Error 1445).  I am aware of the changes in referencing VIs from within an exe/dll since LV8.2 - http://digital.ni.com/public.nsf/allkb/8545726A00272EB0862571DA005B896C
    The link seems to suggest that I should be able to obtain a reference to the top-level vi within the dll but I can't get it to work.
    So I then moved on to the above method (making all the subvis reentrant).  I just haven't figured this all out yet.
    If you have suggestions on other problems I may run into please share.  I think I can eliminate my FGs but haven't gotten back to this yet.
    Thanks
    Dan
    When I am designing apps of the type you described I have kept the ned goal in mind from the begining since of the issue you are mentioning. I also don't want to tell you to throw it all away and start over. So with that in mind I have been looking at your posts and only offering the least destrutive ideas first. With that in mind I would like to invite yo uto look at the code i posted in this thread (reply #18 has a zip).
    That code shows how to realize un-dockable GUI regions but it passes the ref of the top level VI to a reentrant VI it instanciate for each undockable region. It may have enough hints and technique to give you some ideas that will work for you.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Is this a good design -- XI and another EAI tool in the same landscape

    Hi All,
    I am working in a project wherein the client already has an EAI tool which is based on SOA(Web Services). They are implementing SAP systems in their landscape. They now want to use SAP XI in the landscape for the purpose of integration. They want to integrate their initial EAI tool with XI and have the existing integration with NonSAP systems as it is and integrate SAP systems using XI.
    Is this a good design having two EAI tools being used for integration between two systems? What are the various issues that need to be taken into account?
    Answers will be promptly rewarded.
    Thanks and Regards,
    RM

    R M,
    There are lot of points that has to be considered when evaluating the design of EAI landscape. I heard somewhere that even SAP does not recommend to scrap the existing landscape and bring in SAP XI there. I gues dual hub gateway is very common unless it is a fresh implementation becuase changing the existing landscape is re-investing the cost again for the customers.
    If you ask me then SAP XI is not yet so robust to handle huge volumes in real time data integration and SAP XI can be used in between for integration to SAP system as it is a SAP system and it works excellent integrating with SAP systems.
    Check out this thread which is a transcript of a 10 year EAI architect :
    in my company we had more or less the same situation 2 years back, a existing BizTalk solution, and whether we should introduce XI or not.
    We concluded with the following; BizTalk should be used as the main integration engine between the different system landscapes and ALL external communication, and XI should be used as the integration engine for all data to/from our SAP system landscape. Depending on the integration scenario, we may use both.
    BizTalk will not see any SAP systems, only web services exposed by XI or using IBM MQ depending on an async/sync integration scenario.
    We believe that XI is better with integration from/to SAP, and;
    - In future SAP will deliver out of box integration for the XI system (XI content) for Enterprise Services Architecture
    - Several components in the NetWeaver stack are using XI for communication
    We have a SAP system landscape with several 46C systems (IS/OIL, HR ...) and newer NetWeaver solutions.
    I can give you a brief resume of our experiences – my background is ABAP developer since ’98, I have implemented a few BizTalk solutions to SAP 46C, and I’m a certified XI developer and developed several XI solutions between SAP 46C/640 and BizTalk.
    BizTalk ******
    Overall communication between SAP systems and BizTalk depending on the integration scenario and who is the initiator:
    SAP 46C to BizTalk:
    There are no good mechanisms available for sending data from 46C to BizTalk, we are using HTTP_POST with XML payload. Then you must use the iXML library on the SAP side, its ok, but you will spend, in my point of view, too many hours on XML programming that can be generated automatically.
    BizTalk to SAP 46C - Which SAP adapter to use for BizTalk?
    We started with SAP adapter from IWay, but that adapter gave us a lot of problems on the BizTalk server (pretty complex adapter with strange behaviour, and several integration scenarios stopped working for no reason at all (unstable)).
    Due to several severe problems, we switched to SAP adapter from Microsoft 1 year back in time. If I don’t remember wrong, back then, the SAP adapter from Microsoft did not support parameter of type string or table types – so there are/were some limitations regarding the signature of the RFC function.
    The SAP adapter from Microsoft is more stable than the previous, BUT we have some hick ups with that one as well when BizTalk does very frequent calls to SAP 46C.
    SAP 640 to/from BizTalk:
    I assume you can use the web service functionality on the SAP side in order to send/receive data, but I don’t know whether 640 support asynchronous web service.
    XI *****
    The communication mechanism between different SAP systems and XI are much better than with BizTalk:
    SAP 46C to XI:
    Configure a sender communication channel with RFC adapter; basically the XI system will be RFC server so the only thing you have to do is to create a RFC port on the 46C system “pointing” to the XI system. In the Abap program, you can do normal function calls with destination (RFC port) AND the RFC call will automatically be translated to XML on the XI side.
    Thus, you can forget all about the iXML library and XML rendering of the payload to HTTP.
    Besides, you can choose to use sRFC, tRFC or even qRFC depending on the integration scenario and whether you want guaranteed delivery.
    XI to SAP 46C:
    More or less same as BizTalk using a SAP adapter, but string and table types are supported.
    SAP 640 to/from XI:
    This is a very nice situation, every 640 has a local integration engine, so the main integration engine (XI) can send/receive XML messages both async/sync. Another advantage is using the SPROXY transaction on the 640 system, generating automatically a proxy class being able to send/receive messages based on a message interface defined in XI (outside-in programming).
    Finally *****
    BizTalk and XI are at a conceptual level identical, two integration engines with the purpose of send/receive, route and do message transformation (mapping) using adapters to different technical systems.
    Microsoft has a lot of resources available and for sure, BizTalk will be a very good choice for most companies.
    SAP came late with XI, but they are not trying to make the best integration engine, but good enough. And for sure, I think SAP will come with very nice XI content in time (interface mappings between message interfaces – business solutions) which is beyond BizTalk.
    As an ABAP programmer I just love the transport system between development, quality and production systems. We are using the CMS transport systems between our development XI, quality XI and production XI – it is so nice and fast. With BizTalk you have to create a MSI file (installation file – which files to include…) and somehow transport the file (mail or whatever) to the quality environment for installation – really tedious work compared to XI.
    So we are using BizTalk 2004 and XI 3.0 and are very happy with both.
    Note:

Maybe you are looking for