Macro function

Hi
Is there any macro function in SCM 4.0 to add months to date.I want to write a macro which freezes the cells of a key figure after 6 months in the future horizon.
I could not find the macro function.
So a 'Z' function module was developed for this rerquirement.I am able to see this in the macro builder and i have used this FM in my macro.I checked ,generated and saved the macro.
When i want to test this macro with the test data i am getting ABAP dump runtime error.
Is this the problem with the variables that we have defined in FM?
It is highly appreciable if you can help me in this regard.Its very urgent.
Thanks in advance.
Raj

when you say freeze i suppose you mean making it "output only". is that right?
You may not have to define a function module for this.....
you use the macro function CELL_INPUT( 0 ) to get this functionality for one KF
you can also use COLUMN_INPUT( 0 ) for all KF
if you have a monthly book and when creating the macro, you make sure that the macro has the first iteration starting from the 6th month then this will work
there should be a sample macro in the 9AEXAM book with the same functionality
hope that helps

Similar Messages

  • "Macro" function like in Word?

    I cannot find the macro function (or whatever its called in Pages). I want to have a set of text, such as a return address, that I can call into a Pages document. Where does it live? Or what is it called so I can look it up in the manual? Thanks

    Dr. Dave wrote:
    Neither Cmd-V nor drop-down Paste enter the multi-line text. Oh, well.
    cmd + V works flawlessly.
    I typed my address in three lines in TextEdit
    selected it
    copied it in the clipboard then pasted it it the second field of the table in the Preferences dialog.
    It behaves flawlessly.which means that the field received the datas with the embedded return characters.
    Here is what we see in the preferences dialog.
    Here is what we see in the plist editor
    Here is what I get after entering addr1 (+ space) then addr2 (+ space)
    CAUTION : never put the cursor in the second field in the Preferences dialog. Doing that would remove the line breaks. It's easy to reset them but it's a bit boring.
    Yvan KOENIG (VALLAURIS, France) mercredi 28 juillet 2010 22:55:56

  • Use of APO macro function CHAR_VALUES_INPUT

    I am using APO V7.
    I am using the APO macro function CHAR_VALUES_INPUT to read in a resource name from the interactive user.
    Is there a way of making sure that the user entered data is left justified?
    (I am using the entered name in the RESOURCE_VARIANT function, and this function only seems to work if the resource name parameter is left justified, ie no leading blanks).
    Thanks for any advice on this...

    Hi,
    see SAP Note 1477144. It corrects this problem.
    Best regards
    Rico Frenzel

  • About NULL recognition of macro function in SCM7.0

    Hi expert.
    I have question regarding NULL value recognition of macro function in SCM7.0
    I want to know how to express NULL value in macro calculation.
    I already tried [= NULL], but does not working.
    Best regards
    Hinoki

    Hinoki,
    As Mani has suggested use the following function:
    IS_INITIAL(
    Row: <Your Row Name>
    ) = 1
    BUT MAKE SURE YOU USE "ROW ATTRIBUTES" IN THE ATTRIBUTES FIELD OF <Your Row Name>
    1= NULL or Initial
    0 = Not Null

  • Call Excel Macros function from Java

    Hi All,
    can u guide me How to call excel macros from java.
    The thing is first I have to enable macros and then call the macors function.
    Is this possible to call from Java. If yes guide me.
    Thanks in Advance

    Seems like something you'd have to do through COM.
    http://sourceforge.net/projects/jacob-project/
    HOW you do that is something you'll really have to figure out yourself, its not a Java question.

  • Macros, Function modules and subroutines

    Hi Experts,
    In performance wise which one is best macro or subroutine or Function module?
    Thanks.

    Hi Nandini,
    Each and every one has its importance in certain situations..
    Macros
    If you want to reuse the same set of statements more than once in a program, you can include them in a macro. For example, this can be useful for long calculations or complex WRITE statements. You can only use a macro within the program in which it is defined, and it can only be called in lines of the program following its definition.
    Subroutines can call other subroutines (nested calls) and may also call themselves (recursive calls). Once a subroutine has finished running, the calling program carries on processing after the PERFORM statement. You can use the USING and CHANGING additions to supply values to the parameter interface of the subroutine.
    Function modules allow you to encapsulate and reuse global functions in the SAP System. They are managed in a central function library. The SAP System contains several predefined functions modules that can be called from any ABAP program. Function modules also play an important role during updating  and in interaction between different SAP systems, or between SAP systems and remote systems through remote communications.
    Unlike subroutines, you do not define function modules in the source code of your program. Instead, you use the Function Builder. The actual ABAP interface definition remains hidden from the programmer. You can define the input parameters of a function module as optional. You can also assign default values to them. Function modules also support exception handling. This allows you to catch certain errors while the function module is running. You can test function modules without having to include them in a program using the Function Builder.
    Best regards,
    raam

  • DP macro function : FIXCALC()

    Hi all,
    Seeking the help of all APO gurus on the syntax for the function
    FIXCALC().
    I have already looked for help link below
    http://help.sap.com/saphelp_scm2007/helpdata/en/8f/9d6937089c2556e10000009b38f889/frameset.htm
    but unable to come up with the exact syntax of the function.
    Can somebody help
    Thanks in advance

    Dear Ankur,
    Quoting SAP Help:
    FIX_CALC( X1; X2:
    ) performs fixing calculation with X1 as the row containing the key figure with the value to be fixed and X2 the key figure for the fixed values. If the input check indicator is set (for instance X), the system tries to correct any inconsistencies that may occur due to changes being made on the detail level.  
    For example, a key figure has a value of 100 at the aggregate level and consists of three values at detail level 50, 30 and 20. You then change the last value to 40, the system will reduce the remaining levels so that the total is still 100.
    Macros using this function should not be used at detail level .
    Regarding the exact syntax, let me give you this example with the same K-F to perform FIX, you can find this example at your 9AEXAMPLES View( MacroExamples) MacroBook
    operate : ( 1,000 Iteraciones : 07.03.2005 ; 01.12.2007 )
       calculate {activity bar}
            FIX_CALC(
            Línea: KF1 (  de 07.03.2005 )
            Línea: KF1 (  de 07.03.2005 )
    No comma or ";" would be necessary as far as it works without it.
    Best regards,
    Carlos Rodríguez

  • Putting together some macro functions for Gnome

    I have a buddy that's trying to get some macros going in Gnome.  For example, Ctrl + T on the desktop would bring up a terminal, Ctrl + F would bring up Firefox, etc.  How would we do that?

    Just a quick tip, have your keyboard shortcuts involve the Windows (mod4) key. That way they won't conflict with any application specific keyboard shortcuts. For example, using Control + f to launch Firefox would conflict with using Control + f in Firefox for starting a page search, but Control + Windows + f would have no such problem.

  • How can I use the value returned for a function into the macro ??

    I create a function to work in a macro and I would like to use the value of parameter f_calc_error returned by function in a condition like IF, but I don't know how can I do that. I have to use the macro function CALC_ERROR ??
      Thanks.
    Edson Suzuki

    Hi Edson,
    Yes you need to use the CALC_ERROR macro function to be able to test whether the last macro function returned an error. CALC_ERROR will return an 'X' if there an error occured during the execution of the last macro function.
    You can use a macro similar to the following:
    IF
      CALC_ERROR( )
      = 'X'
          DO SOMETHING HERE
    ENDIF
    Let me explain how this works internally. The SAP system maintains a global variable g_flg_calc_error during the execution of macros in the planning book. The g_flg_calc_error variable will contain the value of f_calc_error that was set by the last macro function which executed. The ABAP coding of a planning book is something like this:
    data: g_flg_calc_error type /SAPAPO/FLAG.
    * SAP will pass g_flg_calc_error variable to all macro
    * functions. When SAP calls a macro function, it does
    * something like this.
    call function '/SAPAPO/MACRO_FUNCTION_HERE'
            exporting
              plob_values      = i_s_adv_plob_values
              sdp_book         = g_c_advf_sdp_book
              sdp_view         = g_c_advf_sdp_view
            tables
              cols_index       = i_t_cols
              value_tab        = l_t_value_tab
            changing
              f_calc_error     = g_flg_calc_error
    As you can see, the g_flg_calc_error variable
    is passed in the "changing" part of the call. The macro  function being called can then use the f_calc_error
    variable to change the value of the global
    g_flg_calc_error variable. In fact, the macro function being called can also check (by looking at the f_calc_error variable) if the last macro function reported an error.  The CALC_ERROR macro function just checks the value of f_calc_error parameter (w/c in fact is the value of the g_flg_calc_error variable) and returns "true/X" if the f_calc_error was set to true by the last macro function.
    Hope this helps in clearing things out

  • Pattern Matching functions in DP Macro

    Folks,
    Can anyone tell me if there are any pattern matching functions in DP Macros? Here is the requirement:
    If the time bucket is a quarter, then hide some rows. If the time bucket is  a month or something finer, then show the same row. Assume that all the time buckets in the data view will be the same (no telescoping buckets profile)
    So, suppose that I use BUCKET_DESCRIPTION and get the name of the bucket. If it is Q.* (using pattern matching lingo here), then I would like to set the row attributes accordingly. If it is M.* then set the row attributes to visible.
    Can you please throw some light on this? Would you do it some other way?
    Thanks,
    Satish

    Hi,
    You may try with the macro function BUCKET_DAYS(). This will find number of days in a given bucket.
    Then you can write condition, If bucket days is more than 1 and less than 7, then it is weekly.
    If bucket days is more than 7, then it is monthly.
    Please see if it is helpful for you.
    Regards,
    Manimaran M.

  • How to schedule macros to open a report , refresh and update database?

    Hi,
    We have the below set of steps that work on a deski environment. It works fine on XI R3.1 Fix pack 1.5, but I am unable to schedule and get the macros to run although i've included the entire macros code in - Private Sub DocumentAfterRefresh()
    Refresh of report
    Step 1 : Report is Refreshed. Refreshed data contains 10 Report Names to be opened by the Macros and the prompt values that these reports need to be refreshed with.
    Macros Functionality:
    Step 1 : Opens 1st report of the 10 reports from the repository in deski thick client, updates the database by setting a flag on the processing to Y or N for the report being processed.
    Step 2 : Refreshes the report with the prompt values obtained from the first refresh in the report, saves the refreshed data to a CSV or PDF at a location.
    Step 3 : Updates the database if the report has been genrated or not and then deletes the local copy of the output csv and pdf.
    The above steps repeat over and over again until all 10 reports open up, get refreshed and update the database.
    Now all of this works on Deski thick client/refresh and macros.
    However, when i schedule it, the macros doesnot seem to be running.
    Is the above scenario even possible to replicate via a schedule process..? 
    Note : The reports need to be retained in Deski itself.
    PLz help...!

    Scheduling Background Jobs 
    Use
    You can define and schedule background jobs in two ways from the Job Overview:
    Directly from Transaction SM36. This is best for users already familiar with background job scheduling.
    The Job Scheduling Wizard. This is best for users unfamiliar with SAP background job scheduling. To use the Job Wizard, start from Transaction SM36, and either select Goto ® Wizard version or simply use the Job Wizard button.
    Procedure
    Call Transaction SM36 or choose CCMS ® Jobs ® Definition .
    Assign a job name. Decide on a name for the job you are defining and enter it in the Job Name field.
    Set the job’s priority, or "Job Class":
    High priority: Class A
    Medium priority: Class B
    Low priority: Class C
    In the Target server field, indicate whether to use system load balancing.
    For the system to use system load balancing to automatically select the most efficient application server to use at the moment, leave this field empty.
    To use a particular application server to run the job, enter a specific target server.
    If spool requests generated by this job are to be sent to someone as email, specify the email address. Choose the Spool list recipient button.
    Define when the job is to start by choosing Start Condition and completing the appropriate selections. If the job is to repeat, or be periodic, check the box at the bottom of this screen.
    Define the job’s steps by choosing Step, then specify the ABAP program, external command, or external program to be used for each step.
    Save the fully defined job to submit it to the background processing system.
    When you need to modify, reschedule, or otherwise manipulate a job after you've scheduled it the first time, you'll manage jobs from the Job Overview.
    Note: Release the job so that it can run. No job, even those scheduled for immediate processing, can run without first being released.
    For a simple job scheduling procedure, see the R/3 Getting Started Guide.

  • Macro should only be executed for periods of current month

    Hello Experts,
    I am using fiscal year variant (FW) in which 4 periods exist for any month. Whenever I open the planning book, I will have to see only these 4 periods of the current month and Initial bucket.
    I have a macro, that should be executed for all these 4 periods of the current month at any time during the month.
    (aggregated sum of forecast of period 1 and 2 will be shown in bucket 2. aggregated sum of period 1,2 and 3 are shown in bucket 3, etc)
    So, I have designed the time bucket profile with past as 1 month of Fiscal year variant FW and future of 1 month of Fiscal year variant.
    My time bucket profile is 1 month - split into 4 periods of fiscal year FW.
    1) The macro runs fine if the current system date lies in the second period through fourth period. But during the beginning of the month, when it is in the first fiscal period of month, it displays past 4 periods as 4 periods of previous month and 4 future periods of current month. I just want to display all buckets or periods of current month only. How can I achieve this?
    2) So, during first week of the month, my macro runs only for past 4 periods and not for future 4 periods. But I want to run only from 1st period of current month till last period of current month. How to achieve this? Is there any macro function to overcome this? Or is there any standard configuration to avoid this problem?
    Thanks,
    Suresh

    Hi Marius,
    Thanks again. But, the macro code that I write, should be executed from the first period of current month to the last period of current month, even though, if the current system date is in the third period of the current month.
    Also the interactive planning grid should show all the periods of current month as visible, even though I'm not in the first period of current month.
    Thanks and Best Regards,
    Suresh

  • Can I use the value returned from a Text Function in another Formula?

    I'm writing a report in Hyperion System 9 BI + Financial Reporting Studio version 9.2. I have 2 grids in my report.
    Grid1 Column A is set up as a text function using the function type - <<GetCell("Grid2", 1, a, 1)>>. I would like to use the values returned from this text function in Column A (Grid 1) in a formula in Column B (Grid 1).
    Is it possible to use the values returned in Column A of the text function in another formula? My report does not seem to recognize Column A as numerical values, even though the values to be returned are numerical.
    If so, how do I recognize the values in Column A Grid 1 as numerical values and not text?
    Thanks for any help you can offer!

    Hi Edson,
    Yes you need to use the CALC_ERROR macro function to be able to test whether the last macro function returned an error. CALC_ERROR will return an 'X' if there an error occured during the execution of the last macro function.
    You can use a macro similar to the following:
    IF
      CALC_ERROR( )
      = 'X'
          DO SOMETHING HERE
    ENDIF
    Let me explain how this works internally. The SAP system maintains a global variable g_flg_calc_error during the execution of macros in the planning book. The g_flg_calc_error variable will contain the value of f_calc_error that was set by the last macro function which executed. The ABAP coding of a planning book is something like this:
    data: g_flg_calc_error type /SAPAPO/FLAG.
    * SAP will pass g_flg_calc_error variable to all macro
    * functions. When SAP calls a macro function, it does
    * something like this.
    call function '/SAPAPO/MACRO_FUNCTION_HERE'
            exporting
              plob_values      = i_s_adv_plob_values
              sdp_book         = g_c_advf_sdp_book
              sdp_view         = g_c_advf_sdp_view
            tables
              cols_index       = i_t_cols
              value_tab        = l_t_value_tab
            changing
              f_calc_error     = g_flg_calc_error
    As you can see, the g_flg_calc_error variable
    is passed in the "changing" part of the call. The macro  function being called can then use the f_calc_error
    variable to change the value of the global
    g_flg_calc_error variable. In fact, the macro function being called can also check (by looking at the f_calc_error variable) if the last macro function reported an error.  The CALC_ERROR macro function just checks the value of f_calc_error parameter (w/c in fact is the value of the g_flg_calc_error variable) and returns "true/X" if the f_calc_error was set to true by the last macro function.
    Hope this helps in clearing things out

  • How to call excel macros programmatically in C#?

    Hi,
    I have a requirement where i need to call excel (2003) macros in C# program. Can anyone help me with a code snippet to do the same?
    The excel macro function takes two input parameters? how can the parameters be passed?
    Any code snippet to do the same in C# would be helpful.
    Thanks.

    Hey there, Sid.  I am tryin gto run your code, but I couldn't even gte it to fire.  Here's what I ahve now:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using Excel = Microsoft.Office.Interop.Excel;
    namespace WindowsFormsApplication2
        public partial class Form1 : Form
            private void button1_Click(object sender, EventArgs e)
                //~~> Define your Excel Objects
                Excel.Application xlApp = new Excel.Application();
                Excel.Workbook xlWorkBook;
                //~~> Start Excel and open the workbook.
                xlWorkBook = xlApp.Workbooks.Open("C:\\Users\\Ryan\\Desktop\\Coding\\Microsoft Excel\\Work Samples\\Work Samples\\Historical Stock Prices.xlsb");
                //~~> Run the macros by supplying the necessary arguments
                xlApp.Run("ShowMsg", "Hello from C# Client", "Demo to run Excel macros from C#");
                //~~> Clean-up: Close the workbook
                xlWorkBook.Close(false);
                //~~> Quit the Excel Application
                xlApp.Quit();
                //~~> Clean Up
                releaseObject(xlApp);
                releaseObject(xlWorkBook);
            //~~> Release the objects
            private void releaseObject(object obj)
                try
                    System.Runtime.InteropServices.Marshal.ReleaseComObject(obj);
                    obj = null;
                catch (Exception ex)
                    obj = null;
                finally
                    GC.Collect();
    When I hit the play button nothing happens.  When I hot F5 nothing happens.  Do you ahve any idea what I'm doing wrong.  I'd appreciate any advice with this!! 
    Thanks!!
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • How to call excel macros in ODI

    Hi gurus,
    I am new In ODI please help me with this. i want to store sheet name of excel file in a variable.I have written a macro function for this please help me how to call that macro function in ODI
    Thanks & regards

    this are my thoughts ,since you will have to deal with multiple files and read multiple sheets . While dealing with Excel ,we have to deal with DSN and so multiple Excel can a be a little complex.
    I think we can make use of your macro function by calling via VB and once you find the correct value write a in separate txt File. Now this File can be called in ODI and read and processed as you wish to .
    Step 1. Call your Macro Function via VB
    Step 2. Call this VB program via OS Command, which write to a separate file.
    Step 3. Call this variable and read from the file via this methods http://odiexperts.com/?p=243 , http://odiexperts.com/?p=273.
    Does this helps you .

Maybe you are looking for