APO-DP Macro formula query

Hi SAP experts,
I'm having a problem in a planning book in which a negative value appears in a consumed AATP in which negative value should not occur. Because of this a customised functionality was affected. This was the formula of the macro:
Carry Over Alloc w = MAX (AATPw-1;0) + HUB Inventory Sat w
Thus MAX (AATPw-1;0) means that if the value is in negative, the macro will calculate this as zero? For example -150 is the value of AATPw-1, Hub inventory is 200. Thus the macro having a automatically change this -150 to 0 and calculating it to:
Carry Over Alloc w = 0 + 200
Please help on what MAX (AATPw-1;0) means.
Thanks in advance!
Raymond

Hello there...yes you are right...the function Max(1....n) will return the maximum value in the range 1....n and so from your example if u have -150 to 0 as your interval then Max would return 0..
Hope this helps!
Thanks!

Similar Messages

  • APO DP MACROS

    Hi Gurus,
    I am New to APO  DP module, I am working on APO DP Macros, My Requirement is on (FORECAST+PROMOTION=ACTUAL FORECAST).
    Could anyone help me out how to write Macros on the same.
    Thanks
    Ganesh

    Hi,
    Below is the sample screen on how you can define the macros in Transaction /SAPAPO/ADVM for your planning book/data view.
    Also time horizon/KF can be changed as needed -
    Hope it helps.
    Regards,
    Alok

  • APO SNP macro working at a product level (across locations)

    I am using APO V5.1.
    I have a macro requirement where I want to perform calculations at a product level (ie for a given product, look across all relevant locations).
    I can do this interactively by selecting a product.
    But in a background job I can only select the 9AMALO level of aggregation.
    Does anyone know how I could get round this?...

    Hi,
    Could you please give some more details of your exact requirement?
    Since you mentioned about 9AMALO, I would assume that you want something to be done in SNP, but it's not clear what you could do in interactive SNP which you are not able to achieve in background job.
    If something is possible in foreground, most likely it would be available in background as well, and we can give you the solution after you give some more details.
    Thanks - Pawan

  • Error in formula(query designer)

    Hi guys,
    I have a formula in query designer.Its showing wrong value.Cannot understand why?
    Formula:
    (-1) * (Actual.present month < Actual previous month) + 1 * ( Actual present month >= Actual previous month )
    Actual present month and Actual previous month both are selections and are also shown in query.Eevnthough,Actual Present month is equal to Actual previous month,result is showing -1.
    I checked Sign settings in Formula properties but they have right settings for 'Keep +/- sign' as it is chosen.Exception aggregation is chosen as Total.I tested by changing it to standard aggregation but its the same.
    Is there any setting I need to change.
    Thanks for your help.

    Hi ravi,
    It didnot solve the problem.In my case ..  its working for all other company codes but failing only for this company code and that too from Januari this year....
    To other authors:
    Thanks for your replies.This is existing in our Production query and for this month,it started showing wrong value...for febraury,actual month value is equal to actual previous month(January)..so it should show 1 but its showing -1. so we noticed.I havent changed anything to log out and log in and check.Also,the result should be 1,-1...so I cannot use max funtion as mentioned by Jaya.
    Any different ideas of achieving this are welcome.

  • Customer built function in new formula (query designer)

    Hi we have got a problem, we want to built our own function that we  can use for different cubes and Queries. (like Operators)
    Did anyone knows a way to develop this?

    Hello Dirk,
          Its not about the visibility in the query about the 'Selection' but when i am trying to define a formula using a selection (which has both key figure and characteristic) and a key figure, the formula takes only the key figure in the selection but doesn't involve the characteristic. So i would like to know how to define a formula using a selection which involved both key figure and characteristic.
    Thanks,
    Anjali

  • Largeer of two rows in macro formula

    Hi,
            I have three key figures, A, C, E in my planning book. I need to write a formula as follows:
    Result = E / greater of (A or E)
    My problem has been to find out a way to write the formula in macro to choose the denominator as greater of either A or E in that bucket
    Can some body help me with this? Is there any macro function or operation that can be used?
    Thanks.

    Hi Raj,
    If you are a technical guy, you can create a BADI implementation for that macro and manipulate the matrix data like the way you want.
    the procedure to implement a BADI is
    1.SPRO --> SAP SCM - Implementation Guide --> Advanced Planning and Optimization --> Supply Chain Planning --> Demand Planning (DP) --> Business Add-Ins (BAdIs) --> MacroBuilder -->  Additional Functions for Macros.
    create a new implementation by copying the class for the BADI defenition '/SAPAPO/ADVX' and write your own code in the method '/SAPAPO/IF_EX_ADVX~USER_EXIT_MACRO     '. There is a sample code and proceedure explaining how to handle the data in the internal tables C_T_TAB and C_T_TAB_OLD. the calculations can be made with help of I_T_LINES, I_T_COLS which are rows and columns tables.
    find out the the row and columns of the grid to be read and do calculation and then put the result in the desired cell.
    Please let me know if you need further assistance.
    Regards,
    Srini.
    Award points for the helpful answers

  • Macro in query

    Hi all!
    I would like to know how (if possible at all) to assign VBA macro to a query, not a single workbook. I want it to be executed when running a query.
    Will appreciate any hints!

    Hi Marek,
    This is not possible, it can only be achieved by BEX since it is embedded in excel. There is no such functionality for queries.
    Regards,
    Michael

  • Excel formula query

    Hi
    In cell Q21
    I have this formula =IF((O21-P21>0),(O21-P21),"")
    In cell R21
    I have this formula =IF((O21-P21<0),(O21-P21),"")
    In column O
    I have cumulative totals which adds up all cells from column D:N.
    In column P
    I need to type in the actual costs.
    As it is at the moment when no figures have been typed into column P, the figures in column
    O appear in column Q. Can I change my formula so the cells in column Q appears
    as blank until figures have been entered into column P?
    Thanks
    Viv Haig

    Hi,
    Just checking in to see if the information above was helpful. Please let us know if you would like further assistance.
    Cheers,
    Tony Chen
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please contact
    [email protected]

  • APO DP Macro for Blank Values

    HI all
    In SCM 5.0 the system now distinguishes between 0 values and Blank values.
    I am trying to get a macro to run if a value in DP is Blank (not Zero)
    I cannot find a function in the Macro builder to do this. 
    Can anyone help?
    regards

    somemore information on IS_INITIAL macro funtion
    IS_INITIAL()
    Syntax
    IS_INITIAL( Key Figure )
    Key Figure: Row, column, or cell element (data source = row attributes)
    Description
    The IS_INITIAL function returns the value 1 if the cell is initial. (The column results from the current step iteration; the row is determined by the Key Figure parameter.) Apply this function for key figures that can distinguish between zero values and initial values. This function is not available if the compatibility mode is activated for the macro book.

  • Formula Querying....

    Hi to All,
    In col A ->2 dims(Periods,Scenario).From Period dimension I'm selecting Qtr1 to Qtr4.From Scenario
    Actual And Budget.
    Here i need to create a formula in col B as var(Actual,Budget) for Qtr1 only.
    How to do this?
    Like this way i need build the report for all Qtrs(Qtr1 to Qtr4).
    any ideas...?

    You should be able to use 6 columns in the report build, which should expand to 12 columns on the actual report:
    Column A = Periods & Actual
    Column B = Periods & Budget
    Column C = column&#91;A(1)&#93; -column&#91;B(1)&#93; (Q1 var)
    Column D = column&#91;A(2)&#93; -column&#91;B(2)&#93; (Q2 var)
    Column E = column&#91;A(3)&#93; -column&#91;B(3)&#93; (Q3 var)
    Column F = column&#91;A(4)&#93; -column&#91;B(4)&#93; (Q4 var)
    Is this what you want to show? There's no way to have the calculation columns (C-F) in one column only.

  • APO DP - Macro Test Tool

    Hi,
    I have tried to test a number of macros using the standard test tool as follows:
    - from within the Macro Builder, I choose Utilities > Test Macros
    - I add some test values to the key figures displayed in the test tool
    - I select my macro and execute
    So far I have no results and it seems to me that the test tool is not executing the macro nased on the values I have assigned to the key figures.
    Does anyone have any advice please?
    Many thanks

    Hi Anthony,
    It will work if you test in Utilities > Test Macros.
    i tested a simple scenario...
    macro:delete Stat2...it deletes the statistical forecast value from current month.
    i entered the values for current month and next month,i executed the macro..it deleted the values.
    could you please check what is the horizon for your macro in the sense in which month it has to work.
    could you please see the below snap shot
    Thanks,
    Naga.

  • How to Concatenate 2 Variables in SAP APO DP Macro

    Hi All
    I am trying to concatenate 2 variables in a single third variable. Can some body please guid me on how this can be achieved
    e.g.  I have a variable containting a characteristic Value - "1010101" and Another Variable have a number "12345"
    I want to show a string -  "1010101 with value 12345"
    Can somebody please guide on how this can be achieved
    Any help in this regard is highly appreciated
    Thanks
    Vijay

    Hi Vijay,
    Try with with the command STRINGS_CONCATENATE().
    Syntax
    STRINGS_CONCATENATE ('String1'...'Stringn')
    Thanks and Regards,
    Mariano

  • ASO MDX query in outline??????

    Trying to write a MDX query for the Account member
    Hierarchy:
    Account
    A001
    A002
    A003
    A008
    Scenario
    AG00
    AG01
    AG06
    AG08
    AG09
    Organization
    ETCE
    E023
    E024
    E070
    I need to caluculate for the Account AG08 the value should be derived from AG07 and for the same account AG08 for the Organization member "E070" the value should be same as AG09 ( i.e AG09 = AG08 )
    I writen below query at the level "0" retrival query is good but when i use the Top level query "ETCE" parent level the value in "E070" is eliminating . Query writen below
    NONEMPTYMEMBER [A001],[A007]
    CASE
    WHEN (IS([Organization].CurrentMember, [E070])) THEN
    ([A009])
    WHEN (IS([Scenario].CurrentMember, [AG00])) THEN
    (([A007] * -1)/100)
    WHEN (IS([Scenario].CurrentMember, [AG01])) THEN
    (([A007] * -1)/100)
    WHEN (IS([Scenario].CurrentMember, [AG02])) THEN
    (([A007] * -3)/100)
    WHEN (IS([Scenario].CurrentMember, [AG03])) THEN
    (([A007] * -10)/100)
    WHEN (IS([Scenario].CurrentMember, [AG04])) THEN
    (([A007] * -20)/100)
    WHEN (IS([Scenario].CurrentMember, [AG05])) THEN
    (([A007] * -80)/100)
    WHEN (IS([Scenario].CurrentMember, [AG06])) THEN
    ([A007])
    ELSE
    Missing
    END
    At Bottom level "0" results are coming as expected but Its not working at the top level Organization ETCE level Please help ????
    Thanks
    Venu
    Edited by: user13351102 on Oct 28, 2011 5:19 PM
    Edited by: user13351102 on Oct 28, 2011 6:31 PM

    Guru's any help on this ASO Member formula query ??

  • Macro Date Function

    Hi Gurus,
    Is there any Date Function in SAP APO DP Macros which can give No. of weeks in a Fiscal Year. ?
    Also, let me know if can achieve this through an ABAP code  ?
    TIA..
    Regards
    Lalit

    Hi Gurus,
    Is there any Date Function in SAP APO DP Macros which can give No. of weeks in a Fiscal Year. ?
    Also, let me know if can achieve this through an ABAP code  ?
    TIA..
    Regards
    Lalit

  • Help needed I have a canon 40D. I am thinking of buying a canon 6D.But not sure that my len

    Hi all help needed I have a canon 40D. I am thinking of buying a canon 6D.
    But not sure that my lenses will work.
    I have a 170mm/ 500mm APO Sigma.
    A 10/20 ex  Sigma   HSM  IF.
    And a 180 APO Sigma Macro or do I have to scrap them and buy others.
    ALL Help will be greatly received. Yours  BRODIE

    In short, I love it. I was going to buy the 5DMark III. After playing with it for a while at my local Fry's store where they put 5DMII, 5DMIII and 6D next to each other, using the same 24-105L lens, I decided to get the 6D and pocket the different for lens later.
    I'm upgrading from the 30D. So I think you'll love it. It's a great camera. I have used 5DMII extensively before (borrowing from a close friend).
    Funny thing is at first I don't really care about the GPS and Wifi much. I thought they're just marketing-gimmick. But once you have it, it is actually really fun and helpful. For example, I can place the 6D on a long "monopod", then use the app on the phone to control the camera to get some unique perspective on some scenes. It's fun and great. GPS is also nice for travel guy like me.
    Weekend Travelers Blog | Eastern Sierra Fall Color Guide

