Function Reference and Table Sort

I have a table that I use to track numerical data to a fixed size table.
After adding new data I sort the columns, for example in descending order.
My question is this, is it possible to specify the references in say the Average Function to refer to the same cells, eg the bottom 10, in the table and not be affected by the sort. Another way to describe this is that I would like to always average the bottom 10 cells and not have this change with the sort command.
thank you

Thanks to both of you.
In fact I was not satisfied.
the initial formula assumes that every cells in the column are filled (minus the bottom one used ase a fake footer)
For those whose use doesn't match this requirement, here is an enhanced one.
=AVERAGE(OFFSET($A$1,COUNT(B)+1-10,1,10,1))
I wrote +1-10 to make clear what is done:
+1 because the COUNT() function doesn't count the header row
-10 to leave 10 filled cells in the calculated range
Jerry : it seems that you missed that I often used this function to define a range of cells. I must say thank you to Bugs Hunters because some months ago I asked them because I didn't correctly understood the function's behavior and they took time to explain what I missed.
While working on this question, I encountered what I feel as a gap in the Help. It states:
To copy cells within or between tables, drag selected cells while holding down the _Option key_ . Any values in the destination cells are replaced.
They forgot to add: "and then drag the selection by its border" as it is written for the move feature.
An alternate protocol works to move a group of cells:
select such a group
press the shift key.
drag the selected block where we want.
Yvan KOENIG (from FRANCE mardi 14 octobre 2008 19:31:42)

