Show Last Price of a Customer for each item they even bought from ORDR

Basically, i would like to draw latest price of each item that i sold to this customer
This query works well with my formatted search, when i convert into a query it doesn't works, the query as below
SELECT ItemCode ,DocDate, Dscription, FrgnName,Available, Price
    FROM (
        SELECT T1.ItemCode ,T1.Dscription, T2.frgnName,T2.OnHand-T2.IsCommited as 'Available',T0.DocDate , T1.Price,
  Rank() over (Partition BY T1.ItemCode ORDER BY T0.DocDate DESC ) AS Rank
        FROM OINV T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry
        INNER JOIN OITM T2 ON T1.itemcode = T2.itemcode
          WHERE T0.Cardcode = [%0]
        ) rs WHERE Rank <= 1
Thank you to anyone out there can help

Hi,
Try this:
/* SELECT FROM [dbo].[OINV] P1 */
/* WHERE */
DECLARE @Cust nvarchar
SET @Cust=/* P1.Cardcode */'[%0]'
SELECT ItemCode ,DocDate, Dscription, FrgnName,Available, Price
    FROM (
        SELECT T1.ItemCode ,T1.Dscription, T2.frgnName,T2.OnHand-T2.IsCommited as 'Available',T0.DocDate , T1.Price,
  Rank() over (Partition BY T1.ItemCode ORDER BY T0.DocDate DESC ) AS Rank
        FROM OINV T0 INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry
        INNER JOIN OITM T2 ON T1.itemcode = T2.itemcode
          WHERE T0.Cardcode = @cust
        ) rs WHERE Rank <= 1
Thanks & Regards,
Nagarajan

