Calling a Function Pool inside a Class

Hi,
    I want to call a Function Pool inside a Class Method. I am getting an Error that 'Report or Program Statement already exists' when I call the function pool in the method. can anybody help me on how to call a Function Pool inside a class method.

Hello Krish
Based on your error description I assume that you have tried to "insert" the function pool program (e.g. function group ZFUNC -> SAPLZFUNC) into your class.
You cannot do that. The explanation for the error message is a following:
- The class contains already a program statement (CLASS-POOL). If there is somewhere in the class an additional program statement (e.g. FUNCTION-POOL) you will get the error.
In addition, you cannot "call" a function pool. Instead you can always call the function modules of your function group.
Regards
  Uwe

Similar Messages

  • Best way to call a function in a generic class from a base class

    Hi,
    I have a generic class that works with subclasses of some other baseclass. When I construct the subclass, I call the constructor of the baseclass which I want to call a function in the generic class. e.g. suppose I have the following classes
    public class List<T extends BaseClass>
        newTCreated(T t)
    }

    Sorry, I pressed Tab and Enter last time when typing the code so I posted without meaning to
    Hi,
    I have a generic class that works with subclasses of some other baseclass. When I construct the subclass, I call the constructor of the baseclass which I want to call a function in the generic class. e.g. suppose I have the following classes
    public class List<T extends BaseClass>
        public void newTCreated(T t)
            // add the t to some internal list
        public T getT(int index)
            // get the object from the internal list
    public class BaseClass
        public BaseClass(List<?> list)
            list.newTCreated(this);
    public class SubClass extends BaseClass
        public SubClass(List<SubCass> list)
            super(list);
    }This doesn't compile because of the call to newTCreated in the BaseClass constructor because BaseClass is not necessarily of type T. Is there any way of checking when I call the newTCreated function that the BaseClass is actually of type SubClass? I could either add the call explicitly in each SubClass's constructor or have a function addToList in BaseClass that is called from the BaseClass constructor but overloaded in each subclass but both of those rely on future subclasses doing the same. Or I could change the newTCreated function to take an argument of type BaseClass and then cast it to type T but this doesn't give a compilation error, only a runtime exception.
    It seems like there should be solution but having only recently started writing Generic classes I can't find it. Thanks in advance for any help,
    Tom

  • Call a function module inside of another function module

    Has anyone ever called a function module inside of a remote enabled function module?  Maybe this needs to be accomplished inside of an include.  Just wondering.
    Thanks!

    Hi
    No u can't do it because the RE_LAST_DAY_OF_MONTH  is not remote function module.
    If you need to call it u should insert it in a RFC, so u should create in R/3 a new RFC calling both fms: RE_LAST_DAY_OF_MONTH and the remote one.
    And so call this new rfc instead of the other one.
    Max

  • How to call a function defined inside a module loader

    I wanna know...the method of calling a function defined
    inside a module loader component?
    Th
    <mx:ViewStack id="myViewStack" >
    <mx:Canvas id="Mgmt1">
    <mx:Label text="Gopher"/>
    </mx:Canvas>
    <mx:Canvas id="Mgmt2" >
    <mx:Label id="gopherlbl" top="-2" left="0"
    height="40"/>
    <CustomComp:MgmtGrid id="ManageCom"/>
    </mx:Canvas>
    <mx:Canvas id="Admin">
    <mx:ModuleLoader id="adminModule" url="{adminModUrl}"
    width="100%" height="100%" />
    </mx:Canvas>
    where adminModUrl="admin.swf";
    Thru the MangeCom id reference,I am able to call the fucntion
    defined inisde the CustomComponent File MgmtGrid...But I am unable
    to call the funciton defined inside adminModule
    ModuleLoader...(using id reference).Anyone pls suggest a solution
    for this..

    Ensure the module is loaded before calling the method in
    particular if you are calling it at the initialization of your
    app.

  • Calling a private function when inside another class?

    Can't help it but im curious how classes seem to be able to
    call private functions inside other classes. I'm mainly thinking
    about the addEventListener() here. When adding a listening function
    to a class, that function can be private, and yet it seems to be
    called magically somehow. Or maybe its all internal? I dunno.
    Anyone? :D

    Hi Kenchu1,
    You can grab a copy of the open source API here:
    http://www.baynewmedia.com/download/BNMAPI10.zip
    (feel free to drop by
    the main site for documentation as well :) ). The main class
    is the
    Events class, "broadcast" method. This method broadcasts
    events in a
    decoupled fashion, meaning that listeners can listen to
    messages that
    aren't bound to a specific sender. The AS3 version works in
    much the
    same way except that I still haven't fully fleshed out the
    cross-SWF
    communication that this version can do (broadcast across all
    movies on
    the same computer using LocalConnection).
    Basically, the broadcaster works like this:
    1. Add event listener and bind to function A (called from
    within the
    class so the reference is available)
    2. Event listener pushes this into the listener array. It was
    provided
    by the class so the reference is valid and is now a part of
    the events
    class as well.
    3. Broadcast runs through all associated events when it comes
    time to
    broadcast and calls the function by using the array
    reference:
    this.listeners[message].call(classInstance,someParameter);
    In other words, the class that adds the listener "allows"
    the event
    broadcaster to use the reference because it passes it out.
    You can do
    the same thing by calling:
    someOtherclass.functionRef=this.privateFunction
    someOtherClass is the class that will store the private
    reference,
    functionRef is some variable to hold the reference, and
    privateFunction
    is the private function. Then, in someOtherClass, you can
    call:
    this.fuctionRef(someParameter);
    Hope this helps.
    Patrick
    Kenchu1 wrote:
    > Patrick B,
    > exactly! Something like that is what im looking for. I
    have my own rather
    > simple system right now with listeners and classes
    calling these, but since i
    > dont know how to call a private function, i had to make
    all the listening
    > classes functions public - something id rather avoid.
    Exactly how did your
    > event broadcasting system work? Oh, and we're talking
    AS3 btw.
    >
    > How do i call a function via a reference? (to the
    function? To what?)
    >
    http://www.baynewmedia.com
    Faster, easier, better...ActionScript development taken to
    new heights.
    Download the BNMAPI today. You'll wonder how you ever did
    without it!
    Available for ActionScript 2.0/3.0.

  • Calling a Function in a AbstractPortalComponent Class from a JSP

    Hello,
    i got a class witch extends AbstractPortalComponent. In this class I call in the function doContent this
    response.include(request, request.getResource(IResource.JSP, "pagelet/TestComponent.jsp"));
    now i want to define another function in this class.
    This function should be called from the JSP. For Example when a Button is pressed. I know I can do this with a JSPDynPage but i need it this way.
    How can i realise this?
    Thanks for your replies.
    Greetings
    Christoph

    Never mind - I was doing something very stupid and wasn't
    calling the function as a method of a movie clip. I was simply
    calling checkTarget(event) rather than
    event.currentTarget.checkTarget(event); which seems to work.

  • How to call a function inside a class? 

    Hello, i am trying to fire a function onPress .. this
    function is inside a class.
    In this function i refer to another function inside the calss
    to call a Tween. It never arrives in the second function.
    I tried to make an example.
    In the fla file i have:
    var test:makeMovie = new makeMovie(this);
    You will see a red squere and you can press on it. It should
    run the tween class. Am i using the delegate class wrong?

    I always have to use test movie and trace a couple of times
    each time I start to use Delegate.
    It wraps function.apply I think, which I tend to use more
    often.
    try using:
    Container.onPress = Delegate.create(this,setAlpha);
    and then just
    setTween()
    inside your setAlpha....
    That's conceptually how I think I would try it above if I was
    doing something similar.
    I'm not sure it would have the desired effect even if the
    delegate was executed as you have it coded. Unless you want
    setTween's execution scope to be the Container clip in which case
    you might need to do what kglad said and change the Container
    reference to 'this'.
    The way you have it at the moment inside setAlpha the
    Delegate.create is simply creating a function...and not excuting
    it.
    its like : function something(){trace('what')}
    and not like : something();
    Below is some quick code that helps show how things work.
    Notice that I assigned the delegate function to mainFunc....so that
    along with the last example might provide a clue. Just paste it on
    a frame and take a look at what's happening.

  • Calling a function inside another class

    I have the following two classes and can't seem to figure to figure out how to call a function in the top one from the bottom one. The top one get instantiated on the root timeline. The bottom one gets instantiated from the top one. How do I call functions between the classes. Also, what if I had another call instantiated in top one and wanted to call a function in the bottom class from the second class?
    Thanks a lot for any help!!!
    package
         import flash.display.MovieClip;
         public class ThumbGridMain extends MovieClip
              private var grid:CreateGrid;
              public function ThumbGridMain():void
                   grid = new CreateGrid();
              public function testFunc():void
                   trace("testFunc was called");
    package
         import flash.display.MovieClip;
         public class CreateGrid extends MovieClip
              public function CreateGrid():void
                   parent.testFunc();

    kglad,
    Although I agree that utilizing events the way you attempted in your suggestion is better for at least a reason of eliminating dependency on parent, still you code doesn't not accomplish what Brian needs.
    Merely adding event listener to grid instance does nothing - there is no mechanism in the code that invokes callTGMFunction - thus event will not be dispatched. So, either callTGMFunction should be called on the instance (why use events - not direct call - in this case?), or grid instance needs to dispatch this event based on some internal logic ofCreateGrid AFTER it is instantiated - perhaps when it is either added to stage or added to display list via Event.ADDED. Without such a mechanism, how is it a superior correct way OOP?
    Also, in your code in ThumbGridMain class testFunc is missing parameter that it expects - Event.
    Am I missing something?
    I guess the code may be (it still looks more cumbersome and less elegant than direct function call):
    package
         import flash.display.MovieClip;
         import flash.events.Event;
         public class ThumbGridMain extends MovieClip
             private var grid:CreateGrid;
             public function ThumbGridMain():void
                 grid = new CreateGrid();
                 grid.addEventListener("callTGMFunction", testFunc);
                 addChild(grid);
            // to call a CreateGrid function named cgFunction()
             public function callCG(){
                 grid.cgFunction();
             public function testFunc(e:Event):void
                 trace("testFunc was called");
    package
         import flash.display.MovieClip;
         import flash.events.Event;
         import flash.events.Event;
         public class CreateGrid extends MovieClip
             public function CreateGrid():void
                 if (stage) init();
                 else addEventListener(Event.ADDED, callTGMFunction);
             // to call a TGM function
             public function callTGMFunction(e:Event = null):void
               // I forgot this one
                removeEventListener(Event.ADDED, callTGMFunction);
                this.dispatchEvent(new Event("callTGMFunction"));
            public function cgFunction(){
                 trace("cg function called");
    I think this is a case of personal preference.
    With that said, it is definitely better if instance doesn't rely on the object it is instnatiated by - so, in this case, either parent should listen to event or call a function directly.

  • How can a custom class call a function in "parent" class?

    Say I have an application (ultrasimplified):
    public class myApp {
    myClass mc;
    boolean foo=false;
    public static void main(String[] args) {
    mc = new myClass();
    public static void myFunc(boolean blah) {
    foo=blah;
    in a separate .java file where my questions lie:
    public class myClass {
    boolean bar=true;
    public void myClass() {
    // this is wrong, but how would I do this:
    foo = bar; // foo in myApp set to true
    // or how would I call "myFunc()" in myApp from this class:
    myFunc(bar);
    my problem is that I've created a new class that I share between two applications so I could share the code. However, I want this class I created to call a function in the application class that instanciated it. Or alternatively, I would like to set a variable in the class that instanciated myClass.
    How would go about this? I've used the "this" parameter in applets to pass the parent class to an inner class, but main() in applications doesn't allow the non-static "this":
    myClass my = new myClass(this);
    Is there something similar I can do?

    You can let MyApp implement an interface and refer to that object in MyClass:
    class MyApp implements Something {
    main() {
    MyApp app = new MyApp();
    MyClass mc = new MyClass(app);
    public void foo() { }
    class MyClass {
    Something app;
    MyClass(Something app) {
    this.app = app;
    app.foo();
    interface Something {
    public void foo();
    Better yet, you can let MyApp extend an abstract class that defines foo(). Then MyApp can override the foo() method. If later on, the abstract class needs to add a bar() method then default implementation can be done in the abstract class. If you make it an interface then all implementing classes will have to be updated to implement the new method.

  • Calling a function in the HTML window the course sits inside - Captivate 8

    Hi,
    I've scoured the forums for an answer to this but as yet have come up blank.
    Our LMS launches a course in a popup window and inside of this the .htm Captivate output file sits.
    Currently this pop up window has a button in it which executes a function.  The problem is this button is rather unsightly sitting above the course in the HTML window and I'd like to be able to call this function from inside the Captivate course itself.
    The function is called closeSCOContent() and it closes the course window but crucially forwards the user to a feedback page.
    So essentially is it possible to call this function using the Javascript function in Captivate 8?
    I hope I've explained that sufficiently
    Many thanks!

    Hi,
    This gave me the nudge in the right direction I needed, after a bit of basic frameset research I've got the desired functionality.
    Huge thanks!

  • Call function defined in other class

    Hi..
    I am new to Java programing .
    I want to know how to call a function defined in second class from first class.
    Please help me.

    Hi..
    If both the classes are in same package, and the function is not private, u can call the function by using an object of the second class. If they r in separate packages, u have to import the package in which the second class is. In any case, public methods are allowed and private methods are not allowed to be invoked.
    Hope this info may help u..

  • Can I call a function in another package?

    Dear all,
    Can I call a function in another package?
    Say I have package A, and package B.
    Is it possible for me to call a function in inside package A, within a function inside package B?
    If yes, what's the syntax.
    Thanks in advance!

    The variable in the calling package that will receive the value of the function in the other package needs to be defined based on that type in the other package directly:
    sql>create or replace package pkg_a
      2  is
      3    type testTable is table of varchar2(10) index by binary_integer;
      4 
      5    function f_a return testTable;
      6  end;
      7  /
    Package created.
    sql>create or replace package body pkg_a
      2  is
      3    function f_a
      4      return testTable
      5    is
      6      v_table testTable;
      7    begin
      8      v_table(1) := 'One';
      9      v_table(2) := 'Two';
    10      return v_table;
    11    end; 
    12  end;
    13  /
    Package body created.
    sql>create or replace package pkg_b
      2  is
      3    procedure p_b;
      4  end; 
      5  /
    Package created.
    sql>create or replace package body pkg_b
      2  is
      3    procedure p_b
      4    is
      5      v_table pkg_a.testTable;  -- this variable has to be based on the type in pkg_a
      6    begin
      7      v_table := pkg_a.f_a;
      8      for i in 1..v_table.count loop
      9        dbms_output.put_line( v_table(i) );
    10      end loop;
    11    end;
    12  end; 
    13  /
    Package body created.
    sql>exec pkg_b.p_b
    One
    Two
    PL/SQL procedure successfully completed.

  • How to call C function in .m file from another function in a .mm file

    I am making an interface class between a C library and an objetive C application.
    I have not problem calling function the C library from .mm funstions,
    but I am having problems calling .m functions from the .mm class.
    here is an example of what I mean.
    here in my .m vector file
    *struct dVector*
    * float m_x;*
    * float m_y;*
    * float m_z;*
    * float m_w;*
    *struct dVector InitVector (float x, float y, float z, float w);*
    *struct dVector AddVector (struct dVector* A, struct dVector* B);*
    *struct dVector SubVector (struct dVector* A, struct dVector* B);*
    here is my .mm class
    *#import <Foundation/Foundation.h>*
    *@interface iNewton : NSObject*
    * void* m_world;*
    *-(id) init;*
    *-(void) dealloc;*
    -(void) CreateBox: (Entity*) ent: (int) shapeId;*
    @end
    here is the implemrntation of function funtion CreateBox in a .mm file
    [code]-(void*) CreateBox: (Entity*) ent: (int) shapeId
    struct dVector minBox;
    struct dVector maxBox;
    // this is fine
    [ent GetBBox: &minBox: &maxBox];
    //calculate the box size and dimensions of the physics collision shape
    // this report a link errors, and I do no knwo why
    struct dVector size = SubVector(&maxBox, &minBox);
    struct dVector origin = AddVector (&maxBox, &minBox);
    // thsi work without problemen
    return NewtonCreateBox ((NewtonWorld*) world, size.m_x, size.m_y, size.m_z, shapeId, &offset.mfront.mx);
    I get these compiler errors
    Building target “tutorial102AddingRigidBody” of project “newton_iPhone” with configuration “Debug_Emulation” — (3 errors)
    cd /Users/juliojerez/Desktop/NewtonMac/NewtonSDK/newton_iPhone
    setenv MACOSXDEPLOYMENTTARGET 10.5
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr /bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++-4.0 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2 .1.sdk -L/Users/juliojerez/Desktop/NewtonMac/NewtonSDK/newtoniPhone/build/DebugEmulation-iphonesimulator -L/Users/juliojerez/Desktop/NewtonMac/NewtonSDK/newton_iPhone/../sdk -F/Users/juliojerez/Desktop/NewtonMac/NewtonSDK/newtoniPhone/build/DebugEmulation-iphonesimulator -filelist /Users/juliojerez/Desktop/NewtonMac/NewtonSDK/newtoniPhone/build/Debug_Emulation-iphonesimulator/tutorial_102_AddingRigidBody.build/ Objects-normal/i386/tutorial_102AddingRigidBodies.LinkFileList -mmacosx-version-min=10.5 -framework Foundation -framework UIKit -framework OpenGLES -framework QuartzCore -framework CoreGraphics -lnewton_iPhoneEmulation -o /Users/juliojerez/Desktop/NewtonMac/NewtonSDK/newtoniPhone/build/Debug_Emulation-iphonesimulator/tutorial_102_AddingRigidBodies.app/ tutorial_102AddingRigidBodies
    Undefined symbols:
    "AddVector(dVector*, dVector*)", referenced from:
    -[iNewton CreateBox::] in iNewton.o
    "SubVector(dVector*, dVector*)", referenced from:
    -[iNewton CreateBox::] in iNewton.o
    "Scale(dVector*, float)", referenced from:
    -[iNewton CreateBox::] in iNewton.o
    ld: symbol(s) not found
    collect2: ld returned 1 exit status
    "AddVector(dVector*, dVector*)", referenced from:
    -[iNewton CreateBox::] in iNewton.o
    "SubVector(dVector*, dVector*)", referenced from:
    -[iNewton CreateBox::] in iNewton.o
    "Scale(dVector*, float)", referenced from:
    -[iNewton CreateBox::] in iNewton.o
    ld: symbol(s) not found
    collect2: ld returned 1 exit status
    Build failed (3 errors)
    Basically I can call objective C class methods from .mm files,
    but I can not call functions who are not members of a class from .mm funtions.
    Does any one knows how I can solve this?
    I have two books on objective C and neither show how to do that.
    Please I will apreciate if some one can help me with this.
    Julio Jerez

    julio jerez wrote:
    // this is fine
    [ent GetBBox: &minBox: &maxBox];
    why will tha be wrong?
    ent is a objective C class with a method GetBBox
    wich I use in hundred of places with out problem.
    Beside that is not the problem that.
    Well, you've got me on this one. You are correct. Apparently you don't need to specify the parameter names. Still, I strongly encourage you to use parameter names. Even though they apparently aren't required, I've never seen them not used. I would have expected to see:
    [ent GetBBoxMin: & minBox max: & maxBox]
    The problem is calling C function that are declared in .m files.
    if you read the errors, they are linking errors not compiler errors.
    this is a C function that is declared in a .m file
    struct dVector size = SubVector(&maxBox, &minBox);
    beside I also use those functions in many other place as well in teh project and they work.
    If it helps I can post a link to the a download place to the xcode project maybe it is eassy to see what I am trying to do.
    That would probably be a good idea.
    Normally, all you need is
    extern "C"
    but there is so much missing from what you've posted that I can't tell for sure what is going on.

  • Calling a Function Within a For-Each in Powershell

    Error:
    Unexpected token 'in' in expression or statement.
    At :line:1 char:22
    + ForEach-Object ($i in  <<<< $fs_size_info) { $i.Name.Name, GetGB($i.Sum)  }
    Code:
    foreach ($i in $fs_size_info) { $i.Name.Name GetGB($i.Sum) }
    If I omit the function from inside this foreach, it works perfectly, and I can access $i.Sum within the foreach as well. The problem arises when I try to call a function from inside the foreach. GetGB simply returns a more readable format e.g. GetGB(1024)
    will return "1 K" etc...
    I don't understand what I'm doing wrong, unless you cannot call a function inside a foreach statement.... am I missing something?
    Thanks

    The code you've posted and the error message don't seem to go together, unless the line before that "foreach" keyword happens to have ended with a pipe character.  There's a difference between how you use the foreach statement (help about_Foreach)
    and the ForEach-Object cmdlet (help ForEach-Object).
    Either way, it looks like inside the loop body, you've got two statements:  ($i.Name.Name) and (GetGB($i.Sum).  Those statements need either a line break or a semicolon between them.

  • Call function inside running class

    Hey All,
    i have a two question in classes.
    1- i have class and i called its before and its running on runtime. i need to call function inside this class from another class, but without call the first one again, because if i called it, it will run default class function again
    is this doable ?
    2- What super() mean ?
    Thanks a lot.

    this is the default call, and when i call the method by this way its will run the default class function before call the method.
    here my example:
    i need to call checkboxes  function in ChannelsMain class without pass by the grey script.
    Note: the call_cb is working and the trace is working
    so i now the class is running, i need to call the checkboxes without ( var ci:YourClass = new YourClass(); )
    package com.link
         import fl.controls.CheckBox;
         import flash.events.*;
         public class ChannelsMain
              var cbLength:uint = Main.PV.channel_id.length;
              public function ChannelsMain()
                   // constructor code
                   for (var i:int = 0; i < cbLength; i++)
                        var cb:CheckBox = new CheckBox;
                        cb.name = Main.PV.channel_id[i];
                        cb.label = Main.PV.channel_name[i];
                        cb.x = 50;
                        cb.y = 50 + i * 30;
                        cb.addEventListener(Event.CHANGE,call_cb);
                        Main.MS.addChild(cb);
                        //call xml function
                        if(i == cbLength - 1)
                             new ChannelsXML();
              private function call_cb(evt:Event)
                   trace(evt.currentTarget.name,evt.currentTarget.selected);
              public function checkboxes(evt)
                   trace(evt);

Maybe you are looking for