Total Sales = Sales Unit x Sales Price in same application

Hi experts,
I have read and tried some of the script logic in the forum but I'm still not able to get the results I want.
I have a application with the following dimensions: account,category,time,entity,datasrc,bussegment,inputcurrency,scd,vcd.
The same price apply to all combination of scd and vcd, the units will vary depending on the scd and vcd combination.
For example, when records are posted, the records in DB as follows:
Salesprice:
Account | Category | Time | Entity | Datasrc | Inputcurrency | SCD | VCD |
sprice | budget |2006.jan | HK | input | usd | sdump | vdump | $10
Salesunits:
Account | Category | Time | Entity | Datasrc | Inputcurrency | SCD | VCD |
sunits | budget | 2006.jan | HK | input | usd | aax | aan | 50 |
sunits | budget | 2006.jan | HK | input | usd | coc | cex | 100 |
TotalSales should be:
Account | Category | Time | Entity | Datasrc | Inputcurrency | SCD | VCD |
tsales | budget | 2006.jan | HK | input | usd | aax | aan | $500 |
tsales | budget | 2006.jan | HK | input | usd | coc | cex | $1000 |
Have tried using script logic:
[#tsales]=sunits * [scd].[sdump],[vcd].[vdump],[account].[sprice]. For this syntax, total sales will only be updated when salesunits is updated. The total sales remain unchange when there's a change in price.
Please advice on how should the price be retrieved?

Assuming you're on BPC 5.1 for MS, I'd recommend using SQL syntax not MDX.
Also, I'd recommend using InputCurrency as the dimension name in your rate app, not your reporting app. That's not critical, though. What is a little strange is that you're doing this data manipulation in USD, not LC. That's up to you, though.
// we take entity, category, time, SCD and VCD from the user's data submission
// entity, category & time require no shift of data
// but since we want to re-calc all SCD and VCD when the price changes,
// we need to pick up ALL members of these two dims
*xdim_memberset SCD = <ALL>
*xdim_memberset VCD = <ALL>
// fix other dims; this is optional
*xdim_member datasrc = input
*xdim_member inputCurrency = USD
// this is optional, but may help performance - but ONLY IF this is the only logic in your commit block.
*xdim_member account = SalesUnits
*lookup
*dim MyPrice:Account="SalesPrice"
*dim scd="sdump"
*dim vcd="vdump"
*endlookup
*when *
*is *
*REC(factor=lookup(MyPrice),account="TotalSales")
*endwhen
an alternate way of handling the when/if, if you want to be really, really belt & suspenders about it:
*when VCD
*is not VDUMP
*when SCD
*is not SDUMP
*REC(factor=lookup(MyPrice),account="TotalSales")
*endwhen
*endwhen

Similar Messages

  • Purchase and sales price on same screen

    Hi,
    I have to write a report that shows for some material / article whole PO pricing and whole Sales pricing, like VKP5 does.
    Is there any simple solution or function modules which can be called to catch proper pricings?

    hi,
    you can get tota purchase price of article by gettin its all PIR.
    Against article you get info record in EINA table and for all info record you get purchase price in EINE table.
    For sales price use tcode VK12.
    I hope you will get start.

  • Last purchase and sales price

    Dear Experts,
    I do require a report in which we can compare last purchase vs sales price of same item.
    Item Code,  description, last purchase rate, last sales rate ,     Profit  ,     %
    1234 ,            furniture   ,   1500.00  ,             1800.00  ,            300.00 ,    20%
    I can find last purchase price from master data but couldn't find last sales price.
    Any inputs will be highly appreciated.
    Regards,
    Ravi

    Hi,
    Try this query:
    SELECT case when T1.[ObjType] = 17 then 'OR' end as DocType,
    T1.[DocNum], T0.[CardCode], T1.[DocDate], T2.[ItemCode], T2.[Dscription], T2.[Quantity], T2.[Price] FROM OCRD T0 INNER JOIN ORDR T1 ON T0.CardCode = T1.CardCode INNER JOIN RDR1 T2 ON T1.DocEntry = T2.DocEntry WHERE T2.[ItemCode] = [%0] and T0.[CardCode] = [%1] Group by T1.[DocNum], T0.[CardCode], T1.[DocDate], T2.[ItemCode], T2.[Dscription], T2.[Quantity], T2.[Price],T1.[ObjType]
    union all
    SELECT case when T1.[ObjType] = 15 then 'DN' end as DocType,T1.[DocNum], T0.[CardCode], T1.[DocDate], T2.[ItemCode], T2.[Dscription], T2.[Quantity], T2.[Price] FROM OCRD T0 INNER JOIN ODLN T1 ON T0.CardCode = T1.CardCode INNER JOIN DLN1 T2 ON T1.DocEntry = T2.DocEntry WHERE T2.[ItemCode] = [%0] and T0.[CardCode] = [%1] Group by T1.[DocNum], T0.[CardCode], T1.[DocDate], T2.[ItemCode], T2.[Dscription], T2.[Quantity], T2.[Price],T1.[ObjType]
    union all
    SELECT case when T1.[ObjType] = 23 then 'QT' end as DocType,
    T1.[DocNum], T0.[CardCode], T1.[DocDate], T2.[ItemCode], T2.[Dscription], T2.[Quantity], T2.[Price] FROM OCRD T0 INNER JOIN OQUT T1 ON T0.CardCode = T1.CardCode INNER JOIN QUT1 T2 ON T1.DocEntry = T2.DocEntry WHERE T2.[ItemCode] = [%0] and T0.[CardCode] = [%1] Group by T1.[DocNum], T0.[CardCode], T1.[DocDate], T2.[ItemCode], T2.[Dscription], T2.[Quantity], T2.[Price],T1.[ObjType]
    union all
    SELECT case when T1.[ObjType] = 13 then 'AR' end as DocType,T1.[DocNum], T0.[CardCode], T1.[DocDate], T2.[ItemCode], T2.[Dscription], T2.[Quantity], T2.[Price] FROM OCRD T0 INNER JOIN OINV T1 ON T0.CardCode = T1.CardCode INNER JOIN INV1 T2 ON T1.DocEntry = T2.DocEntry WHERE T2.[ItemCode] = [%0] and T0.[CardCode] = [%1] Group by T1.[DocNum], T0.[CardCode], T1.[DocDate], T2.[ItemCode], T2.[Dscription], T2.[Quantity], T2.[Price],T1.[ObjType]
    union all
    SELECT case when T1.[ObjType] = 16 then 'SR' end as DocType,
    T1.[DocNum], T0.[CardCode], T1.[DocDate], T2.[ItemCode], T2.[Dscription], T2.[Quantity], T2.[Price] FROM OCRD T0 INNER JOIN ORDN T1 ON T0.CardCode = T1.CardCode INNER JOIN RDN1 T2 ON T1.DocEntry = T2.DocEntry WHERE T2.[ItemCode] = [%0] and T0.[CardCode] = [%1] Group by T1.[DocNum], T0.[CardCode], T1.[DocDate], T2.[ItemCode], T2.[Dscription], T2.[Quantity], T2.[Price],T1.[ObjType]
    union all
    SELECT case when T1.[ObjType] = 14 then 'AR' end as DocType,
    T1.[DocNum], T0.[CardCode], T1.[DocDate], T2.[ItemCode], T2.[Dscription], T2.[Quantity], T2.[Price] FROM OCRD T0 INNER JOIN ORIN T1 ON T0.CardCode = T1.CardCode INNER JOIN RIN1 T2 ON T1.DocEntry = T2.DocEntry WHERE T2.[ItemCode] = [%0] and T0.[CardCode] = [%1] Group by T1.[DocNum], T0.[CardCode], T1.[DocDate], T2.[ItemCode], T2.[Dscription], T2.[Quantity], T2.[Price],T1.[ObjType]
    Thanks & Regards,
    Nagarajan

  • No standard sales price shown

    Greetings,
    There is a question regarding the standard sales price in promotion. In the tab "Price Planning", there is a column named "Standard Sales Price", however, when I enter an article number, it shows as "0" while I use VKP2 to display the sales price, it can be shown.
    Is the standard sales price the same as the sales price calculated by VKP5? If not, where does the standard sales price be calculated?
    High appreciated your help. Thanks =)
    W.L

    Hi Wini,
    please be aware that you define in promotion header data an according organizational level (distribution chain) to determine the standard sales price.
    You can enter a default distribution chain in customizing per promotion type.
    Hope it helps.
    Regards
    Tobias

  • Sales Summary - Compare same weekday sales last year.

    Post Author: geoffh
    CA Forum: Formula
    I have a table storing invoices going back several years. I wish to calculate the total sales for yesterdays date, & compare it with total sales for the same weekday in the previous year. For example if it is Tuesday today, I need to calculate Mondays total sales (yesterday) & also Mondays total sales for the same week period last year.
    Date fields I have available are 'history.date_invoiced' (invoice date) , history.week_invoiced , history_year.invoiced. Sales values are history.sell_account & history.sell_cash.
    I'm new to crystal.......Using V 11.0.0.1282 . Any help would be greatly appreciated.

    Post Author: yangster
    CA Forum: Formula
    create a formula with the following informationnumbervar weeknumber_curr_year := datepart("ww", dateadd("d", -1, ));numbervar weekdaynumber_curr_year := datepart("d", , 1);  //assuming sunday is the start date of the week, change to 2 if monday isthose 2 variables will tell you the current week number and what day of the week you are after for the current yearnumbervar last_year := dateadd("yyyy", -1, currentdate);if year() = last_year and datepart("ww", ) = weeknumber_curr_year anddatepart("d", , 1) = weekdaynumber_curr_year then amt_field else 0put that in the details section and create a summary of the formula and you should have the total sum of sales for exactly the same week and day of week one year prior to yesterdaymaybe kai has a more simplified solution but that's what comes off the top of my head

  • Diffrent Unit sale Price in Different Warehouses of a same Product

    HI Experts
    I have an item in different warehouses I require different prices in each warehouse
    Kindly Suggest
    Tahir

    Hi Tahir,
    Prices are defined in Price List.  If you want to have Diffrent Unit sale Price in Different Warehouses of a same Product, you need to set up as much as price lists per warehouses.
    Thanks,
    Gordon

  • How to calculate current sale price like VA01

    Hi,
    I am developing one report, in which I am showing open sales order.
    Now, I wanted to calculate the current sales price from pricing procedures and conditions. Means I need the current sales price of the Item, like I am creating the new sales order today,
    Client wanted the difference between the sales order price and the current price.
    How can I get the current sales price, any Function Module for that?? Or I have to manually take all prices from condition tables and KONP, and calculate?
    I need a Function Module instead to code like..........
    Standard SAP pricing is try to get the price from top to down pricing hierarchy, if 1st level not find, then base on the combination of next level, try to get it,
    if no found, just keep going until reach the last pricing Level ( if found on any level then it will skip & pick up that price )
    For example
    ZPR0 has 3 Level
    Sales Org/DC/Currency/Customer/Material/Stor.Location
    Sales Org/DC/Currency/Customer/Material
    Sales Org/DC/Currency/Material
    If the combination of 1st level no price there, there it will go to the 2nd level until it reach the end.
    Thanks,
    Chetan Shah

    Hi,
    The Procedure for calculating MAP is :-
    Case 1 :- PO at different price
    If in Material Master your MAP is 0.8GBP & closing stock of 30Nos, value is 24GBP
    In PO if the price is 0.9GBP & qty is 10nos, then after Goods Receipt Total Value of the GR i.e. Qty * Price + any other delivery cost will be added to the material stock value.  Qty is also updated.  New Total Value / New Stock Qty will be MAP.
    In this case Qty received 10 & price is 0.9 that means value would be 9GBP.
    Total Value becomes 24GBP (Present Stock) + 9GBP (Goods Receipt) = 33GBP
    Total Qty becomes 30Nos + 10Nos (Goods Receipt) = 40Nos
    MAP becomes = 33GBP / 44Nos = 0.75
    Case 2 : Invoice Posting (MIRO) at different price than PO
    While doing MIRO is we post at different price system will check whether sufficient stock posted in GR is available.  In the above case it is 10Nos,
    If it is there, then the above logic as in case 1 will take place
    If not available, to the extent of stock availability system will post the different value & adjust MAP & remaining is posted to Price Difference Account.
    In your case it would be like this :
    1. MAP 0.8 for 30Nos (Value would be 24GBP)
    2. Invoice Posting 1.74GBP for 1No.  That means value would be 24GBP + 1.74GBP = 25.74GBP
         Qty would be 30+1 = 40
         MAP = 25.74 / 40   = 0.64GBP
    Hope this clarifies your doubt
    regards,
    JP

  • MIGO-Sales price for material (NL1S ROH1 ) could not be found

    Hi Experts
    When i doing MIGO , i am getting following Error Message .i.e.,
    *Sales price for material (NL1S ROH1 ) could not be found*Message no. M7158
    Diagnosis
    The sales price valuation is active in the valuation area.
    The system could not determine a sales price on the specified posting date for material NL1S ROH1 in unit of entry in plant .
    Sales price conditions may not be defined for the material in plant .
    Procedure
    u2022 If you have a goods receipt for a purchase order or an order, the sales price is taken from the purchase order or the order concerned.
    Check the sales price in the purchase order or the order.
    u2022 if you have goods movements without a reference, you can specify the sales value (sales price including sales tax) manually.
    If the screen does not have the field Sales price, then you have a Customizing error: the sales price valuation was activated in the valuation area, but the field selection of the movement type was not changed accordingly. In this case, contact your system administrator.
    u2022 Check the definition of the sales price.
    Note that for distribution centers, the sales price of the consumer distribution chain maintained in the distribution center's master data is used.
    Proceed
    If you post this movement without the sales value, the movement will be valuated with value zero. This can change the average sales price.
    Please Advice us ...
    Thanks in advance
    Regards
    Rajesh .P

    Hello,
    Please check the following:
    -check with SE16 at table T001K whether you have sales pricing active for your valuation area,does your material belong to a very special material type
    -Check SAP Note 84480 ,109881
    -No sales price exists, no goods movements can be posted for an article subject to value-based inventory management. You must maintain the sales price in all cases.
    Please refer the link below:
    http://help.sap.com/erp2005_ehp_04/helpdata/en/12/085e95470311d1894a0000e8323352/frameset.htm
    hope the information is helpful
    regards

  • VA01 and from material view and last SO it shows wrong last sales price

    Hi,
    In sales order condtions the current flow is as follows:
    sales price PR00 - 8.36
    insurance ZZC0 - 0.03
    So the total value is 8.39 inr.
    But the client requirement is, the total value should be 8.36 only.  Insurance value should not add to the net price, but it should display in sales order condtions.
    we can do the pricing as statistical in pricing procedure for insurance.  But  client is not accepting for that.
    please letme know is there any other alternative way to get the required solution.
    look forward for your answers.
    thanks in anticipation.
    br,
    Hari.
    Moderator message: not directly related to ABAP development, please post again in the appropriate functional forum.(ERP SD?)
    Edited by: Thomas Zloch on Jul 13, 2010 2:43 PM

    When you use the query as a formatted search with auto refresh the query will Populate the Value of the first column from the first row of the query result.  Therefore the user will not see the last 2 prices for which the SELECT statement was created.
    To see the last 2 prices the user has to manually press ShiftF2 which is the same effort as CTRLTab.
    Writing a simple SQL is easy but it is important to educate the client with the benefits of using out of the box functionality when one already exists
    -Suda

  • How to Prohibit Sales Price Lower Than Material Standard Cost

    Hi Moderators:
    I got a problem from our sales departement, because they found a manual mistake, that was, somebody who maintained a incorrect sales price in the condition record which was lower than the standard price in the material master data! This must be a error!
    My question is, how to customize in SAP system and prohibit to maintain the sales price (LT standard price) in the condition record? Maybe system could issue a "Warning" or "Error" message to the user before saving the changes!
    I'm highly appreciated that you can help me to solve the problem. Thanks in advance.
    Have a good day and best regards
    Z.T

    Hi Zhang
    If I have understood correctly, you want that, when the "Selling Price" is less then the "Cost" , system should give you warning or should prohibit from futher processing.
    That means, system should not allow negative Profit.
    If this is the requirement, then you can not set it in the Condition record.
    You need to make the settings in the Pricing Procedure.
    Go to your Pricing Procedure and for the condition type VPRS(Cost) make the below mentioned settings.
    Sub Total -  B,
    Requirement --- 4'
    AltCTy  - 5  and save the settings.
    Now when you create an order with Negative Profit ( Selling Price is less then Cost),system will give you warning and if  you will try to save then system will regard this document as Incomplete.

  • How can calculate tatal price (sales price + Tax)?

    Hi,
    I set the pricing procedure and result of this can be appear in the net value as follow:
    Net Value = Sales Price - Discount.
    But I defined tax condition type that system calculated but it did not show in the sales order screen.
    I know , I can not see tax in the net value , but I want to know:
    1- How can I  see the result of all Tax condition in the sales order?
    2- Is it tax filed in the sales order?(I can not find it yet)
    3- How I can have total price in the sales order, because I want to create invoice in VF01?
    4- Can I have total price (Sales price - Discount + Tax)  in the VF01?
    Thanks a lot.

    Maintain Tax Condition Type as statistical in the Pricing Procedure.You will get Tax value in the Tax Tab at Item Level.
    Also maintain Total Price at a new step after all the Condition Types so that you will get the Total Value at Sales Order Level.While creating Invoice ,you will get Total Price through Copy Control.
    Best Regards,
    Ankur

  • Total sales values by material and plant

    Hi,
    I was trying to extract the following information:
    material number, plant, total sales qty(2006), and total sales amount(2006) from sap table. So, can any one help me with the table or a report where in I can find all this information.
    Thanks
    Putta

    Hi,
    Good evening and greetings,
    You can get the info from the Table BSEG as below
    BSEG-BUKRS = Company Code and a Sales Org is attached to a Company Code
    BSEG-GJAHR = Fiscal Year
    BSEG-DMBTR = Amount in Local Currency
    BSEG-PSWBT =  GL Account Amount
    BSEG-HKONT = GL Account Number
    BSEG-MATNR = Material Code
    BSEG-WERKS = Plant
    BSEG-MENGE = Quantity
    BSEG-MEINS = Base Unit of Measure
    You have to execute the report with the following input parameters in SQVI
    Company Code
    GL Account Number = Revenue Account
    Fiscal Year
    You will get all the info from the system in the single table.
    Please reward points if found useful
    Thanking you
    With kindest regards
    Ramesh Padmanabhan

  • Calulate sale price of material

    hi all
    how to calculate sale price of a particular material can anybody help,suitable points will be rewarded

    Hi,
    There are few ways to do this. Whether you require master data or transaction data.
    If you require master data price , then you can go to Vk13 t-code, put the condition type as PR00 and press enter. It will give a list of radio buttons based on access keys. You need to choose the valid combinations of the access keys and execute. Then the sale price for the given material will be available.
    basically you need to go to a ny table starting with A5, this you need to check with your SD consultant, who has mapped the price in the system, based on access keys. Then from A table you will get the conidtion record no - KNUMH. Pass this value and line item no in KONP table to get the price. The field name is KONP-KBETR.
    Or else go to MBEW table. Pass in material and plant as valuation area, and get the fields VERPR( Moving Average Price/Periodic Unit Price) or STPRS ( Standard price).
    Regards,
    JLN

  • Report on open sales order ,total sales

    Hello Gurus
    I am developing a report line item wise of sales order in which i need to get
    Suppose a sales order is created on 01.12.2009 for 1000 quantity
    billed quantity in december 600
    billed quantity in january     200
    1) total sales done against this SO line item wise.
    2) sales in this month againt this SO
    3)open order qty as 01.01.2010
    4)last day sales i.e from 01.01.2010 to 20.01.2010 the date of last sales against this SO
    so my output should be
    total sales = 800
    sales in this month =200
    open order qty as on 01.01.2010= 400
    please tell me the logic
    regards
    sphoorthi
    Moderator message - Please do not post your requirements and ask the forum to do your work for you - post locked
    Edited by: Rob Burbank on Jan 20, 2010 10:47 AM

    Hi,
    I gather from your thread that the question is not to build a report on a MP yes/no but more on which MP.
    Depending on the reporting needs and on how well you are able to combine the 2 cubes in the new MP I would say go for the latter option so you have more control on this one MP (for example if you need to add something that is already available in cubes).
    However, when (future!) reporting needs could mean that characteristics need to be added to the report(s) and filtered on that are not in both cubes you will have major problems getting the data properly from new MP and you would be better off using the individuals MP's and combine the data in a workbook or in a web template giving more flexibility.
    So you need to really analyze the requirements and decide on the way forward. Keep in mind possible future requirements because for now it could seem these few fields could be enough but new requirements could directly give a problem.
    Hope this helps
    C.

  • How to see customers total sales orders value

    Dear all,
    How can I create a query to see all customers total sales orders value.
    I have tried MC+E transaction, it is not giving accurate values when compare for a customer with VA05N report.
    moreover it doesn't have filter option.
    Please help me to resolve the issue. Your suggestion will be highly appreciated.
    Best regards,
    Raghu ram

    Hi,
    Try S_ALR_87012171  and S_ALR_87012186.   or
    S_ALR_87012160, select customer lite items only, enter customer number.
    Click on dynamic selection (Shift+F4). enter RV in document type field and press execute.
    Regards,
    Chandra

Maybe you are looking for

  • Script result not showing up in narrative view

    I'm making a org chart as a narrative view. If I do not tick "Contains HTML Markup" the result of the script is displayed. If I cut-n-past that content into a HTML file it display the result I'm looking for. However if I tick "Contains HTML Markup" t

  • Problem in compiling the sample applet

    hello: im installed jdk 1.2.2 now i wanna folow the instruction written in the PDF document.i did everything as it is but when i arrived to the step "compiling the sample applet" i issue the command " javac -g src/com/sun/javacard/samples/helloWorld/

  • WL number range issue

    Dear all, i am getting an error at deliver level. as the message showing as "Number range for transaction/event type WL in year 2011 does not exist" there are already number ranges maintained for doc type WL as the interval showing as 49. how and whe

  • Exit to set current date as default

    Hai Gurus, One of our clients require to set the current date as default billing date when perfirming vf01. As you know in vf01, if we dont specify any date, the system would take the default date from the delivery date. We found an exit for this req

  • Cant get rules to work with pz:div tag

    im using commerce server 2.0.1 with sp1 i made a rule sheet and rule and rule selectors through the wlpsadmin tool and then i was trying to base content inside a portal using one of the rule selectors and the pz:div tag. this is what the jsp page has