How to get object/instance name in method

Hi folks,
I have created a class and implemented a method within the class.
Now i would like get the name of instance/object calling this method ,within this method.
Is their any way to get this obj name within method?
Eg:
I hve class ZCL with method METH
Now in some program i used this method, by creating any obj
          data obj type ref to ZCL
          obj->METH
Now is there any way to get this obj name within the methodMETH by using some method like GET_OBJ_NAME(just making a guess)
Regards
PG

>
PG wrote:
> Now is there any way to get this obj name within the methodMETH by using some method like GET_OBJ_NAME(just making a guess)
>
> Regards
> PG
Please check the below code snippet
  DATA:
    lref_obj TYPE REF TO cl_abap_typedescr.
  lref_obj ?= cl_abap_objectdescr=>describe_by_object_ref( me ).

Similar Messages

  • How to get the Instance Name of Creator

    Hi all.
    I have an idea but I don't how to implement it. I have tried about two days.
    the simplified concept that what I wnat is as follows
    class classA {
    classB objB = new classB();
    class classB {
    puclic void showObjName(){
    //How can I the Instance Name of Creator here?
    //In this Example. The name is objA.
    public class showCreator {
    public static void main(String[] args) {
    classA objA = new classA();
    I try to instanciate an Throwable Object and use the getStackTrace method.
    but all information in the stack I got Do Not contain the Instances Name.
    Does any one have idea to implements this...
    Thanks.

    Yes. hashcode is not absolutely unique. I know this.
    I had took this idea into my consideration. But it failed finally.
    Thanks
    To JN_.
    Maybe I still have some misunderstood descripte my question.
    neither the name not an "instance name" nor an "object name".
    So now, I really do not know how to call this.
    Can you tell me? Then I will not make the same fault next time.
    thanks.

  • How to get DB Instance name

    Hi ,
    I have build a solutuon to send email invoce using BIP.
    I want to prefix the DB instance name in email Subject on development/test instances.
    Please suggest me how to get the DB name in BI publisher bursting control file.
    <xapi:message id="1" to="${TO_EMAIL_ID}" attachment="true" content-type="html/text" subject="$
    for exmaple: I have email with
    subject: 74444555 - Invoice(20071429) notification
    on my development box icprj01 I need email subject like
    subject: ICPRJ01 74444555 - Invoice(20071429) notification
    Thanks
    Kumar

    Can't do it in bursting. You will need to pull the db name for sql in a data template or reports6i. Sorry :-(

  • How to get the instance name from the SWFLoader?

    Hi Guys,
    I am new to Flex. i need help from u.
    i load the swf file through the SWFLoader in Flex 3.
    Than how to get the instace(button,text,etc.,) of the loaded
    swf.
    Please help me.

    Yes. hashcode is not absolutely unique. I know this.
    I had took this idea into my consideration. But it failed finally.
    Thanks
    To JN_.
    Maybe I still have some misunderstood descripte my question.
    neither the name not an "instance name" nor an "object name".
    So now, I really do not know how to call this.
    Can you tell me? Then I will not make the same fault next time.
    thanks.

  • How to get the class name  static method which exists in the parent class

    Hi,
    How to know the name of the class or reference to instance of the class with in the main/static method
    in the below example
    class AbstA
    public static void main(String[] args)
    System.out.println(getXXClass().getName());
    public class A extends AbstA
    public class B extends AbstA
    on compile all the class and run of
    java A
    should print A as the name
    java B
    should print B as the name
    Are there any suggestions to know the class name in the static method, which is in the parent class.
    Regards,
    Raja Nagendra Kumar

    Well, there's a hack you can use, but if you think you need it,Could you let me the hack solution for this..
    you probably have a design flaw and/or a misunderstanding about how to use Java.)May be, but my needs seems to be very genuine..of not repeat the main method contents in every inherited class..
    The need we have is this
    I have the test cases inheriting from common base class.
    When the main method of the test class is run, it is supposed to find all other test cases, which belong to same package and subpackages and create a entire suite and run the entire suite.
    In the above need of the logic we wrote in the main method could handle any class provided it knows what is the child class from which this main is called.
    I applicate your inputs on a better way to design without replicating the code..
    In my view getClass() should have been static as the instance it returns is one for all its instances of that class.
    I know there are complications the way compiler handles static vars and methods.. May be there is a need for OO principals to advance..
    Regards,
    Raja Nagendra Kumar
    Edited by: rajanag on Jul 26, 2009 6:03 PM

  • How to get Object key name

    var obj:Object = {a:"foo", b:"bar"}
    obj.a // foo keya=a value='foo'
    obj.b // bar keya=b value="bar"
    for each (var value:Object in obj){
    trace(value);
    Q: How can I get key from obj liking hash?

    var obj:Object = {a:"foo", b:"bar"}
    var retValue:String;
    for ( var key:* in obj)
    if ( obj[key] == "foo")
    retValue= key;
    break;
    return retValue;
    (you could of course return it straight from within the loop
    but thats not very good idea, so , you get the idea right?

  • How to get the ACCOUNTING_FLEXFIELD Name  in a Multi Ledger Instance?

    Hi,
    How to get the <ACCOUNTING_FLEXFIELD> Name in a Multi Ledger Instance from logged-in Responsibility? Is there any profile option available?
    SELECT id_flex_num
    INTO l_structure_num
    FROM apps.fnd_id_flex_structures
    WHERE ID_FLEX_CODE = 'GL#'
    AND ID_FLEX_STRUCTURE_CODE=<ACCOUNTING_FLEXFIELD>;
    Tx

    SMOD->SEUED001->Display componens->double click on EXIT_SAPLEDITOR_002->See the source code...
    function exit_sapleditor_002.
    *"*"Lokale Schnittstelle:
    *"       IMPORTING
    *"             VALUE(PROGRAM) LIKE  SY-REPID
    *"       EXCEPTIONS
    *"              CANCELLED
    include zxseuu22 .
    endfunction.
    PROGRAM is the importing parameter for the function module.
    matt

  • Do we have any native methods to get object instances which are alive ?

    Do we have any native methods to get object instances which are alive ?
    Help appreciated.

    If you are looking for accessing objects that are eligible for GC but are not GC,than it should be very difficult.As Java does not give you memory access to its variables.

  • Get All instance names in the stage

    hi,
    is there any way to get all instance name of the objects presents on the stage ? trace them for example
    thank you

    thank you, it's the correct answer but i still can't solve my problem ,
    the thing is that am using a code from http://www.freeactionscript.com that make enemie follow the player, but i need to do some modification, i need to detect collision between enemies so they will not get the one into the other and the thing that i cannot found their instance name, even when i used your function i only get "player_mc : _level0.player_mc" at the output,
    here is the code, i will be really greatful if you can find a way to help me solve this problem .
    ps :
    am trying to write my own code that make enemie follow the player, coz this one looks very complicated
    thank you
    the code :
    * Game Enemy AI Behavior - Run Away & Follow Player
    * Version:           1.0
    * Author:           Philip Radvan
    * URL:                     http://www.freeactionscript.com
    var enemiesArray:Array = new Array();
    var radians:Number = 180/Math.PI;
    createEnemies(5, "typeA", "e1");
    createEnemies(5, "typeB", "e2");
    createEnemies(5, "typeC", "e3");
    // createEnemies(number of enemies, behavior)
    // use ex: createEnemies(10, "slow", "myLinkedMovieClip);
    function createEnemies(enemyAmount:Number, enemyBehavior:String, enemyLibraryClip:String):Void
              //run a for loop based on the amount of enemies
              for(var i = 0; i < enemyAmount; i++)
                        //set temporary variable that will hold the new enemy attributes
                        var tempEnemy:MovieClip = _root.attachMovie(enemyLibraryClip, "enemy"+_root.getNextHighestDepth(),_root.getNextHighestDepth())
                        //give new enemy a random x/y position based on stage width/height
                        tempEnemy._x = random(Stage.width);
                        tempEnemy._y = random(Stage.height);
                        tempEnemy._rotation = random(360);
                        //set enemy behavior
                        if(enemyBehavior == "typeA")
                                  //define enemy characteristics
                                  tempEnemy.speed = 1
                                  tempEnemy.turnRate = .05
                                  tempEnemy.agroRange = 200;
                                  tempEnemy.mode = "follow"
                        else if(enemyBehavior == "typeB")
                                  //define enemy characteristics
                                  tempEnemy.speed = 4
                                  tempEnemy.turnRate = .5
                                  tempEnemy.agroRange = 200;
                                  tempEnemy.mode = "follow"
                        else if(enemyBehavior == "typeC")
                                  //define enemy characteristics
                                  tempEnemy.speed = 1
                                  tempEnemy.turnRate = .2
                                  tempEnemy.agroRange = 100;
                                  tempEnemy.mode = "run"
                        //define variables that are used to calculate following
                        //*don't change these*
                        tempEnemy.distanceX = 0;
                        tempEnemy.distanceY = 0;
                        tempEnemy.distanceTotal = 0;
                        tempEnemy.moveDistanceX = 0;
                        tempEnemy.moveDistanceY = 0;
                        tempEnemy.moveX = 0;
                        tempEnemy.moveY = 0;
                        tempEnemy.totalmove = 0;
                        //add new enemy to array
                        enemiesArray.push(tempEnemy)
    //Update enemies function
    function updateEnemies():Void {
              //run a for loop based on the amount of enemies
              for(var i = 0; i < enemiesArray.length; i++)
                        //set temporary variable that will hold the new enemy attributes
                        var tempEnemy:MovieClip = enemiesArray[i];
                        //run follow function with temporary enemy as the follower
                        updatePosition(tempEnemy, player_mc);
    // updatePosition(follower, target)
    // use ex: updatePosition(myEnemyMovieClip, playerMovieClip)
    function updatePosition(follower:MovieClip, target:MovieClip) {
              //calculate distance between follower and target
              follower.distanceX = target._x-follower._x;
              follower.distanceY = target._y-follower._y;
              //get total distance as one number
              follower.distanceTotal = Math.sqrt(follower.distanceX * follower.distanceX + follower.distanceY * follower.distanceY);
              //check if target is within agro range
              if(follower.distanceTotal <= follower.agroRange){
                        //calculate how much to move
                        follower.moveDistanceX = follower.turnRate * follower.distanceX / follower.distanceTotal;
                        follower.moveDistanceY = follower.turnRate * follower.distanceY / follower.distanceTotal;
                        //increase current speed
                        follower.moveX += follower.moveDistanceX;
                        follower.moveY += follower.moveDistanceY;
                        //get total move distance
                        follower.totalmove = Math.sqrt(follower.moveX * follower.moveX + follower.moveY * follower.moveY);
                        //apply easing
                        follower.moveX = follower.speed * follower.moveX / follower.totalmove;
                        follower.moveY = follower.speed * follower.moveY / follower.totalmove;
                        //move & rotate follower
                        if(follower.mode == "follow")
                                  follower._x += follower.moveX;
                                  follower._y += follower.moveY;
                                  follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians;
                        else if(follower.mode == "run")
                                  follower._x -= follower.moveX;
                                  follower._y -= follower.moveY;
                                  follower._rotation = (Math.atan2(follower.moveY, follower.moveX) * radians)+180;
    //onEnterFrame that executes the updatePosition updateEnemies every frame
    _root.onEnterFrame = function(){
              updateEnemies();
    //start/stop drag for player_mc
    player_mc.onPress = function(){
              startDrag(this);
    player_mc.onRelease = function(){
              stopDrag();

  • Get the instance names of clips attached to a movieclip

    I want to get the instance names of all the cmovieclips that
    are attached to a movieclip.
    Is there a simple way to do this.
    I imagine this is something that can be done with AS3 but can
    it be done with AS2?
    regards J

    you're welcome.
    FYI: a for...in loop loops through all the accesible
    properties (in the broadest sense of the meaning, includes
    methods/functions and variables etc). Each time it finds one it (in
    this case) assigns the property name to the variable 'unknown'
    the code inside the loop just checks
    a) is it a property that references a movieclip instance and
    b) is it the same property name as the movieclip instance's
    _name property (this is to avoid listing additional references to
    the same movieclip instance that may be set up as variables in your
    McA's scope).
    I just read that and I'm wondering if it actually will help
    you understand... its quite complicated to describe,sorry...
    although its simple to understand once you get used to it. To learn
    you should experiment with a few for.. in loops on different
    objects and see what trace outputs you get.

  • How to get a computer name in teststand step ?

    how to get a computer name in teststand step ?

    Hi,
    Use an ActiveX Automation Adapter with the following settings,
    ActiveX Reference : RunState.Engine
    Automation Server: TestStand API (depends on your version)
    Object Class: Engine (IEngine)
    Action: Get Property
    Property: ComputerName
    Then set your Parameters: to pickup the String ComputerName.
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • How to get carrier company name on windows phone 8.1?

    how to get carrier company name on windows phone 8.1?

    excuse me, i referrer the link http://stackoverflow.com/questions/26973111/get-carrier-name-cellular-mobile-operator-name-using-windows-phone-8-1 to
    modify my universal app.
    but i always get 0 count from the GetNetworkNames() method. 
    if my sim card is for 3G, but i setting 4G in highest connection speed. i got the "the pipe is being closed".
    how can i solve the problem? thank you.

  • IDM : How to get the Resource name in Exclude Rule during Reconciliation?

    Hi
    Problem Statement => How to get the Resource name in Exclude Rule during Reconciliation.
    Problem Description => Apparently, we use exclude rule for not consider some account during reconciliation.
    I need the resource name in exculde rule during reconciliation. I tried with getResources() method which is an inbuilt method.But it gives all the resources are aviablable in the repository (IDM). I need only the current reconcilied resource name instead of fetching all the resouce.
    Can any one please help how to get the resource name in exclude rule during reconciliation?
    Thanks in advance for you help.
    Thanks,
    Chellappan

    Hi,
    Thanks for your reply.
    I have 50 resouces and these resouces using the same kind of exclude rules. In the exclude rule, i am using resource name to do some work. If i get the resouce name in exclude rule, then i can use the same exculde rule for 50 resources. This will minimise the rule count from 50 to 1. For that, i need resouce name.
    Thanks,
    Chellappan Sampath.

  • How to get mobile model name for different types mobile devices

    Hi,
    I have checked few thread in this forum about getting mobile model name at server. So far, i noticed the mobile name is set manually in the midlet as user-agent .
    HttpConnection connection = null;           connection = (HttpConnection)Connector.open(url);          connection.setRequestMethod(HttpConnection.POST);          connection.setRequestProperty("User-Agent","Nokia7110 Profile/MIDP-1.0 Configuration/CLDC-1.0");
    i retrieve the header information from servlet like below :-
    String userAgent = request.getHeader("User-Agent");
    How to get mobile model name for different model devices , not by manually adding the model name in midlet?
    Thanks in advance :-)

    Hi,
    In J2ME there is no method to get the model number from the device. how ever you can use the APIs provided by the device manufacturer if available. But still the APIs will not work with devices from other manufacturer or sometimes it will not work with the devices of the same manufacturer if the API is not supported. so it is better to send the device model name through the header.

  • How to get the Text name to pass in the  parameter header in save_text

    Hi,
      I am trying to change the long text of operation for historical order by using the flat file.I am using the save_text to do this.I would like to know how  to get the text name in order to pass the parameter header in save_text.
      I went to the tcode iw62 to get the header information of the long text.300100000009200000001
    i would like to know what this 1000000092 indicates and where is this value updated in the table so that i can link it thru the order no  to get the link and pass it in the text_name.
      can anyone help me out?
    krishnan

    Hi,
    Your query is.
    I went to the tcode iw62 to get the header information of the long text.300100000009200000001
    i would like to know what this 1000000092 indicates
    In above number
    300 - Client
    1000000092 - AUFPL - Routing number of operations in the order (You can fetch this from table HIVG)
    00000001 - APLZL - General counter for order ( You can fetch this from table HIVG).
    BR,
    Vijay

Maybe you are looking for

  • How to move tabs from one screen to another?

    Just started to group tabs. How can I move tabs from one screen to another to consolidate them into the groups?

  • Getting "replace hard disk error (#10008)" even after replacing hard disk

    Hi! My laptop- HP Pavillion dv 6502- is 4 years old. Recently, the hard disk supposedly crashed as I was not able to get anything other than a blank screen. I checked with BIOS diagnostics, and it showed error #10008- Replace Hard disk. So, I went to

  • Where did Xcode go???

    Hi All, I just downloaded and installed Xcode 2.4, the installation process was ok. But when I tried to find the Xcode icon (the little hammer) in Developer>Applications, I couldn't find it. Previously I had Xcode 2.5 (and I was able to see the icon)

  • Cast a timestamp to date in a "where" clause

    Hi everybody :) I've got a little problem that seems very simple, but I can't solved it myself :( I've got a column with a "timestamp" format, and I'd like to select all the records that are from a precise date, let's say "12/14/2009". I have the fol

  • Navigation Menu not loading text

    Hello All, Just been having a look at iWeb 09 and was initially impressed at how when you add pages to the site they were automatically added to the navigation menu. However now i've come to create a site from the templates it is no longer adding the