Change Stage.addEventListener functionality using prototype

I'm trying to monitor calls to Stage::addEventListener that may come from externally loaded SWF files of which i have no code access to. A possible solution i was thinking of was to change the addEventListener of the Stage class using prototype. I tried:
Stage.prototype.addEventListener = function(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void{
        trace("addEventListener: " + type + ": " + listener + ": " + useCapture + ": " + priority + ": " + useWeakReference);
but it doesn't seem to work. Is it even possible to change its functionality?

Answer: Impossible

Similar Messages

  • How to change the Partner function code in Quotation

    Hi All,
    We have a requirement that whenever a Quote is cancelled,
    We need to change one of the function codes in the partner tab and also the user status should be changed.
    Can anyone give a quick solution on this?
    Your response will be appreciated.
    Thanks in advance.
    Regards,
    Ramya

    You will best implement this as an action (tx. SPPFCADM), which is called on changing the status to cancelled. In this action you can call a function module changing the partner functions using e.g. CRM_ORDER_MAINTAIN as the appropriate function module.
    Regards, Kai

  • How do I pass an array of structs to a C function using the dll flexible prototype adapter?

    What I want to do is pass into a C dll function a variably sized Array of structs of type TPS_Data. My Code compiles but when I run it in TestStand, I get an error -17001; Program Error. "Cannot allocate 0 size buffer Error in parameter 2, 'OpenFrdData'."
    I've allocated the Array of structs, and all of the information is there before I call my function, so is it my prototype? Or am I asking too much of the DLL Flexible Prototype Adapter to pass an Array of Structs?
    I can pass in a single struct of type TPS_Data and that works, but not an array.
    Here's the relevent code:
    typedef struct TPS_DATA
    char Report_Number[256];
    char System_Name[256];
    char Open_Date[256];
    char UUT_Part_Number[256];
    char UUT_Serial_Number[256];
    char UUT_Name[256];
    char Open_Employee_Name[256];
    char Open_Employee_Number[256];
    char Close_Employee_Name[256];
    char Close_Employee_Number[256];
    char Close_Date[256];
    } TPS_Data;
    typedef struct TPS_DATA_ARRAY
    TPS_Data DataRecord;
    } TPS_DataArray;
    long __declspec(dllexport) __stdcall OpenDialog (CAObjHandle Context, TPS_DataArray *TpsData[], const char *psFaultStr, char *sComments, const int nCount);

    OK,
    I can pass the data to the DLL function, using the following types:
    typedef struct StringArrayType
    char string[10][256];
    } StringArray;
    typedef struct MultiStringArrayType
    StringArray Record[10];
    } MultiStringArray;
    void __declspec(dllexport) __stdcall ATP_TestStructPassing(StringArray Strings)
    return;
    void __declspec(dllexport) __stdcall ATP_TestMultiStructPassing(MultiStringArray *Strings)
    return;
    But when the MultiStruct function Exits, TestStand reports an Error:
    -17501 "Unexpected Operating System Error" Source: 'TSAPI'
    There doesn't seem to be a way around this, and once the error occurs, I have to force quit TestStand. I've included the sequence file, and the dll code can be compiled from the fun
    ctions shown above.
    Any thoughts on how to get around this error would be greatly appreciated.
    Attachments:
    StructArrayPassing.seq ‏16 KB

  • Whats the function used in objective C to change language in an app

    whats the function used in objective C to change language in an app

    No. Actually its a not uncommon practise in iOS. See the app "Where is my Water" for instance. You can freely select what language you want to use in the game.
    Another iOS app where the app does not offer this feature but should is XCom. For me the app uses German text with US-English movies and ingame speech. I would rather have complete english than a language mix, but I cant switch the game. I could swich my ipad to english, then the game would use english. But this would lead to other problems and its not really user friendly.
    Speaking of language support. It is also ok to download languages after installation. After all it is only data, no executable.

  • Display Error: The display template had an error. You can correct it by fixing the template or by changing the display template used in either the Web Part properties or Result Types. $(...).slick is not a function (OnPostRender: )

    Hi Team,
    I implemented news carousel using display template concepts.
    Its working.
    But some times it shows like some thing went wrong
    when clicke on show details
    it showing the error like
    Display Error: The display template had an error. You can correct it by fixing the template or by changing the display template used in either the Web Part properties or Result Types.
    $(...).slick is not a function (OnPostRender: )
    some times showing result and while refreshing the page am getting the error like below
    How to fix the issue
    Regards,
    Dhayanand

    Hi Wendy Li,
    Finally we fixed.
    The prob is that we referring two different version of jquery files in master page and page layout.
    We corrected by referring same version of jquery files in both pages
    Regards,
    Dhayanand

  • The latest changes to the function to "Upload to FTP host" has rendered this useless - no point using a program like Muse if I can not easily and automatically upload the work to the webserver!

    The latest changes to the function to "Upload to FTP Host" has rendered this useless - no point using a program like Muse if I can not easily and automatically upload the work to the webserver!  I use BlueHost webhosting that has a primary domain and I have several domains with that account (as sub-domains or folders on this server) - with past versions of Muse when uploading pages it simply opened an alert window to tell me (what I already know) that the website I was uploading does not point to the primary domain BUT NOW Muse tries to create a new separate folder in the root directory of the primary domain - completely ignoring the directory path I am giving it - useless!  Why make these senseless changes to the program - and so often - very frustrating it is like amateur ware!.

    Hi Stephen,
    There are some issues with the upload to ftp via Muse, which the engineering team is aware of and those will be fixed in a future build of Muse. At this point the work around would be to export the html from Muse and then upload via some third party ftp client like filezilla.
    I will recommend that you keep an eye on our release notes page to get more updates on it - Release notes | Adobe Muse CC
    - Abhishek Maurya

  • If I use iCloud on my iPad, will it change my MobileMe functions like iWeb on my iMac? My iMac uses Snow Leopard.

    If I use iCloud on my iPad, will it change my MobileMe functions on my iMac which uses Snow Leopard. In other words will it disable functions like iWeb on my iMac?

    As a follow-up . . . I downloaded and installed Virtual Box, purchased a legal issue of Windows XP (not easy since Microsoft doesn't sell it anymore), installed it, installed Quicken 2009 in "the Box" and then the problems began. Trying to migrate my Quicken data files from my laptop PC to the Virtual Box Quicken program turned out to be the most frustrating thing I've been through for quite awhile. Error after error without any explanation of what I was doing wrong (or not doing) kept me scratching my head and re-reading the VB manual for nearly two days. Today I finally had success and all three of my Quicken accounts are comfortably residing in my iMac and working perfectly (so far . . . knock, knock).
    It was well worth the effort because now all I need to do is open VB (about 3 seconds), click open Windows (about 5 seconds) and open Quicken ( <5 more seconds) and I'm ready to go to work.
    Thanks for the advice typod360 . . . it's much apprecoiated.

  • Change name of function..?

    I have 2 codes on 2 different keyframes i have just copy/pasted. I have changed all the name of functions and variables, I just need one function I don't know how to change name of.
    code on key frame 1:
    var timedelay2:Number = 10;  // seconds delay in replay
    var video2;
    var nc2:NetConnection;
    var ns2:NetStream;
    nc2 = new NetConnection();
    nc2.connect(null);
    ns2 = new NetStream(nc2);
    ns2.client = this;
    ns2.addEventListener(NetStatusEvent.NET_STATUS,netStatusf2);
    function netStatusf2(e:NetStatusEvent) {
        if (e.info.code == "NetStream.Play.Stop" && Math.abs(durationNum-ns.time)<.1) {
    setTimeout(replayF,timedelay*1000);
    function replayF2(){
    ns2.play("film/film1.f4v");
    var durationNum2:Number;
    function onMetaData(iObj:Object):void {
        durationNum2 = iObj.duration;
    video2 = new Video(287,263);
    video2.x = 231.1;
    video2.y = 140.5;
    addChild(video2);
    video2.attachNetStream(ns2);
    ns2.play("film/film1.f4v");
    code on key frame 2:
    var moviesA:Array =["film/film1.f4v", "film/film2.f4v"];
    var movie:String = moviesA[Math.floor(Math.random()*moviesA.length)];
    var timedelay:Number = 5;  // seconds delay in replay
    var video;
    var nc:NetConnection;
    var ns:NetStream;
    nc = new NetConnection();
    nc.connect(null);
    ns = new NetStream(nc);
    ns.client = this;
    ns.addEventListener(NetStatusEvent.NET_STATUS,netStatusf);
    function netStatusf(e:NetStatusEvent) {
        if (e.info.code == "NetStream.Play.Stop" && Math.abs(durationNum-ns.time)<.1) {
    setTimeout(replayF,timedelay*1000);
    function replayF(){
    ns.play(movie);
    var durationNum:Number;
    function onMetaData(iObj:Object):void {
        durationNum = iObj.duration;
    video = new Video(287,263);
    video.x = 231.1;
    video.y = 140.5;
    addChild(video);
    video.attachNetStream(ns);
    ns.play(movie);
    problem is this function, I don't really know how to give one of the function another name so they don't interfere with each other...?
    function onMetaData(iObj:Object):void {
        durationNum2 = iObj.duration;
    anyone that can help..?

    hey again
    i'm now just using
    var durationNum:Number;
    function onMetaData(iObj:Object):void {
        durationNum = iObj.duration;
    on frame 1. But it seems i've lost the randomness on frame 2. it only plays "film/film1.f4v" all the time even though i put multiply times "film/film2.f4v". Is this true, or is it just me who have been very unlucky..?
    my frame 1 looks like this at the moment:
    var timedelay:Number = 10;
    var video;
    var nc:NetConnection;
    var ns:NetStream;
    nc = new NetConnection();
    nc.connect(null);
    ns = new NetStream(nc);
    ns.client = this;
    ns.addEventListener(NetStatusEvent.NET_STATUS,netStatusf);
    function netStatusf(e:NetStatusEvent) {
        if (e.info.code == "NetStream.Play.Stop" && Math.abs(durationNum-ns.time)<.1) {
    setTimeout(replayF,timedelay*1000);
    function replayF(){
    ns.play("film/film1.f4v");
    var durationNum:Number;
    function onMetaData(iObj:Object):void {
        durationNum = iObj.duration;
    video = new Video(287,263);
    video.x = 231.1;
    video.y = 140.5;
    addChild(video);
    video.attachNetStream(ns);
    ns.play("film/film1.f4v");
    stage.addEventListener(MouseEvent.CLICK, clickHandler);
    function clickHandler(event:MouseEvent):void{
        if (event.target.name!=null){
            switch(event.target.name) {
                case "work1_btn":
                gotoAndStop("work1");
                removeChild(video);
    break;
                case "contact_btn":
                gotoAndStop("contact");
                removeChild(video);
    break;
                case "frontpage2_btn":
                gotoAndStop("frontpage2");
                removeChild(video);
    break;
    And my frame 2 looks like this:
    var moviesA2:Array =["film/film1.f4v", "film/film2.f4v", "film/film2.f4v", "film/film2.f4v", "film/film2.f4v"];
    var movie2:String = moviesA2[Math.floor(Math.random()*moviesA2.length)];
    var timedelay2:Number = 0;  // seconds delay in replay
    var video2;
    var nc2:NetConnection;
    var ns2:NetStream;
    nc2 = new NetConnection();
    nc2.connect(null);
    ns2 = new NetStream(nc2);
    ns2.client = this;
    ns2.addEventListener(NetStatusEvent.NET_STATUS,netStatusf2);
    function netStatusf2(e:NetStatusEvent) {
        if (e.info.code == "NetStream.Play.Stop" && Math.abs(durationNum-ns.time)<.1) {
    setTimeout(replayF2,timedelay*1000);
    function replayF2(){
    ns2.play(movie2);
    video2 = new Video(287,263);
    video2.x = 231.1;
    video2.y = 140.5;
    addChild(video2);
    video2.attachNetStream(ns);
    ns2.play(movie2);
    stage.addEventListener(MouseEvent.CLICK, clickHandler2);
    function clickHandler2(event:MouseEvent):void{
        if (event.target.name!=null){
            switch(event.target.name) {
    case "frontpage2_btn2":
                gotoAndStop("frontpage2");
                removeChild(video2);

  • Change Stage Frame From Inside MovieClip?

    How Do I Change Stage Frame From Inside MovieClip?
    Heres my code so far:
    hh.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
    function fl_MouseClickHandler(event:MouseEvent):void
        gotoAndStop(2);
    i tried (root).gotoAndStop(2); but i got an error , #1061 ..
    Thanks in Advance...
    ASAP would be nice..

    well your a smart *** now arnt you   Haha..
    I missed 1 painful word in that line of code thanks heeps..

  • 10.1.3.1 Worklist - Using Prototype with auto-gen JSP forms

    There is an interesting conflict when using the javascript package Prototype with the auto-generated jsp for worklist forms.
    Inside the main JSP is this javascript function, which iterates through the keyNames array associatively:
    function isNameExist(keyNames, name)
    var exist = "false";
         for (keyName in keyNames)
         if(trim(keyNames[keyName]) == trim(name))
         exist = "true";
    return exist;
    However because of Prototype's modifications to the Array object, this function fails. To make it work, change the function to this:
    function isNameExist(keyNames, name)
    var exist = "false";
    if (keyNames && keyNames.length > 0) {
              for (var j = 0; j < keyNames.length; j++)
              //for (keyName in keyNames)
              if(trim(keyNames[j]) == trim(name))
              //if(trim(keyNames[keyName]) == trim(name))
              exist = "true";
    return exist;
    FYI: I first discovered the problem when the Save button became disabled (after adding Prototype), and Firefox kept reporting the js error "globalUpdateForm has no properties".
    My thanks to Ryan Gahl for this one!
    PS: If anyone else has tried using Prototype and knows of other conflicts, please post!

    My code is in a java Exec, in a bpel process. I am not using any JSP pages. What do you mean by child of the orabpel process? How do I check if my bpel process is a child of the orabpel process?
    Thanks!
    Moe

  • How can I change Label's text using ActionScript?

    Hi~ everyone~
    I want change Label's text using ActionScript.
    Test.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
          xmlns:s="library://ns.adobe.com/flex/spark"
          xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" initialize="init()">
    <fx:Script>
      <![CDATA[
       private function init():void{
        var btn:BtnScript = new BtnScript();
        this.addElement(btn);
      ]]>
    </fx:Script>
    <fx:Declarations>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <s:Label x="182" y="149" text="Label" id="lbl"/>
    </s:Application>
    BtnScript.as
    package
    import flash.events.MouseEvent;
    import mx.controls.Alert;
    import spark.components.Button;
    public class BtnScript extends Button
      public function BtnScript()
       super();
       this.addEventListener(MouseEvent.CLICK, eventHandler);
      private function eventHandler(event:MouseEvent):void{
              // lbl.text = "changed text";
           // HOW CAN I ACCESS LABEL IN MXML FILE?
    I'm about to learn flex. Please help me.
    Thanks in advanced.

    You could achive this very easily(but this shouldn't be used in production code as it'll be difficult to manage as the project grows) by defining a static data member varibale of DataType Label something like below, (modified/added code in BOLD)
    Test.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
          xmlns:s="library://ns.adobe.com/flex/spark"
          xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" initialize="init()"
          creationComplete="creationCompleteHandler(event)">
    <fx:Script>
      <![CDATA[
       private function init():void{
         var btn:BtnScript = new BtnScript();
         this.addElement(btn);
       private function creationCompleteHandler(event:FlexEvent):void{
         Model.someLabel = lbl;
      ]]>
    </fx:Script>
    <fx:Declarations>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <s:Label x="182" y="149" text="Label" id="lbl"/>
    </s:Application>
    BtnScript.as
    package
      import flash.events.MouseEvent;
      import mx.controls.Alert;
      import spark.components.Button;
      public class BtnScript extends Button
        public function BtnScript()
          super();
          this.addEventListener(MouseEvent.CLICK, eventHandler);
        private function eventHandler(event:MouseEvent):void{
              // lbl.text = "changed text";
          // Now use Model.someLabel which is basically 'lbl'.
          Model.someLabel.text = "changed text";  //Mission Accomplished....
    Model.as
    package
      public class Model
        public static someLabel:Label;
    Note: This approach is just to give you an idea but instead should use the MVC pattern.

  • What's changed in the 1.2 prototype.

    The 1.2 prototype has surprisingly little documentation. I started this thread to try to remedy that, in part. I'm going to start off by listing what's I've noticed changed in 1.2, gotchas to watch out for, etc, and I hope you all will follow up below w/ all the rest of the changed things which I haven't discovered yet.
    1) THE COMMAND-LINE scripts/javac TOOL NEEDS THE '-gj' OPTION.
    The previous release didn't. This is a big user-noticible change if you were using the older 1.0-ea prototype in makefiles and such. Note that the 'javac --help' information lists '-gj' as the default; it is wrong. '-nogj' is the default.  I hope this doesn't reflect on the status of GJ in java 1.5?
    2) THE COLLECTIONS API HAS CHANGED.
    This is made more interesting by the fact that this release doesn't come with any javadoc and (as far as I know) javap still crashes when given GJ .class files. The only way to tell that the interface
    has changed out from under you is the javac error message which you will sometimes get when you try to extend a Collection class
    with a now-incorrectly-typed method. (Other times, javac will just crash.)
    The changes I have seen have altered the signature of addAll, putAll, and similar methods from:
    class Collection<V> {
       boolean addAll(Collection<V> c);
    }to
    class Collection<V> {
       <T extends V> boolean addAll(Collection<T> c);
    }Note that this gives you much more flexibility and restores covariance in some ways; but it also breaks all your Collection subclasses which override methods with the now-obsolete signatures.
    Are there any other similar method changes to watch out for? Post below; if the 'offical' javadoc for this 1.2 prototype release isn't forthcoming 'soon' I'll probably hand-edit the 1.0 prototype javadoc to be correct for the new release and post it on the web for everyone to use pro tem. (But it would be nice if the Sun folk did this themselves, so I wouldn't have to bother, hint, hint!)
    3) NO MORE JAVADOC. Mentioned above; hope you've got a copy of the 1.0 javadoc lying around still.
    4) BUGS FIXED. As pnkfelix noted in another post here, some type-system loopholes have been fixed in this release. Also, the bugs which prevented casts from Set to Collection and from Set to Set<T> appear to have been fixed. The bad-line-numbers-on-non-Unix-platforms bug is reputedly gone. Further, it seems that this release compiles non-GJ code better. I'll probably post more on these issues as I get a little more experience w/ this new release. Does anyone else have 'favorite' 1.0-prototype bugs which were fixed in this release?
    5) ONLY WORKS ON JDK1.4. The last release didn't work on 1.3 either, as far as I can tell. But, regardless, this is the only documented change in this release (according to the CHANGES file in the distribution).
    OK. This feels incomplete. Post below and let's hear what else you've noticed has changed.
    [[[ObObscurePersonalNote: Felix, FLEX now has a GJ port.  'magic-4-0'  These prototype compilers are far too buggy for me to release it on the rest of the group, but I've been playing with it on my own personal branch.]]]

    1) THE COMMAND-LINE scripts/javac TOOL NEEDS THE '-gj'
    OPTION.Thanks for noting this. It may have saved me a lot of time. With only this change, my "Frink" project
    ( http://futureboy.homeip.net/frinkdocs/ , 194 classes with a mix of generic and non-generic code, 25000 lines) recompiled with the new compiler with zero changes. Of course, in the course of building this project, I worked around some bugs in the old compiler.
    * I think that inner classes still don't work as expected. I don't know if this is a bug, but it's a shortcoming. For example, the following code still doesn't compile:
    public class Outer<T>
       private T outerMember;
       public Outer()
          outerMember = null;
       private class Inner<T>
          private T innerMember;
          public Inner()
             innerMember = outerMember;
    }The compilation error is:
    Outer.java:16: incompatible types
    found : T
    required: T
    innerMember = outerMember;
    ^
    1 error
    This isn't a particularly wonderful sample, but often you do want inner classes to be able to access data from the enclosing class (say, the inner class is an enumerator that enumerates over the contents of the outer class.) But you can't. Dang.
    If nothing else, a better error message should be produced. To me, "T" sure looks like "T".
    * The "README" file indicates that the compiled code only works with a 1.3 or later runtime. I've tested with 1.2 and (thankfully) found no cases where it doesn't work (but there may be some.) That would be a showstopper, as many people who use Frink haven't even installed 1.3 yet, and I've worked hard to make it compatible with 1.2, 1.3, and 1.4.
    Does anyone know why the documents say that the compiled code only works with a 1.3 environment? Let's hope it's a mistake. I thought one of the goals of the generic compiler was to create bytecode that could run in any JVM. And compiling with the new compiler shouldn't introduce dependencies on classes that the programmer doesn't reference...
    I do compile with the -target 1.1 flag for maximum backward compatibility.
    3) NO MORE JAVADOC. Mentioned above; hope you've got
    a copy of the 1.0 javadoc lying around still.Gafter's recent comments in this forum indicated that they've not even begun making a version of the javadoc tool that works on generic code. I sorta wished that something magical might have happened since then, but I guess not.
    The bad-line-numbers-on-non-Unix-platforms bug is
    reputedly gone.But Java is write-once-run-anywhere! That's impossible! :) Gafter posted a (one-line) patch for the original compiler to this forum just a week ago. Wish I had it a year ago. That's why I wish that releases would be made more often--it was fixed long ago.
    5) ONLY WORKS ON JDK1.4. The last release didn't work
    on 1.3 either, as far as I can tell. I tried compiling with 1.3 and the new generic compiler, and got this message:
    Exception in thread "main" java.lang.NoClassDefFoundError
    at com.sun.tools.javac.v8.Main.bugMessage(Main.java:490)
    at com.sun.tools.javac.v8.Main.compile(Main.java:477)
    at com.sun.tools.javac.Main.compile(Main.java:36)
    at com.sun.tools.javac.Main.main(Main.java:27)
    The old compiler did usually work with 1.3 (I've used it for about 10 months with 1.3,) except for 4 classes out of 194, which tickled part of the compiler which used the CharSequence class (which wasn't available until 1.4). Luckily, these 4 classes of mine didn't contain generic code and could be compiled with the normal compiler.
    * The new batch file for Windows contains UNIX-style linefeeds. I think that's sorta bad form.

  • Changing option in function module

    sir,
      plz explain the role or importance of changing option in function module SE37

    hi check this example it had the usage of the changing option..
    here the using will input the value to the perform and do some prosses and output some value..
    PERNR               TYPE P0001-PERNR                           Personnel Number                  
    PLANS               TYPE P0001-PLANS                           Position                          
    ORGEH               TYPE P0001-ORGEH                           Organizational Unit               
    DATE                TYPE SY-DATUM       SY-DATUM               Date and time, current (applic    
    PLVAR               TYPE PLOG-PLVAR     '01'                   Plan Version                      
    ISTAT               TYPE PLOG-ISTAT     '1'                    Planning Status                   
    MANAGER     TYPE     ZHMSS_MANAGER     Structure for manager for MSS
    NO_PERNR_PLANS_ORGEH_SPEC     No pernr, position or org unit specified
    NO_EXIST_PLANS                Position does not exist                 
    INVALID_PLANS                 Position invalid                        
    NO_EXIST_ORGEH                Org unit does not exist                 
    NO_EXIST_PERNR                Personnel number does not exist         
    function z_get_orgunit_manager_info.
    ""Local interface:
    *"  IMPORTING
    *"     REFERENCE(PERNR) TYPE  P0001-PERNR OPTIONAL
    *"     REFERENCE(PLANS) TYPE  P0001-PLANS OPTIONAL
    *"     REFERENCE(ORGEH) TYPE  P0001-ORGEH OPTIONAL
    *"     REFERENCE(DATE) TYPE  SY-DATUM DEFAULT SY-DATUM
    *"     REFERENCE(PLVAR) TYPE  PLOG-PLVAR DEFAULT '01'
    *"     REFERENCE(ISTAT) TYPE  PLOG-ISTAT DEFAULT '1'
    *"  EXPORTING
    *"     REFERENCE(MANAGER) TYPE  ZHMSS_MANAGER
    *"  EXCEPTIONS
    *"      NO_PERNR_PLANS_ORGEH_SPEC
    *"      NO_EXIST_PLANS
    *"      INVALID_PLANS
    *"      NO_EXIST_ORGEH
    *"      NO_EXIST_PERNR
      if pernr is initial and
         plans is initial and
         orgeh is initial.
        raise no_pernr_plans_orgeh_spec.
      endif."pernr is initial and
      if not pernr is initial.
        if pernr cn '0123456789'.
          exit.
        endif.
    *-- See if pernr exists
        call function 'P_EMPLOYEE_CHECKEXISTENCE'
             exporting
                  object_id          = pernr
                  date               = date
             exceptions
                  employee_not_found = 01.
        if sy-subrc ne 0.
          raise no_exist_pernr.
          exit.
        endif.
    *-- Obtain pernr position
        call function 'HR_READ_INFOTYPE'
             exporting
                  pernr           = pernr
                  infty           = c_infty_0001
                  begda           = date
                  endda           = date
             importing
                  subrc           = g_retcd
             tables
                  infty_tab       = i0001
             exceptions
                  infty_not_found = 01
                  others          = 02.
        if sy-subrc eq 0.
          describe table i0001 lines g_lines.
          if g_lines > 0.
            read table i0001 index 1.
    *-- Got position now find org unit
            perform zf_proc_get_om_objects tables i_objects
                                           using c_otype_position
                                                 i0001-plans
                                                 plvar
                                                 c_rsign_a
                                                 c_relat_003
                                                 istat
                                                 date
                                                 date
                                                 c_otype_orgunit
                                        changing g_retcd.
            if g_retcd eq 0.
              read table i_objects index 1.
              g_orgeh = i_objects-sobid(8).
            endif. "g_retcd eq 0.
          endif. "g_lines > 0. for i0001
        endif.  "sy-subrc eq 0 hr_read_infotype
      elseif not plans is initial.
        if plans co '9' or
           plans co '0'.
          raise invalid_plans.
          exit.
        endif.
        call function 'RH_READ_OBJECT'
             exporting
                  plvar     = plvar
                  otype     = c_otype_position
                  objid     = plans
                  istat     = istat
                  begda     = date
                  endda     = date
                  langu     = sy-langu
             exceptions
                  not_found = 1
                  others    = 2.
        if sy-subrc <> 0.
          raise no_exist_plans.
          exit.
        endif.
    *-- Find org unit
        perform zf_proc_get_om_objects tables i_objects
                                       using c_otype_position
                                             plans
                                             plvar
                                             c_rsign_a
                                             c_relat_003
                                             istat
                                             date
                                             date
                                             c_otype_orgunit
                                    changing g_retcd.
        if g_retcd eq 0.
          read table i_objects index 1.
          g_orgeh = i_objects-sobid(8).
        endif."g_retcd eq 0.
      elseif not orgeh is initial.
        call function 'RH_READ_OBJECT'
             exporting
                  plvar     = plvar
                  otype     = c_otype_orgunit
                  objid     = orgeh
                  istat     = istat
                  begda     = date
                  endda     = date
                  langu     = sy-langu
                  CHECK_STRU_AUTH   = space              "ASikaria, 10/15
             exceptions
                  not_found = 1
                  others    = 2.
        if sy-subrc <> 0.
          raise no_exist_orgeh.
          exit.
        endif.
        g_orgeh = orgeh.
      endif. "not pernr is initial.
      if not g_orgeh is initial.
        manager-orgeh = g_orgeh.
    *-- Got org unit now find manager
        perform zf_proc_get_om_objects tables i_objects
                                       using c_otype_orgunit
                                             manager-orgeh
                                             plvar
                                             c_rsign_b
                                             c_relat_012
                                             istat
                                             date
                                             date
                                             c_otype_position
                                    changing g_retcd.
        if g_retcd eq 0.
          read table i_objects index 1.
          if sy-subrc eq 0.
            manager-plans = i_objects-sobid.
            call function 'Z_GET_POSITION_HOLDER'
                 exporting
                      plans              = manager-plans
                      plvar              = plvar
                      istat              = istat
                      date               = date
                 importing
                      pernr              = manager-pernr
                 exceptions
                      position_not_exist = 1
                      position_invalid   = 2
                      others             = 3.
            if sy-subrc <> 0.
              clear: manager-pernr.
            endif.
            if not manager-pernr is initial.
    *- BOC RTDK902962
    *-- Obtained formatted name
              clear: i0001.
              refresh: i0001.
              call function 'HR_READ_INFOTYPE'
                   exporting
                        pernr           = manager-pernr
                        infty           = c_infty_0001
                        begda           = date
                        endda           = date
                   importing
                        subrc           = g_retcd
                   tables
                        infty_tab       = i0001
                   exceptions
                        infty_not_found = 1
                        others          = 2.
              if sy-subrc eq 0.
                read table i0001 index 1.
                if sy-subrc eq 0.
                  manager-ename = i0001-ename.
                endif.
              endif.
    *- EOC RTDK902962
    *-- Obtain pernr information
    *- Get 0002 data
              clear: i0002.
              refresh: i0002.
              call function 'HR_READ_INFOTYPE'
                   exporting
                        pernr           = manager-pernr
                        infty           = c_infty_0002
                        begda           = date
                        endda           = date
                   importing
                        subrc           = g_retcd
                   tables
                        infty_tab       = i0002
                   exceptions
                        infty_not_found = 1
                        others          = 2.
              if sy-subrc eq 0.
                read table i0002 index 1.
                if sy-subrc eq 0.
                  manager-inits = i0002-inits.
                  manager-vorna = i0002-vorna.
                  manager-nachn = i0002-nachn.
                  manager-midnm = i0002-midnm.
                endif.
              endif.
    *- Get 0105 data
              clear: i0105.
              refresh: i0105.
              call function 'HR_READ_INFOTYPE'
                   exporting
                        pernr           = manager-pernr
                        infty           = c_infty_0105
                        begda           = date
                        endda           = date
                   importing
                        subrc           = g_retcd
                   tables
                        infty_tab       = i0105
                   exceptions
                        infty_not_found = 1
                        others          = 2.
              if sy-subrc eq 0.
                describe table i0105 lines g_lines.
                if g_lines > 0.
    *- SAP usrid
                  loop at i0105 where subty = c_0105_usrid_subty.
                    manager-usrid = i0105-usrid.
                  endloop.
    *- Email address
    *// not sure where email is going to be stored but assume it is subtype
    *// 0010
                  loop at i0105 where subty = c_0105_email_subty.
                    manager-email = i0105-usrid_long.
                  endloop.
                endif. "g_lines > 0
              endif."sy-subrc eq 0.
            endif. "not manager-pernr is initial.
          endif. "sy-subrc eq 0.
        endif."g_retcd eq 0.
      endif. "not g_orgeh is initial.
    endfunction.
    zposition holder
    PLANS     TYPE     PLOG-OBJID                               Object ID
    PLVAR     TYPE     PLOG-PLVAR     '01'     Plan Version
    ISTAT     TYPE     PLOG-ISTAT     '1'     Planning Status
    DATE     TYPE     SY-DATUM     SY-DATUM     Date and time, current (application server) date
    PERNR               TYPE      P0001-PERNR                 Personnel Number                
    POSITION_NOT_EXIST            Position does not exist                 
    POSITION_INVALID              Invalid position                        
    function z_get_position_holder.
    ""Local interface:
    *"  IMPORTING
    *"     REFERENCE(PLANS) TYPE  PLOG-OBJID
    *"     REFERENCE(PLVAR) TYPE  PLOG-PLVAR DEFAULT '01'
    *"     REFERENCE(ISTAT) TYPE  PLOG-ISTAT DEFAULT '1'
    *"     REFERENCE(DATE) TYPE  SY-DATUM DEFAULT SY-DATUM
    *"  EXPORTING
    *"     REFERENCE(PERNR) TYPE  P0001-PERNR
    *"  EXCEPTIONS
    *"      POSITION_NOT_EXIST
    *"      POSITION_INVALID
      if plans cn '0123456789'.
        raise position_invalid.
      endif."plans cn '0123456789'.
      if plans co '9'.  "default position
        exit.
      endif.
      call function 'RH_READ_OBJECT'
           exporting
                plvar     = plvar
                otype     = c_otype_position
                objid     = plans
                begda     = date
                endda     = date
           exceptions
                not_found = 01
                others    = 02.
      if sy-subrc ne 0.
        raise position_not_exist.
      else.
        perform zf_proc_get_om_objects tables i_objects
                                       using c_otype_position
                                             plans
                                             plvar
                                             c_rsign_a
                                             c_relat_008
                                             istat
                                             date
                                             date
                                             c_otype_pernr
                                    changing g_retcd.
        if g_retcd eq 0.
          sort i_objects by begda descending. "get earliest rec
          read table i_objects index 1.
          if sy-subrc eq 0.
            pernr = i_objects-sobid(8).
          endif.
        endif. "g_retcd eq 0.
      endif. "sy-subrc ne 0.
    endfunction.
    regards,
    venkat

  • Need of Changing Parameters in Function Module

    Hi All,
    Why we need sepearte Import and Export parameters in Function Module if the Changing Parameters
    acts as both import and export parameters.
    What is the use of using Changing Parametrs in Function Module.
    Thanks in advance.
    Sundaresan

    Hi,
    EXPORT PARAMETERS: When u r passing some value to the function, and the parameter will not be changed in the function, we use export parameter. Example: u pass parameter (a : 10) to a function, even after the function has been executed, value of a will be 10 only.
    IMPORT PARAMETER: When u require some value back from the function. u do not provide any initial value to the function. Example : u pass a parameter (b: <blank>) to the function, function returns the same import parameter as (b : 20).
    CHANGING PARAMETER: When u pass some value to the function and that function may change that value inside function, then changing parameters are used. Example: u pass parameter ( c: 30) to the function as changing parameter and function modifies this variable and return ( c: 50).
    Reward points if helpful.
    Thanks & Regards
    - Rishika Bawa

  • How to change the Callback function of a GUI button?

    I would like to change the callback function associated with a GUI button dynamically in the programming way.
    Here is the code piece I tried, but it does not seem to work:
    const char* pstrLabelSaveJpeg = "SaveJpegCb";
    SetCtrlAttribute(pahel_id, ctrl_id ,ATTR_LABEL_TEXT, pstrLabelSaveJpeg);
    int CVICALLBACK SaveJpegCb(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
    Solved!
    Go to Solution.

    The attribute you used is about the "label" of the button.
    It is just an appearence attribute. You can write your own name on it, but that does not change the callback function.
    You should change the ATTR_CALLBACK_FUNCTION_POINTER attribute, and you should not pass the function name as a string.
    So your function call will look like this:
    SetCtrlAttribute(pahel_id, ctrl_id, ATTR_CALLBACK_FUNCTION_POINTER, SaveJpegCb);
    Of course, you have to declare the SaveJpegCb function somewhere above that line.
    I think you have already done that.
    S. Eren BALCI
    www.aselsan.com.tr

Maybe you are looking for