Similar Messages

  • How to show stock price through web services for a company?

    to get best performance.. what is the best way to show stock price through web services for a company on an office 365 site?

    Hi,
    you can also do like this.
    Create a page using sharepoint designer. upload it in sharePoint.
    https://support.office.com/en-in/article/Create-SharePoint-site-pages-0ee31678-ee55-40cd-9f48-ea8700035dbd
    Whenever you see a reply and if you think is helpful,Vote As Helpful! And whenever you see a reply being an answer to the question of the thread, click Mark As Answer
    this is not the proper answer.. question was different.

  • Fetching unit_of_meaurement value for each item

    Hi ,.
    I want to fetch the value unit_of_measurement (MSEHI) value from table T006
    for each items
    I havent find any linakage
    How can i read these values for each item
    Thanks
    Anil

    I have a material number say, Grumpy. The report that I have shows the total sales for Grumpy for $13,000.00. Grumpy has other submaterials number says Grumpy_1, Grumpy_3, Grumpy_4, Grumpy_5. The report only shows the total quantity sold for each of these submaterials. Say
    Grumpy_1 = 800
    Grumpy_3 = 70
    Grumpy_4 = 1
    Grumpy_5 = 33
    I want to find a way to get an IO that tells me a price sold for 1 quantity, so that I can use it to find the total sold for Grumpy_1, Grumpy_3, Grumpy_4, Grumpy_5 that will add  to equal $13,000.00
    Thanks
    "<i>Sometimes I need what only you can provide: your absence.</i>" ~ Anonymous

  • The operation can't be completed because some items had to be skipped. For each item, choose File Get Info, make sure "Locked" is deselected, and then check t

    The following error comes up when I try to install the updated Firefox:
    "The operation can’t be completed because some items had to be skipped. For each item, choose File > Get Info, make sure “Locked” is deselected, and then check the Sharing & Permissions section. When you are sure the items are unlocked and not designated as Read Only or No Access, try again."
    When I follow the instructions in the error message, it shows that my user name has read and write access. There are a couple other items that are read only. I tried to change this to read and write, but the Sharing and Permissions options are greyed out and will not let me change them. What is the work around for this? I would really like to install the new firefox.
    Thanks.

    Hello,
    Certain Firefox problems can be solved by performing a ''Clean reinstall''. This means you remove Firefox program files and then reinstall Firefox. Please follow these steps:
    '''Note:''' You might want to print these steps or view them in another browser.
    #Download the latest Desktop version of Firefox from http://www.mozilla.org and save the setup file to your computer.
    #After the download finishes, close all Firefox windows (click Exit from the Firefox or File menu).
    #Delete the Firefox installation folder, which is located in one of these locations, by default('''This will NOT delete profile info such as bookmarks and history'''):
    #*'''Windows:'''
    #**C:\Program Files\Mozilla Firefox
    #**C:\Program Files (x86)\Mozilla Firefox
    #*'''Mac:''' Delete Firefox from the Applications folder.
    #*'''Linux:''' If you installed Firefox with the distro-based package manager, you should use the same way to uninstall it - see [[Installing Firefox on Linux]]. If you downloaded and installed the binary package from the [http://www.mozilla.org/firefox#desktop Firefox download page], simply remove the folder ''firefox'' in your home directory.
    #Now, go ahead and reinstall Firefox:
    ##Double-click the downloaded installation file and go through the steps of the installation wizard.
    ##Once the wizard is finished, choose to directly open Firefox after clicking the Finish button.
    Please report back to see if this helped you!
    Thank you.

  • SD - Accounting document line items are generating for each item

    Hi all of you,
    We have done account determination for SD. Accounting documents are also generating, but with in the invoice accounting document, number of line items are generating for each item with in the sales order, standard invoice type is F2 like -
    Item 001 - X Material
    Item 002 - Y Material
    Item 003 - Z Material
    The accounting document is -
    Line Item 001 - Customer Ac Dr
    Line Item 002 - Discount A/c Dr
    Line Item 003 - Sales revenue
    Line Item 004 - Discount A/c Dr
    Line Item 005 - Sales Revenue
    Line Item 006 - Discount A/c Dr
    Line Item 007 - Sales revenue
    Line Item 008 - VAT
    Even, in my experience I did not find this type of entry and the sales revenue and discount accounts are same with in the COA and is posted with in the plant.
    Please give me your valuable suggestion to rectify the above issue.
    Regards,
    Ramki
    Edited by: Ramki on Nov 5, 2009 10:06 AM

    Dear Ramki,
    This is SAP Standard. System generates Accounting document line item for each Line items in Invoice.
    This is standard & also required bacuase say you have different Material types in single Invoice (e.g.Material & Service items, Trading Goods, etc). The valuation class assigned to these Material Types may be different & you might want to post revenues from these Line items in different GL Accounts.
    Hope this helps. .
    Thanks,
    Jignesh mehta

  • Setting Inventory Accounts for each Item Grops

    Hi,
    1.I want to set the different Inventory Accounts for each goup in "ItemGrops" In ItemMaster.
    how can i set?
    2. in ItemMaster-> Inventory tab->Set G/L Accounts by option
    when i select the 'ItemLevel' and update it is showing error like
    '"Purchase credit account not defined for this item'"
    how can i rectify this error.
    plz help me asap
    Regards,
    Nagababu

    Nagababu,
    You have stated that you are trying to Set GL by Item Group.  If you want to set GL by Item Group, I am wondering why you are trying to change the setting in the Item Master area by ....ItemMaster-> Inventory tab->Set G/L Accounts
    If you want this setting to be a Global setting for all the Items then you have to set this in <b>Admin > System Initia.. > General Settings > Inventory Tab.... Set G/L Account by</b>
    After this... you can set the different G/L Accounts for each Item Group by accessing the Item Groups itself   <b>Admin>Seup>Inventory>Item Groups</b>
    For each Item Group in the Accounting tab you can set the different GL Accounts relevant to that Item Group
    In case for some items you want the GL's to be different (not based on the Item Group they belong to), then you could go to the Item Master > Inventory tab and change the settings to <b>Item Level</b> and Change the G/L as required.
    NOTE: You do not have to specify the G/L Account for each Item individually if you are going to be using Item Groups.
    Suda

  • The net price is calculated incorrectly for service items in contracts

    The net price is calculated incorrectly for service items. Iu2019m creating a contract for services, transaction ME31K (without service master). At the services level Iu2019m adding u201CConditions Supplementsu201D:
    -     PRS (gross price) =1000 EUR
    -     Z999 (discount) = -100 EUR
    -     ZPRS (cost) = 1500 EUR
    The gross price is calculated correctly = 2400. My problem is with the net price, with this example the net price is just 1500 this means that is just considering the condition ZPRS.
    Where can I customize the net price determination to considerer all price conditions?
    Thanks in adavnced

    Hi,
    In the service industries area, SAP uses two calculation schemata,       
    MS0001 for contract/master services (Z999 must be added to MS0001) and otherwise, MS0000. Assignment    
    occurs according to the Customizing settings defined under     
    'Materials Management -> External Services Management -> Maintain        
    Conditions for Services -> Conditions: Schema for Services'. If you want 
    to use another calculation schema for contract/master services, you must 
    define this with an own entry under Maintain Conditions for Services ->  
    Variable Calculation Schema for Services', for example, in the form 'K   
    WK value contract MSxxxx service schema', if a corresponding schema      
    MSxxxx has been defined first.       
    If Z999 is a header discount for the service outline level, it must be added to MS0002.
    Like the standard  discount condition type ZA00 the Z999 must have Cond. class   A  for Discount or surcharge in the condition type setting in the customizing, and no access sequence should be assigned to it.
    Please read the notes 798798 and 353482.
    Regards,
    Edit

  • IDOC to file: Increase sequence number for each item in a segment

    Dear All,
    I am having one scenario IDOC to file, where one IDoc with multiple items for an header in it will be sent.
    In Destination structure, for each iitem segment I am creating multiple rows. I have a field(INC_NUM) in target structure where in I have to start line number from 1 for each item.
    Also I have a condition - for item x or y I should only have the same line number.
    TinAdvance
    Swarna.
    Edited by: Swarna on Oct 24, 2011 8:15 AM

    Hello,
    You can use the statistic function called index for your requirement. Can you give sample input/output so that we can visualize further?
    Hope this helps,
    Mark

  • Do we document BOM information for each item in BR100 for BOM?

    Hi,
    I'm working on BR100 for BOM. I noticed that in BR100 BOM template there is not a section for the documentation of BOMs for each item. I wonder if the standard is not documenting any of that information in this document?
    Thanks a lot,
    Robert

    Hello Robert,
    BR100 explain all setups steps for modules.
    BOM for each item is not 'setup' but 'Data Management'.

  • Change fpla-rfpln for each item in the user_exit_move_field_to_fpla

    Hi,
    I used VA41 transaction to create a sale order (auart = u201CXXXXu201D) and i would like assign in the u201Cuser_exit_move_field_to_fplau201D a calendar number (fpla-rfpln) in my sale document, for each items line.
    But the program is passed on the u201Cuser_exit_move_field_to_fplau201D only for the configurable post (vbap-posnr = u201800010u2019) !!!!
    How can i do to go in this USER_EXIT for all items line and assign a calendar number? It is possible???
    Thanks
    Titou.

    Hello Titou,
    I don't know for your special case (this transaction) but in a user exit you can have access to global variables by using field-synbols.
    Declare a constant like this:
    constants : c_program3(30) TYPE c VALUE '(NameOfTheProgram)t_data'.
    You can dynamic assign of fiel symbols to get this global variable in your user exit.
    field-symbols : <k> type any,
                    <l> type any.
      ASSIGN c_program3 TO <k>.
      ASSIGN (<k>) TO <l>.
      if <l> is assigned.
      endif.
    So if in your program you have the all your items stored in a global variable, you can then modify all of them.
    Hope it helps.
    Olivier

  • Tree control tip strip for each item

    In tree control is possible set a Tip strip for each item (node) of tree?
    In tree control  tipStrip property seems relative to all tree.
    Thanks all.

    The only thing I can think of is to use an event structure
    use a mouse move event
    Get Cords
    Calculate what item the mouse is over
    Use a Tips property node to write the correct string.
    The hard part will be calculating what item the mouse is over, The Displayed Items property node should help.
    I am actively working on a program that is centered around a tree control and might like to do the same.
    If you need further help reply back 
    Omar

  • Processing for each item SDRQCR21 flag

    Hello all,
    What does mean the flag Processing for each item for ECC report SDRQCR21?
    Thanks in advance.
    Januario Faria

    Please read sap note 998102.
    Here the following is written:
    "Important information:
        o  With the 'Processing per item' option, the collective
           (summarized) requirements are no longer processed. Materials
           which belong to an atp group which summarizes the requirements
           are simply not checked for consistency."

  • Color for each item ring

    Hello,
    Is it possible to assign a different color for each item in a ring control ? See what I start in attached file.
    Thanks
    Attachments:
    enumeration_avec_couleur.vi ‏8 KB

    Attached is the LV 8.0 version.  I also added a control as described by Evan because I hadn't thought of it originally, but it is probably the best option -- it places text on color and doesn't require a loop to update.
    David C
    Applications Engineering
    Attachments:
    enumeration_avec_couleur2.vi ‏74 KB
    Control 2.ctl ‏6 KB

  • How to set command action for each item in the popupmenuimage

    Hi all,
    In my canvas application,i used images for popupmenu.Now i have to set command action for each item in that popupmenuimage.I dont know whether it is possible in canvas or not.Can anyone tell me the solution for this .
    Thanks,
    sourab

    Buttons is typical of a c/s application, or, in case of Web Forms, a Java applet. Instead of buttons, you have to use hyperlinks.
    See:
    http://otn.oracle.com/products/reports/htdocs/faq/faq_migration.htm#346
    The hyperlink wil have to be to a URL that does the insert in the table. This can be a mod_plsql procedure, for instance.

  • External ID (SSCC / EXIDV) for each item inside a heterogeneous pallet

    Hello experts,
    I need to generate an external ID (SSCC code) to each item (box) inside a multi-product HU(pallet) in my system.
    In normal operation, my system picks up a delivery and packs it, creating standard HUs (one fixed quantity of one material), and/or heterogeneous Hus (non-standard quantities of one or more materials) inside a pallet for each item in the delivery. Each pallet (HU) created has an entry in VEKP table and a distinct SCCC stored in field EXIDV. Iu2019m using shipping materials of type pallet.
    If I need a different SSCC to each BOX inside the non-standard pallet, what is the better approach?
    -     Create shipping a material with type BOX
    -     For each HU created, unpack it using BAPI_HU_UNPACK
    -     For each BOX inside the initial HU, create a shipping material type BOX with a new EXIDV (SSCC), and pack inside it a box, and then pack this shipping material back into the initial HU?
    To have one EXIDV for each box, I canu2019t group (sum) the quantities even if they correspond to a some material.
    This seems to me the only way to solve this problem, but it will be a hard work.
    Can someone point a simplest way to turn around this problem?
    Thank you
    Best regards
    Paulo Sousa

    I kept researching, I found some possible solution in this blog:
    https://blogs.oracle.com/xmlpublisher/category/Oracle/Templates/RTF
    so, I created a local SITE variable inside every cell to get the external SITE info:
    <Cell>
    <xsl:variable name="DIMID" select="DIMID"/>
    <xsl:variable name="SITE" select="{xdoxslt:get_variable($_XDOCTX,'SITE')}"/>
    <xsl:value-of select="/DATA/SITE/SITE_DATA[DATAGROUPID = $SITE]/YEAR[SURVEYYEAR = 2012]/DIM[DIMID = $DIMID]/ITEM[ITEMID = 0 and PUNFAV != 0]/PFAV"/>
    </Cell>
    but I get this error at run time:
    oracle.xdo.parser.v2.XPathException: Error in expression: '{xdoxslt:get_variable($_XDOCTX,'SITE')}'.
        at oracle.xdo.parser.v2.XSLProcessor.reportException(XSLProcessor.java:806)
        at oracle.xdo.parser.v2.XSLProcessor.newXSLStylesheet(XSLProcessor.java:571)
        ... 14 more
    What am I doing wrong?

