Getting Total Order Cost for each order

I have a fact table, order lines.
There are two dimension tables, customer & Product.
For each order i want to display on a pivot table:
- the cost of the line.
-the cost of the total order. 
Is this possible? I have been playing with ALL & All except but have not found a solution yet. some metadata is below
CustomerID CustomerName
1 john
2 mary
3 jim
4 kevin
ProductID ProductName Price
1 pen 5
2 cup 4
3 car 7
4 phone 3
OrderLineID CustomerID ProductID Quantity
1 1 2 2
1 1 3 2
2 2 1 4
3 1 2 5
3 1 2 4
3 4 4 6
4 4 4 6

Hi Winston,
Could you kindly provide an example of the output you'd expect based on the above data? Also, I've noticed that there is no OrderID column in the order line table. How would you determine which OrderLineIDs belong to a single order?
Regards,
Michael Amadi
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to vote it as helpful :)
Website: http://www.nimblelearn.com
Blog: http://www.nimblelearn.com/blog
Twitter: @nimblelearn

Similar Messages

  • Total actual cost for a given PM Order

    hello all,
    how do i get total actual cost for a given PM order (in IW33 under cost tab we have total actual cost)..
    is stored in table or do i need to use any function module.....
    thanks in advance....

    Hi Vinay,
    You can use the following logic for extracting the Actual cost of a PM order.
    Pass the Order No (AUFNR) in Table AUFK and fetch the Object number (OBJNR).
    Pass OBJNR value in table COEP.
    You can get the actual cost of the order in COEP table.
    Please mark this as correct if it resolves your issue.
    Regards,
    Joydeep

  • Move Order Numbers for Sales Orders

    Hi Every one,
    I got a Requirement Like Below.
    After booking the Orders in Sales Orders form, we will pick release the Orders.
    In our Sales Orders, we are giving the Subinventory from where the Item has to be fetched in the Ware House, while creating the Orders.
    For us,While Pick releasing the Orders,We are getting multiple order numbers grouped under a single move order Header. But we require a distinct move order to be generated for each of the Sales Order.
    Please Help me by suggesting how this can be accomplished.
    Thanks in Advance,
    Karthik..

    Gerry,
    There is standard way as I can see it. As you should be knowing the architecture is to create the picking batch fist (which in turn becomes your move order number) and then loop through for all eligible orders to create move order lines. The way to beat this is to create a batch for each order number. You can create custom program and loop through your eligible order lines and pass order number to picking batch.
    If you are on R12( may be even 11.5.10.2), you can use WSH_PICKING_BATCHES_PUB. create_batch and release_batch. Just pass your order number also to to the record. What it does basically is creating a picking_batch (move order number) for each order.
    Thanks
    Nagamohan

  • How to analyse actual cost for each operation in Process/Production Order?

    Hi all,
    IN SAP, I know that we can analyze plan cost for Operation in Process Order/ Production Order.
    However, I can not analyze Actual cost for Operation .
    I know the object when I good issue material is ORDER, not OPERATION.
    But, as requirement of users, they want to analyze actual cost for each Operation.
    CAn SAP do this analyze?
    If Yes, What should I do in SAP to have this reports?
    THanks in advance,
    Emily Nguyen

    Hi Emily,
    as I see from one other message that you're using material ledger. Then your expectation is apparently to also see the actual costs of materials in your production order by operation.
    This is not supported. Actual material costs are handed up in material ledger multi-level settlement from one material to the next, bypassing the production orders.
    That means the production order will always contain the material costs valuated at plan price, not at actual price.
    For activity prices that might be better, when you revalue the orders at actual activity prices with CON2. But even there I am not sure that it will always be assigned correctly to the operations.
    There is currently an enhancement in development, the operation level costing. But that will affect more the planned cost side not the actuals. Might be interesting to learn more about your requirements and the use case behind.
    best regards,
                      Udo

  • Sales order - show total plan costs (from production order) on sales order

    Hi all,
    I have the following question/scenario:
    We create prodction order to collect cost (hours) for a service. There exists also a material master for this service.
    The confirmed hours are posted on the production order and then setteld to the respective sales order (settlement rule SDI).
    What to I have to maintain/customize to show the total plan cost (for the service) on gthe sales order?
    If I check the sales order via VA03 --> environment --> cost report , I can see the planned sales revenue but no planned costs?
    (the actual value flows work so far, postings via settlement or billing document).
    I hope the topic is understandable. Any ideas?
    Thanks in advance.
    Edited by: Butch66 on Sep 27, 2010 7:07 PM
    Edited by: Butch66 on Sep 27, 2010 7:08 PM

    Hi
    Planned costs from prod order can not show on sale order.. Both are 2 separate entities in their own respects
    Unless you calculate sales order cost estimate on your sales order, you cant see planned costs on sale order...
    To calculate sale order cost estimate, make settings in your requirement class...
    1. Go to procurement tab of sale order
    2. See whats the requirement type
    3. Go to IMG > Controlling > Prod cost Contr > Cost Obj Contr > Prod Cost by Sales Order > Control of Requirements
    4. Here you can see mapping of req type to req class....
    5. If you want to have sales order costing and have sales order as CO object inorder to have sales order wise profitability, you should have following settings in Req class...
    >Acct Assignment Category should be E
    >Costing: Either Blank or X
    >Costing Id and Costing Method: As per your requirement
    Regards
    Ajay M

  • Purchase order number for each postings with FBL3N

    Hello
    With tcode FBL3N, I need to get all the postings on expenses accounts. Additionally it is possible to get more information on the postings from the orginal paper invoice. It shall be also more convenient to get the purchase order number walk trhough SAP with it. Then is it possible to get the purchase order number for each postings with FBL3N?
    thanks for inputs
    sb

    Hello,
    Could you please add field BSEG-EBELN as a special field in FBL3N (from
    menu path Settings -> Special fields).
    Then, select the Purchase order field again from "Change Layout"
    (Ctrl+F8). Now this field is available for display variants, it has the
    technical name 1-U_EBELN and the description 'Purchase Document'.
    The other field has the same description but as technical name
    '1-EBELN'. When you create a display variant be aware that you select
    1-U_EBELN and not 1-EBELN.
    *******Please also refer to attached notes 215798 and 984305.
    Best regards, Hana

  • Seperate Adobe Form printing for each order

    Hi,
    I have a scenario where i need to print Adobe Form for each order.
    Right now i am handling this from print program(Executable) by looping at the Adobe form FM for each order.
    So it will print seperate Adobe form for each order with corresponding Header & Item Data.
    To get next order i need to hit on right & last arrows etc...
    So right now i am handling it through Print Program.
    Is there any way it can be handled directly at Adobe Form level.
    By passing all orders to Adobe FM at a time (Intsead of looping) and handling Adobe Form printing for each order at Adobe Form level itself!
    Thanks in advance.
    Thanks,
    Kumar.

    simple,
    create one new program  not driver program . Then u have to call that FORM
    1.Get all the data created during the dates.
    split the data into , based on the date ranges.
    2.
    loop at itab1.
    perform open_form
                write_form
                close_form
    endloop.
    loop at itab2.
    endloop.
    1) I need to print the form automatically when an Order is created.<b>---->COnfig</b>
    2) Every June 15th and Dec 15th I need to print the form for that Order
    automatically with some other data.
    <b>---> what ? what u split ?</b>
    *--Similarly I need to trigger the form in this way automatically for all Orders.
    <b>---> Config+ABAP</b>
    How can I trigger the Form automaticall for the above requirement
    Regards
    Prabhu

  • Total Planned and Total Actual Hours for service order

    Hi,
    Is there is any table in which I can directly find the Total Planned and Total Actual Hours for service order.Pl suggest.
    Regards
    SB

    Sorry SB, didn't read your post properly... I thought it was costs you were after...
    AFVV holds the total actual work at operation level.
    PeteA

  • How to get the back order quantity for sales Order

    Hi Friends,
    I want to get the back order quantity for sales order . in MD04 t-code,
    there is a field(MDEZ-MNG01) for Received Qty/ Required qty.  But MDEZ is a structure.
    I tried from MDTB table, but the table is not updated with the values in MD04.
    Please guide me from which table I can get the back order Qty for sales Order
    (ref: t-code  MD04, MRP element = CusOrd).
    Thanks,
    Sagar

    >
    VIdya Sagar wrote:
    > Hi,
    >
    > Isn't  there any difference b/n Open Sales Order and Back order??
    Yes Quite Difference.
    Read:
    http://www.sap-img.com/sap-sd/explain-the-meaning-of-an-open-sales-order.htm
    http://help.sap.com/saphelp_sbo2005asp1/helpdata/en/b6/bdb9b2f02842348c9edbe78af863c4/content.htm

  • BAPI KPF6 POST PLAN COST FOR INTERNAL ORDER AND COST ELEMENT

    Hi all gurus,
    I would like to use in a custom report a BAPI/Function Module that help me to simulate KPF6 in order to post planning costs for internal order and cost element (layout 1-401).
    So the input should be:
    1) Version
    2) period from
    3) periodo to
    4) year
    5) internal order n.
    6) cost element n.
    7) value
    I found a lot of BAPI but don't know the correct one and how to use it (example how to fill the input value).
    Can anyone help me on that?
    Kind Regards

    In additio  to the previous I found the BAPI_COSTACTPLN_POSTPRIMCOST but don't know if it's the correct one and how to use it (some example fitting the my case will be very appreciated).
    If the quoted BAPI is correct.
    I tested it filling all fields as following:
    HEADERINFO:
    CO_AREA=FFCA
    FISC_YEAR=2008
    PERIOD_FROM=001
    PERIOD_TO=012
    DOC_HDR_TX='blank'
    INDEXSTRUCTURE:
    OBJECT_INDEX=000001
    VALUE_INDEX=000004 (hope this point at Interna Order)
    ATTRIB_INDEX=000000
    COOBJECT:
    OBJECT_INDEX=000001
    ORDERID=ZO53-08IMZ
    TOTVALUE:
    VALUE_INDEX=000004
    COST_ELEM=3224048
    FIX_VALUE= 200,0000
    DIST_KEY_FIX_VAL=2
    The Return table is set to 0. Nothing happens.....I suspect something related to indexstructure or index is wrong..
    Could anyone help me on that?
    Kind Regards

  • Generating an IDOC for each Order present in the file (File to IDOC)

    Hi ,
    I have a requirement where in i have to generate an idoc for each orders present in a file . Initially i had implemented 1:N mapping by changing the occurence of idoc to 1..unbounded & using it as external definition i was able to generate multiple idocs.
    But now the requirement is that even if one record contains invalid data , then XI shoul process remaining records(which has  valid data) & then raise an alert for the invalid record . I have implemented this approach by using BPM (splitting the message) & the sending out each record as a single message to (1:1 mapping between file & IDOC).
    But now they dont want me to use an BPM . They want me to come up with an approach using 1:N mapping only where in i can make sure that the mappig doesnt fail even if there is one invalid record ,they want me to process remaining records & raise an alert for the invalid one .
    As far as i know this cant be done without BPM . Please let me know any valuable suggestions or inputs if there is any
    Regards
    Vinay P.

    Hi Vinay,
    Had a similar requirement few days back..
    What we did was to do a multimapping of 1:N where N = N1 and N2, N1 is the Idocs which you are doing today, N2 is the set of invalid records...
    Now we have written this as a file and then created another interface which will pick the file and based on the name of file we decided the To address. We have used mail package and this interface (file to mail ) was made as a generic one so that it can be used across many interfaces...
    filename and To address relationship was maintained as a value mapping in ID... You can have a thought of this approach and try to send the invalid records as a mail rather than alert.
    Regards
    Suraj

  • Sale order costing for Trading goods

    Dear Experts,
    My client having retail industry.Client used to sold customers also like outwright customers direct sales not through retail stores. Now business would like to check margin agasinst one sale order through costing. My SAP working enviornment is IS Retail ECC6.0.
    1. Is it possible to do sale order costing for trading goods.(Goods p[urchased for all stores not particular customer)
    2.Wihtour BOM is it possible?
    3.Please forward any user docs ,if possible that costing
    Costing sheet like this
    1.Trading goods
    2.Packaging materila
    3.Overheads.Planned
    Beat Rgds
    Suma

    Answerd with Condition type

  • Function module unit costing for sales order

    hello all!
    is there a way to create a unit costing for sales order using a function module? i found module K_UNITCOSTING_CREATE - has anyone used that before?
    best regards,
    matthias

    hello!
    i have no master data as basis for unit costing. instead i would like to use information from sales order conditions in unit costing.
    best regards,
    matthias

  • Getting the first row for each group

    Hi Everyone,
    I have a query which returns a number of rows, all of which are valid. What I need to do is to get the first row for each group and work with those records.
    For example ...
    client flight startairport destairport stops
    A fl123 LGW BKK 2
    A fl124 LHR BKK 5
    B fl432 LGW XYZ 7
    B fl432 MAN ABC 8
    .... etc.
    I would need to return one row for Client A and one row for Client B (etc.) but find that I can't use the MIN function because it would return the MIN value for each column (i.e. mix up the rows). I also can use the rownum=1 because this would only return one row rather than one row per group (i.e. per client).
    I have been investigating and most postings seem to say that it needs a second query to look up the first row for each grouping. This is a solution which would not really be practical because my query is already quite complex and incorporating duplicate subqueries would just make the whole thing much to cumbersome.
    So what I really new is a "MIN by group" or a "TOP by group" or a "ROWNUM=1 by group" function.
    Can anyone help me with this? I'm sure that there must be a command to handle this.
    Regards and any thanks,
    Alan Searle
    Cologne, Germany

    Something like this:
    select *
    from (
       select table1.*
       row_number() over (partition by col1, col2 order by col3, col4) rn
       from table1
    where rn = 1In the "partition by" clause you place what you normally would "group by".
    In the "order by" clause you define which will have row_number = 1.
    Edit:
    PS. The [url http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/functions004.htm#i81407]docs have more examples on using analytical functions ;-)
    Edited by: Kim Berg Hansen on Sep 16, 2011 10:46 AM

  • T-codes to get total runnig hours for machine and lab

    Plz tell any one t-codes to get total runnig hours for machine and labour against the prodduction order or work center wise ..
    Thanks & Regards
    Punit SIngh

    Hi pjd,
    I'm sorry to hear of your problem getting help with your issue.  Have you checked this thread to see if there's any useful information in it that would help you get this resolved?? 
    If the information there does not help, please advise and I'll try to get you to the proper department to get this resolved for you.
    Regards,
    KaLin
    Verizon Forum Moderator
    If a forum member gives an answer you like, give them the Kudos they deserve. If a member gives you the answer to your question, mark the answer that solved your issue as the accepted solution.

Maybe you are looking for