Maybe you are looking for

  • Some photos pulled from iPhoto turn green when placing them in a project. Is there any way to fix this?

    I am using a Macbook Pro with 2GHz Intel Core i7 processor; 8 GB 1333 MHz DDR3 memory and OS 10.9.4. I have iPhoto 9.5.1 and iMovie 10.0.4. I have a project with video, and have added some still photos from my iPhoto Library. All of the photos appear

  • Customizing ODBC errors in OBIEE 11g

    Hi, I have a requirement where the user is expecting to see some Custom error messages instead of the Default ODBC errors OBIEE throws. Like the one below. Error generating view. Error getting cursor in GenerateHead   Error Details Error Codes: OAMP2

  • Pdf download not appearing in safari download tab

    Hi Recently I have discovered a problem,whenever I download a document the document automatically appears in the safari download tab (the tab with the arrow facing downwards) however this does not occur for pdf files. The pdf will download and go str

  • Connecting vcr to external SB Audigy 2zs Platinum Pro

    I've just joined, so apologies if I "mess up". I have some precious things on vhs tape, and want to transfer them to cd/dvd. I run Windows XP. I have to use rca connections, don't think there's another option on the vcr. I see the red and white rca c

  • JAXB: Abstract Types and Substitution Group Errors

    I am using several schemas as defined below: Schema 1 defines an abstract type Schema 2 extends abstract type Schema 3 makes reference to abstract type in 1 and is using substitution groups on the abstarct type The error only occurs when the element