Maybe you are looking for

  • How to save Checkbox inputs as a Variants in WD ABAP

    Hi, I am going through this nice blog [http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3414700)ID0832150950DB20043138143752756391End?blog=/pub/wlg/10731] which helped me creating varaint options for SELECT -optins fields. Everything works fine

  • Need to create a user policy form

    Can anyone help? I need to create a policy form in Dreamweaver CS4 that a user needs to accept, or not, before proceeding further to another page in my site? After they accept the form the functionality needs to take the individual to another page wh

  • I'm working in Preview and I'm not able to add my signature to a PDF. Moreover, the "Manage Signature" is always asking for a new signature.

    When I follow the directions in help for adding a signature. Preview asks that I provide a signature then click the location it should appear. Obviously I'm doing something wrong because the signature does not appear on the line I click.

  • How to Map OraData to Java

    Hi I'm trying to Map Oracle data to Java. Call some procedure which return nested table of object. I'm using thin driver. Here is my code. type test1 as object (data1 VARCHAR2(40),data2 varchar2(30)); type test2 IS TABLE OF test1; procedure test (ven

  • Emergency help needed re media manager

    Hi all, Hopefully somebody can help me with this. I am due to start an audio mix on a project for a client tomorrow. He currently has the FCP project on his Mac Pro but due to recording to a tascam portable recorder on set all his audio files are cal