Similar Messages

  • Function references and stateful cfcs?

    Using 8.0.1
    ok, i have a happy component (example4.cfc):
    <cfcomponent output="false">
    <cfscript>
      variables.txt = "un-init";
    </cfscript>
    <cffunction name="Init" access="public" returntype="example4" output="false">
      <cfscript>
      variables.txt = "init";
      </cfscript>
      <cfreturn this />
    </cffunction>
    <cffunction name="remoteEcho" access="remote" returntype="string" ExtDirect="true" output="false">
      <cfargument name="str" type="string" required="true" />
      <cfreturn str &  "[" & variables.txt & "]"/>
    </cffunction>
    </cfcomponent>
    and I am trying to call a function reference like so:
    <cfscript>
    cfc = CreateObject('Component', 'Example4').Init();
    method = cfc['RemoteEcho']; //<- try to create function reference
    </cfscript>
    <cfdump var="#cfc#">
    <cfdump var="#method#">
    <cfdump var="#cfc.remoteEcho('bobo')#"><!--- this works, naturally --->
    <cfdump var="#method('bobo')#"><!--- failure here --->
    The problem that I am running into is that it cannot find the variables.txt private member.
    Element TXT is undefined in VARIABLES.
    The direct call works fine, however the reference acts as if it's, i don't know, a regular UDF outside of a cfc?
    Any help here, or will this just not work?
    -Jim

    As far as I know it will not work if you're accessing private
    variables because I seem to remember that the function reference is
    not tied to the cfc instance.
    Mack

  • Function FUNCTION FILE_GET_NAME and table FILENAMECI

    I have an ABAP program that calls FUNCTION 'FILE_GET_NAME' with only the logical_filename and operating_system parameters.  ex:
    CALL FUNCTION 'FILE_GET_NAME'
        EXPORTING
          logical_filename = 'Z_SAP_TO_GAINS'
          operating_system = 'NT'
        IMPORTING
          file_name        = g_output
        EXCEPTIONS
          file_not_found   = 1
          OTHERS           = 2.
    This gets the physical file name correctly when run / debugged in DEV/TST and PRD.
    ex:
    DEV :
    serverT01\GAINS2\test\
    TST : 
    serverT01\GAINS2\test\
    PRD : 
    serverP01\GAINS01\
    I can see that FILENAMECI has different entries for Physical file (FILEEXTERN) in DEV and TST than it does in PRD.  I have read that transaction FILE can be used to maintain this Physical path, but it seems that best practice is to transport that from DEV.  How then, is our file path in FILENAMECI different in PRD?  Moreover, what is the best way to change this so that the function will retrieve the correct server name path when run in each environemnt.  Apparently the parameters to replace nodes in the physical path name were not used when this was designed.
    Is there a way to maintain the path without making ABAP changes to the application program?
    Thanks for your help!
    Jeremy

    Hi Shailesh,
    Thank you for the response.  I understand, and have found, that the way to change the FILENAMECI entries in TST and PRD is to migrate them.  Unfortunately, since the file paths need to be different in those environments, migrating a static file path from DEV all the way to PRD doesn't meet the need for DEV and TST once it is migrated.  I can see how this would be great if the substitution design had been in place for this file path/name, but it was static and didn't allow for "variable substitution".
    I did not have time with the project to rework this, so I did what the previous developer must have done and migrated it to PRD static for PRD and will rename FILENAMECI again afterwards, and re-migrate that file name as far as TST.
    When time allows, after this project is closed, I'm committed to cleaning this mess up.
    Thanks
    Jeremy

  • Can we move SAP standard Function Group and Table defintion to BW

    Dear Forum,
    We are in a ‘pilot’ process of migrating SAP R/3 Custom development objects to our BW client and we have a few questions that we would like to know if possible.
    We are currently in the ‘To Be’ Blueprint Phase of migrating SAP 45B to ERP2005 as a Ramp-Up customer and we need to determine as soon as possible the feasibility of moving one particular Custom application
    from our SAP R/3 environment to BW.  This application primarily performs computational processing and does reporting of the results at the
    conclusion
    We have selected one Custom R/3 ABAP program to do a ‘pilot’ to determine the feasibility of migrating it to the BW platform. This Custom program utilizes objects from standard SAP Function Groups which are non existent in BW.  In this particular case Function groups KMS0
    (Cost Center Selection) and KAB2 (CO Reporting: General).
    Questions:
    Are we allowed to move these 2 standard SAP Function Groups to BW ? Would it alter the BW environment integrity as intended and designed by SAP?
    If we move the Function Group KMS0 and KAB2 will
    SAP support our BW environment if we decide to move them?
    Would it be considered a ‘SAP Best Practice’ to move standard SAP R/3
    objects to BW?
    Thank you in advance for your help,
    Paulo Silveira
    [email protected]

    Hi Paulo and welcome on board !
    Please don't post twice the same question...(look in the other one...)
    ..and don't forget to rewards the answers...it's THE way to say thanks here !
    Anyway, I'd suggest to close this thread to avoid to receive answers in both threads...
    Cheers,
    Roberto

  • Resource for R/3 functional processes and table structures

    Dear Experts,
    I want to have brief but concise understanding of R/3 modules in aspects of business process flows, table important table structures. Ideally, the document or book should phrase it in a way easy for non-functional people to understand. I am sure as Abap Developers, you gurus have to understand business processes & tables all the time. Appreciate some help here. I am even willing to pay a sum for such resource.
    My contact : [email protected]
    regards,
    Bryan

    Hi Bryan,
    There's one PDF file on the web which I think is okay. Here's he link -
    http://www.auditware.co.uk/SAP/Extras/SAPTables.pdf
    Please let me know whether or nor this is what you are looking for.
    Regards,
    Anand Mandalika.

  • How to find function module's and tables used for the particulat screen or TCODE?

    Hello Nation,
    I would like to know how to find the  function modules and tables used for the particular screen or TCODE or program.
    Example : I would like know the function module used in the program RDBGFT?
                     How can i find that?
    Thanks in advance ,Awaiting your reply.

    Make use of Find function  with the keyword "CALL FUNCTION".
    Make use of the same find function with the keyword "Select" to know the database tables used.
    Regards,
    Philip.

  • How do I reference multiple tables in SSAS Data Source View Named Calculation functionality?

    Hi SSASers - 
    On the Data Source View node of SSAS Visual Studio Interface, I want to create a named calculation that references multiple tables. Something like: CASE WHEN tableA.Column1 = 'Y' Then tableB.Column1 ELSE tableB.Column2 End, but the compiler throws an error
    here "Deferred prepare could not be completed". 
    What is the syntax for referencing multiple tables on this node or how else can multiple tables be used to create a calculated value in SSAS? I'm new to SSAS and so far have been building big views and building calculations this way. Another option is the
    Calculation tab off the cube node but this calculation will need to be based off of dimensions AND measures so please provide a syntax example here also. 
    Thanks in advance!
    Carl

    Thanks Jiri! The named query functionality off the Data Source View node is exactly what I was looking for - it's just a view on the SSAS side of things instead of the relational dbase.
    Sorry for the delayed answer verification - got pulled into something else last week. Carl 
    Carl

  • "Changing" parameter and "Tables" parameter defintions in function module

    If one defines "Changing" or "tables" parameters, they are treated as reference parameters.
    It becomes obvious for "tables" parameters where one does not have option to check box for "Pass by Value". But for "Changing" parameters, they provide the checkbox for "Pass by Value". Even when you select this option, the function module seems to handle the parameter as a reference parameter (whatever changes you make to it in the function module are retained when you return back to a calling program).
    My question is why then SAP has provided the checkbox of "Pass by Value" for "Changing" parameter?
    Thanks.
    Jitendra Mehta

    Hi Chaiphon:
    Thanks for explanation but I know the theory of "Pass by reference" versus "Pass by Value".
    Let me rephrase my question.
    When I use the importing parameter (say as a table with a dictionary table type) with reference (not "passing by value"), and if I modify the value of the parameter, the calling program (which calls function module) receives the changed value after the call.
    When I use the importing parameter with "Pass by Value" box checked, the modifications made to the table inside the function module is not retained after the code leaves function module and returns to the calling program.
    My question is why not the same behaviour with the "Changing parameter" in function module definition?
    And if Changing parameters are always reference parameters, then why SAP has provided the "Pass by Value" check box?

  • Reference field and table for AUFK for F4 help in alv.

    Hi All,
       I need to put F4 help on ALV for order no (AUFK) what is the reference field and table for that?
      i tried giving field as aufk and table as ccss but its not working.
       ls_fcat-ref_field = 'AUFNR'.
        ls_fcat-ref_table = 'CCSS'.
    Thanks & Regards,
    Ruchi Tiwari

    Hi,
    Try this.
    Set the f4 help for the field in the fieldcatalog
      ls_fcat-f4availabl = 'X'.
    1. Create a event of ONF4 for the alv grid.
    2. Set the event handler.
    3. Append the field for the F4 help in the internal table and call the below method
        CALL METHOD g_mprn->register_f4_for_fields
        EXPORTING
          it_f4 = i_f4.
    4. create a class definition and implementation
        refer sample pgms (BCALV_F4, BCALV_GRID_EDIT_DELTA and BCALV_GRID_EDIT)
    Hope this may be helpful.
    Regards,
    Sharin.

  • Doubt in  export, import and table para when creating Function Module

    Dear fellow ABAPers,
    I have a doubt in defining export, import and table parameter while creating a function module.
    I am calling a function module inside a user exit. Now in the user exit the SAP fills an internal table called i_lfa1 with all the data user has eneterd.
    Now I want to pass this whole internal table to function module and the perform some checks on the values of internal table.
    After that function module fills an error structure with values depending on some check.
    1)
    How do I pass this internal table to function module ? 
    When I am creating function module in se37 where do I define this iternal table type ? Is it in Import or Table parameter during function module creation?
    2)
    Where do I define error structure type (which is returned by function module to main program)? Is it in Export or table parameter during function module creation?
    Please clear my doubt..
    Relevant points will be awarded.
    Regards,
    Tushar.

    Hi Tushar,
    1. How do I pass this internal table to function module ?
       I assume u are creating your own Y/Z FM.
       Pass it thru TABLES parameter.
    2. When I am creating function module in se37 where do I define this iternal table type
       Define this in TABLES interface.
       What Type ?
       THE SAME TYPE WHICH HAS BEEN DEFINED
        WHILE PASSING IN THE USER-EXIT FUNCTION MODULE.
       IF U SEE THE FM OF THE USER-EXIT,
       U WILL COME TO KNOW.
    3.
    Where do I define error structure type (which is returned by function module to main program)? Is it in Export or table parameter during function module creation?
    Define it in TABLES interace. (not in export, import)
      (Since what u are going to return is an internal table)
      U can take for eg. BDCMSGCOLL.
      OR u can create your own Y/Z structure
    for the same purpose.
      (or u can use the structure type T100)
    I hope it helps.
    Regards,
    Amit M.

  • Help on CAST function, defining TYPE TABLE and using a REF cursor

    Hi,
    I have written a procedure (lookup) inside a package (lookup_pkg) as shown below.
    Procedure has an output variable of type PL/SQL TABLE which is defined in the package.
    I want to write a wrapper procedure lookupref to the procedure lookup to return a ref cursor.
    CREATE OR REPLACE PACKAGE lookup_pkg AS
    TYPE t_lookup_refcur IS REF CURSOR;
    CURSOR c_lookup IS
         Select columns1,2,3,....100
                   FROM A, B, C, D, E
                   WHERE ROWNUM < 1;
    TYPE t_lookup IS TABLE OF c_lookup%ROWTYPE;
    Procedure lookup(id Number, o_lookup OUT t_lookup);
    End lookup_pkg;
    CREATE OR REPLACE PACKAGE BODY lookup_pkg As
    Procedure lookup(id Number, o_lookup OUT t_lookup) IS
    BEGIN
    END lookup;
    Procedure lookupref(id Number, o_lookupref OUT t_lookup_refcur) IS
    o_lookup t_lookup;
    BEGIN
    lookup(id, o_lookup t_lookup);
    OPEN t_lookup_refcur FOR
    SELECT *
         FROM TABLE(CAST(o_lookup AS t_lookup));
    Exception
    End lookupref;
    END lookup_pkg;
    When I compile this procedure, I am getting invalid datatype Oracle error and
    cursor points the datatype t_lookup in the CAST function.
    1. Can anyone tell me what is wrong in this. Can I convert a PL/SQL collection (pl/sql table in this case) to PL/SQL datatype table or does it need to be a SQL datatype only (which is created as a type in database).
    Also, to resolve this error, I have created a SQL type and table type instead of PL/SQL table in the package as shown below.
    create or replace type t_lookuprec as object
                   (Select columns1,2,3,....100
                   FROM A, B, C, D, E
                   WHERE ROWNUM < 1);
    create or replace type t_lookup_tab AS table of t_lookuprec;
    CREATE OR REPLACE PACKAGE BODY lookup_pkg As
    Procedure lookup(id Number, o_lookup OUT t_lookup) IS
    BEGIN
    END lookup;
    Procedure lookupref(id Number, o_lookupref OUT t_lookup_refcur) IS
    o_lookup t_lookup;
    BEGIN
    lookup(id, o_lookup t_lookup);
    OPEN t_lookup_refcur FOR
    SELECT *
         FROM TABLE(CAST(o_lookup AS t_lookup_tab));
    Exception
    End lookupref;
    END lookup_pkg;
    When I compile this package, I am getting "PL/SQL: ORA-22800: invalid user-defined type" Oracle error and
    points the datatype t_lookup_tab in the CAST function.
    2. Can anyone tell me what is wrong. Can I create a type with a select statement and create a table type using type created earlier?
    I have checked the all_types view and found that
    value for Incomplete column for these two types are YES.
    3. What does that mean?
    Any suggestions and help is appreciated.
    Thanks
    Srinivas

    create or replace type t_lookuprec as object
    (Select columns1,2,3,....100
    FROM A, B, C, D, E
    WHERE ROWNUM < 1);You are correct that you need to use CREATE TYPE to use the type in SQL.
    However unless I am mistaken you appear to have invented your own syntax for CREATE TYPE, suggest you refer to Oracle documentation.

  • The InitCVIRTE function is not listed in the NIDAQ function reference online help? Why? and where can I find a description of this function?

    the InitCVIRTE function is not listed in the NIDAQ function reference online help? Why? and what does she do?and where can I find a description of this function? Can i use this function with visualc++ 6.0?

    The InitCVIRTE function is in the CVI run time engine (cvirte.dll)..not part of NI-DAQ.
    Applications written or using CVI may call this function..
    How are you running into this ?
    From the CVI help...
    This function performs initialization of the CVI Run-Time Engine. It is needed only in executables or DLLs that are linked using an external compiler. Otherwise, it is harmless.
    It should be called in your main, WinMain, or DllMain, function. The parameter values you should pass depend on which of these three functions you are calling InitCVIRTE from. The following examples show how to use InitCVIRTE in each case.
    If you are using main, your code should be as follows.
    int main (int argc, char *argv[])
    if (InitCVIRTE (0, argv, 0) == 0)
    return -1; /* out of memory */
    /* your other code */
    return 0;
    If you are using WinMain, your code should be as follows.
    int __stdcall WinMain (HINSTANCE hInstance,
    HINSTANCE hPrevInstance,
    LPSTR lpszCmdLine,
    int nCmdShow)
    if (InitCVIRTE (hInstance, 0, 0) == 0)
    return -1; /* out of memory */
    /* your other code */
    return 0;
    If you are creating a DLL, you must call InitCVIRTE and CloseCVIRTE in your DllMain function, as in the following.
    int __stdcall DllMain (void *hinstDLL, int fdwReason,
    void *lpvReserved)
    if (fdwReason == DLL_PROCESS_ATTACH)
    if (InitCVIRTE (hinstDLL, 0, 0) == 0)
    return 0; /* out of memory */
    /* your other ATTACH code */
    else if (fdwReason == DLL_PROCESS_DETACH)
    /* your other DETACH code */
    CloseCVIRTE ();
    return 1;
    NOTE: The prototype for InitCVIRTE is in cvirte.h, not
    utility.h.
    NOTE: In CVI 4.0.1, this function was expanded from one to
    three parameters. Executables and DLLs that were
    created using the one-parameter version of the function
    will continue to work properly.
    /*-------------------- Prototype ---------------------*/
    int InitCVIRTE (void *HInstance, char *Argv[], void *Reserved);
    Nandan Dharwadker
    Staff Software Engineer
    Measurement Studio Hardware Team

  • Hyperlinks or Cross references for Figures and Tables in PDF.

    Hi All,
    I've created the Hyperlinks for the Figures and tables using the Text Anchor options in Hyperlink Destination.  But I've problem in showing the destination image view when clicking on the figure references text.  The figures links are shown me the figure caption text.  How I set the properties of the Destination object to show us the exact Image when clicking on the hyperlink text.
    Thanks in Advance for any help !.
    Regards,
    Imagine

    Fit options is unavailable for the Text anchor destination,  it's need to include in the feature release.

  • Custom table model, table sorter, and cell renderer to use hidden columns

    Hello,
    I'm having a hard time figuring out the best way to go about this. I currently have a JTable with an custom table model to make the cells immutable. Furthermore, I have a "hidden" column in the table model so that I can access the items selected from a database by their recid, and then another hidden column that keeps track of the appropriate color for a custom cell renderer.
    Subject -- Sender -- Date hidden rec id color
    Hello Pete Jan 15, 2003 2900 blue
    Basically, when a row is selected, it grabs the record id from the hidden column. This essentially allows me to have a data[][] object independent of the one that is used to display the JTable. Instinctively, this does not seem right, but I don't know how else to do it. I know that the DefaultTableModel uses a Vector even when it's constructed with an array and I've read elsewhere that it's not a good idea to do what I'm trying to do.
    The other complication is that I have a table sorter as well. So, when it sorts the objects in the table, I have it recreate the data array and then set the data array of the ImmutableTableModel when it has rearranged all of the items in the array.
    On top of this, I have a custom cell renderer as well. This checks yet another hidden field and displays the row accordingly. So, not only does the table sort need to inform the table model of a change in the data structure, but also the cell renderer.
    Is there a better way to keep the data in sync between all of these?

    To the OP, having hidden columns is just fine, I do that all the time.. Nothing says you have to display ALL the info you have..
    Now, the column appears to be sorting properly
    whenever a new row is added. However, when I attempt
    to remove the selected row, it now removes a seemingly
    random row and I am left with an unselectable blank
    line in my JTable.I have a class that uses an int[] to index the data.. The table model displays rows in order of the index, not the actual order of the data (in my case a Vector of Object[]'s).. Saves a lotta work when sorting..
    If you're using a similar indexing scheme: If you're deleting a row, you have to delete the data in the vector at the INDEX table.getSelectedRow(), not the actual data contained at
    vector.elementAt(table.getSelectedRow()). This would account for a seemingly 'random' row getting deleted, instead of the row you intend.
    Because the row is unselectable, it sounds like you have a null in your model where you should have a row of data.. When you do
    vector.removeElementAt(int), the Vector class packs itself. An array does not. If you have an array, when you delete the row you must make sure you dont have that gap.. Make a new array of
    (old array length-1), populate it, and give it back to your model.. Using Vectors makes this automatic.
    Also, you must make sure your model knows the data changed:
    model.fireTableDataChanged(); otherwise it has no idea anything happened..
    IDK if that's how you're doing it, but it sounds remarkably similar to what I went thru when I put all this together..

  • Table name in which function module and function group store

    Hai,
    Any one help me, What is the table name, the function modules and fouction groups are stored.
    Thanks,
    Elamaran

    ...and table enlfdir has additional info.... function module RS_GET_ALL_INCLUDES is useful for getting a list of includes used by an fm.
    Message was edited by: Neil Woodruff

Maybe you are looking for

  • Issue with Macbook Pro (early 2011) screen going black.

    I installed an SSD with Mt Lion.  Periodically the screen goes black like it's going to sleep.  It hasn't done this in the past just noticed it the last few weeks.  The SSD is a Crucial with 8GB of Crucial memory.  I've got all the software fixes up

  • Forename moved to the last name field

    There is a problem with the last version of N Suite with outlook contacts. The first sync works fine, once you start a second sync, the forename (first name) is merged to the last name field on the suite AND on the Outlook side. The only way to corre

  • How can I open a Document in a JEditorPane?

    In a JEditorPane-Compontent was a HTML-File displayed. I wrote this code to save the JEditorPane: FileOutputStream fstrm = new FileOutputStream(f); ObjectOutput ostrm = new ObjectOutputStream(fstrm); ostrm.writeObject(jEditorPane1.getDocument()); ost

  • Merge to panorama not finishing

    I'm using CS5 to build panoramas.  When I merge 5 raw files photoshop goes through all the motions, ordering  and matching the images, but when it is just about done, and the message says building masks, the image just pops up with no blending or mas

  • Finding nemo removed from itunes store again??

    I noticed Finding Nemo was available on december 4th. I went today to purchase and it was removed from itunes/not avaialbe & did not show up when searched. Why did this take place? Thanks, B