Transaction code which using method of a class as start object

Hi all,
I'm creating a new tcode 'Z123' which is tied to a method of a class in SE93. However, when I run this tcode and into debug mode, SY-TCODE will always return OS_APPLICATION. How can I get the actual tcode, which is 'Z123' into my program?
Thanks in advance

You can try using the method GET_CURRENT_TRANSACTION of class CL_DYNPRO. Check this SAP documentation for details:
... the method GET_CURRENT_TRANSACTION of the class CL_DYNPRO can be used to obtain the transaction code of the current transaction. This method returns the transaction code during a parameter transaction or variant transaction instead of the transaction code of the implicitly called dialog transaction.
But if i try checking sy-tcode in a tcode bound to a method of a class i get the correct tcode & not OS_APPLICATION.
Br,
Suhas

Similar Messages

  • Use methods of another class

    Dear Sir/madam,
    i have a question about using methods of another class. I will explane:
    i have made a class which is called A. This class has some attributes (studentName and examRank) and some methods.
    Now i need to made another class called B. Now i want to make an array where i can add some attributes of objects which i made of class A. How can i do that?
    Kind regards

    Here's a for-instance that doesn't use your exact program but demonstrates the point:
    public class A
      int value;
      String name;
      public A(int value, String name)
        this.name = name;
        this.value = value;
      public int getValue()
        return value;
      public String getName()
        return name;
      public String toString()
        return name + ": " + value;
    import java.util.Arrays;
    import java.util.Random;
    public class B
      private static final String[] NAMES =
        "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
      private static final int MAX = 100;
      private A[] myAs = new A[NAMES.length];
      private Random random = new Random();
      public B()
        for (int i = 0; i < myAs.length; i++)
          myAs[i] = new A(random.nextInt(MAX), NAMES);
    public String toString()
    return Arrays.toString(myAs);
    public int getTotal()
    int temp = 0;
    for (int i = 0; i < myAs.length; i++)
    temp += myAs[i].getValue();
    return temp;
    public static void main(String[] args)
    B b = new B();
    System.out.println(b);
    System.out.println("Total: " + b.getTotal());

  • Use methods in other classes

    Can I use methods from other classes than the class that myClass extends?
    ex. myClass extends parentClass{
    myMethod()
    myMethod() is declared in i third class. Is this possible or can I only use classes from the parent class?
    -Thanks-

    I'm not really sure what the previous two answers were getting at.
    Yes, you can use methods all the way up the class hierarchy, as long as they are visible.
    For example, Object implements toString(). You can call toString() on any object in Java and it will render the object to a string in one way or another. That is because toString() is public.
    If toString() were protected, you would only be able to call the method if you were a subclass of of that object (or in the same package), which would make the toString() method much less useful.
    I would suggest reading up on the differences in the four visibility modifiers (private, (default), protected, and public). Private is the only one which nothing else can call. If you are public or protected, any subclass can call the method, even if there are 20 superclasses between the implementor and the caller.
    Good luck!
    Steve

  • What are the transaction codes we use for LSMW in MM, SD, PP  & FI/CO gnrly

    Hi all,
    What are the transaction codes we use for LSMW in MM, SD, PP  & FI/CO generally?
    Help will be surely rewarded.
    Thanks and Regards,
    Creasy

    > What are the transaction codes we use for LSMW in MM, SD, PP  & FI/CO generally?
    General threads about LSMW in MM, SD, PP, FICO will be locked and deleted generally.
    > Help will be surely rewarded.
    &********************** Please read "the rules" if found usefull... ************************&
    Cheers,
    Julius

  • In Transaction code va41 how to set default sales contract start date

    Hi ,
    In Transaction code " VA41 "  how to set default sales contract start date and end date.
    Can any one tell me the correct user exit for the same.
    Thanks
    Basu

    hi,
    u have to use user exits  or badis.
    use sutable exits mentioned below.
    SDTRM001  Reschedule schedule lines without a new ATP check          
    SDVFX006  User exit: Tax line (transfer to accounting)               
    V45A0001  Determine alternative materials for product selection      
    V45A0002  Predefine sold-to party in sales document                  
    V45A0003  Collector for customer function modulpool MV45A            
    V45A0004  Copy packing proposal                                      
    V45E0001  Update the purchase order from the sales order             
    V45E0002  Data transfer in procurement elements (PRreq., assembly)   
    V45L0001  SD component supplier processing (customer enhancements)   
    V45P0001  SD customer function for cross-company code sales          
    V45S0001  Update sales document from configuration                   
    V45S0003  MRP-relevance for incomplete configuration                 
    V45S0004  Effectivity type in sales order                            
    V45W0001  SD Service Management: Forward Contract Data to Item       
    V46H0001  SD Customer functions for resource-related billing         
    V60F0001  SD Billing plan (customer enhancement) diff. to billing plan
    Edited by: katigiri linganna on Apr 28, 2009 12:19 PM

  • Creating of Notes for Transaction Code RECN(Using Classes and Methods)

    Hi Experts,
    I want to Create Notes for Transaction Code RECN, This should not done manually but should be done programatically.
    I had used the Class CL_GOS_SRV_NOTE_CREATE to create the notes.....but here comes the doubt for me.....note will be created by using this class and how this can be created for the Tcode RECN........
    I am using the Real Estate Module.....Plz help me....awaiting for ur helpful answers....
    Thanks in Advance.....!
    Brahma

    Hi kanagaraja,
    Thanks...!
    The BADI which u have given is not existing in my system...i had gone through the se18 and se19 tcodes....
    Awaiting for ur response......!
    Thanks,
    Brahma...

  • How to use method of Standard Class

    Hi all,
                  I want to call a pop up in pcui screen in some standard application with some text. I have made Zclass of  standard SAP class which i am using (cl_bsp_accmod_contact in CRM system).
    I think i have to call 'PRINT_STRING' method of  standard class CL_BSP_ELEMENT.
    <i>I am trying to use this code: </i>
    <b>
    data: lr_data type ref to cl_bsp_element.
      concatenate html 'rohit' into html.  (html is a string)
      lr_data->print_string( html ).</b>
    <u>but it gives a dump:</u>
    You attempted to use a 'NULL' object reference (points to 'noth
    access a component (variable: "lr_data").
    An object reference must point to an object (an instance of a class)
    before it can be used to access components.
    I dont know how to assign object reference to an object???
    Plz help me in this regard,
    Thanks in advance,
    Rohit

    Hi ,
    try and use :
    data: lr_data type ref to cl_bsp_element.
    concatenate html 'rohit' into html. (html is a string)
    lr_data->print_string( html = html ).
    You are creating a variable...but not passing the value to the parameter...it is exactly like callin get_data or get_cell_value...!!
    Hope this helps.
    <i><b>Do reward each useful answer.</b></i>
    Thanks,
    Tatvagna.

  • Count lines of code present in methods of a class

    Hi Friends,
    Can anyone suggest how to count lines of abap code in methods of a class?I have used the function module  'SEO_CLASS_GET_INCLUDE_SOURCE' but this function module doesnt counts the code for methods of a class.
    Kindly help.
    Regards
    ST

    Hi siji,
    once try the below info.
    data: itab type table of string.
    data: w_lines type i.
    read report <reportname> into itab.
    describe table itab lines w_lines.
    write: / 'Report lines:', w_lines.
    It is however important to find the exact report name.
    For standard ABAP reports it is easy, it is the name of the report itself.
    For classes and function modules this is somewhat different.
    Correct report name for function modules can be found as follows :
    Use table TFDIR, field FUNCNAME is your function module.
    PNMAME contains the main program name of the function group, not of the function module.
    Function module report can be created as follows PNAME+3 concatenated with 'U' and field INCLUDE.
    Example for the function module RFC_PING this will be
    'LSRFC' + 'U' + 07 = report name LSRFCU07
    Also take a look at the function module FUNCTION_INCLUDE_CONCATENATE
    Hint: lines( ) is a built-in (system class) static function returning the number of lines in a given internal table. You will like it much better than old-fashioned DESCRIBE TABLE statement where you make us of a count variable an need one more statement for the summing up.
    Note:  If you dont want to count blank line and comments, try this code
         delete itab where table_line is initial or table_line(1) = '*'.
           add lines( itab ) to total_linecount.
    Regards,
    Ravi

  • Error in using method get_event of class cl_htmlb_manager.

    Hi All,
    i am trying to get the event details in a particular method as follows;
    data: event type ref to cl_htmlb_event .
    event = cl_htmlb_manager=>get_event( runtime->              server-  >request ).
    i am getting an error
    field RUNTIME is unknown , it is neither in one of the specified tables nor defined by DATA statement. DATA statement. DATA statement.
    Where am i going wrong?
    plz help.
    BR,
    Annu.

    Hi Jorge,
    I am trying to use it in the method GET_LIST of class CL_SUS_M_ORDER_LIST .
    If i use
    event = cl_htmlb_manager=>get_event_ex( request ).
    again i get the error  Field REQUEST is unknown .
    and if i dont declare event using data statement
    data: event type ref to cl_htmlb_event .
    then i get the error that Field EVENT is unknown.
    My application is MVC pattern.
    So is there anyother way of geting the EVENT details when RUNTIME / REQUEST are not available ?
    Thaknks for the reply.

  • Use method from father class for event

    Hi,
    I want to use a preDelete event in my class, but the method I would like to call for the event is not in the class itself, but in the (abstract) predecessor class. Any chance to do this? At the moment I can't select the method in the event tab page (it's not in the list to choose from ...)
    Thank you!
    J.F.

    In 9.0.4 you will need to add the parent class as a descriptor and choose to deactivate it. This will allow you to choose methods from that class in the subclass descriptors.
    In 10.1.3 there is a dialog for specifying classes that are not persistent, but necessary in other persistent classes: http://www.oracle.com/technology/products/ias/toplink/doc/1013/main/_html/mw007.htm#sthref629
    A good explanation of why we don't store the parent and referenced classes unless explictly asked can be found here: Re: Mapping Workbench  10.1.3.0 Bug - Cannot add Implemented Interfaces
    Hope this helps,
    Karen

  • How to use method of one class in other class.

    Hi.I am new to object orient approach .I am developing a project which has a class as application .My class has it state control as another class which is notification class.I want to use my notification class method (init)in my application class method .i have also used read and write accessors vis.But i have broken lines in my code.Please help me correct it. and print screen is attached below.
    Attachments:
    Application.docx ‏143 KB

    On the left, you have wired 2 sources on the same tunnel/wire, so that's 1 broken wire.
    In the For loop, you are trying to wire a "Red" object from the first subVI to the input of the "Green" subVI, so a "Green" object. If Red is not a descendant class of Green (or share a common ancestor), it is not permitted.
    FInally, the output of the For loop, is a 1D array of "Green" objects, which is probably not the same data type as the input of the last subVI on the right (it's probably a "Green" object scalar).
    Overall, you can use the "List Errors" dialog box (Ctrl+L) to debug your code, and make exhaustive use of the contextual help (Ctrl+H) to see what is going on when focusing a broken wire.
    Regards
    Eric M. - Application Engineering Specialist
    Certified LabVIEW Architect
    Certified LabWindows™/CVI Developer

  • Explizit using methods of base class

    when using a base class reference from an abstract class A and creating an object of subclass B
    A ref_A = new B();
    assuming we have implemented the method m() in A and B, then
    ref_a.m()
    calls Method m of subclass B
    (dynamic binding, fine)
    Is there a possibility to force explicitely the call of method m of superclass A.
    (i mean not a call from Method m in B with super())

    are you absolutely sure ?I am sure. Perhaps you are thinking of C++ (and if you're not, I am!) where you can write: ref_A.A::m(),
    but there's no way from the client code to do that in Java. If you really need to do this, your
    design of A should reflect it:
    public abstract class A {
        public final void mOldSchool() {...}
        public void m() { mOldSchool(); }
    public class B extends A {
        public void m() {...}
    }I agree with Kayaman, though: question your design. In the abstract, this is a shakey design.

  • Trying To Understand Some Code Which Uses the [i] Syntax

    Ok I'm trying to get a grip on using loops within flex and I found the following code somewhere which utilises a for in loop. It basically is a function that creates several labels for all of the elements in an object. One thing I cannot understand is what the [i] is used for on line 5 i.e. (myArray[i])  or more specifically what the purpose of such Square brackets in situations like these are used for. Does it refer to looking for all Strings in the array (as defined on line 3) as I assume it does? It's just pretty confusing. Can anyone point me to a guide on the syntax of square brackets and what they mean or help me out? with an explanation? Cheers.
    private function createLabels():void{
    var myArray:Array = ['one', "two", 3];
    for(var i:String in myArray){
    var myLabel:Label = new Label();
    myLabel.text = (myArray[i]);
    myBox.addChild(myLabel);

    You've probably already seen these, but here are a couple of links that may help.
    http://help.adobe.com/en_US/FlashPlatform//reference/actionscript/3/operators.html#array_a ccess
    http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/Array.html
    What's basically happening is that the "for" loop goes through each item in the array.  Don't be confused by the fact that two of the items in the array are Strings and one is an Integer - variable i being a String has nothing to do with the data type of the elements in the array.
    The following code:
    private function createLabels():void
         var myArray:Array = ['one', 'two', 3];
         for(var i:String in myArray)
              trace("i = " + i);
              trace(myArray[i]);
    gives the following results:
    i = 0
    one
    i = 1
    two
    i = 2
    3
    From that we can see that the "for" loop is assigning the index number of each array element, not the actual array element ('one', 'two', or 3) to the variable i.  So calling myArray[i] is the same as calling myArray[0] the first time through the loop.  This type of "for" loop is just a shorter way of doing the following, which produces exactly the same results:
    private function createLabels():void
         var myArray:Array = ['one', 'two', 3];
         for(var i:int = 0; n < myArray.length; i++)
              trace("i = " + i);
              trace(myArray[i]);
    Hope that helps.
    Cheers!

  • How to find currently editing transaction code details using ABAP code

    Hi,
      if some user is using VA02 tcode.i want to know for which sales order(i.e Sales order number)he is making changes.
    i want ABAP code sample for this scenario.
    Cheers,
    Jag

    Hi,
                  For this you need to create Lock Object from se11 .It will automatically crate Two Function modules for enque and deque.
    In you case If you want to see the Details for Va02 use.
        CALL FUNCTION 'ENQUEUE_EVVBAKE'
             EXPORTING
                  VBELN          = VBELN
             EXCEPTIONS
                  FOREIGN_LOCK   = 1
                  SYSTEM_FAILURE = 2.
        CASE SY-SUBRC.
          WHEN 1.
            MESSAGE E042(V1) WITH vbeln RAISING ERROR_IN_COPY.
        ENDCASE.
    Regds,

  • Performance tuning of a customised Transaction Code which for interface

    Hii All ,
    I am new to performance tuning  please guide me How to do performance tuning of Custom T-code through I am aware of all T-codes for performance tuning.
    Please guide hoe to do it and what are basic need to before to start Performance tuning ?
    Thanks
    ABAP Pro
    Moderator message: Please Read before Posting in the Performance and Tuning Forum
    Locked by: Thomas Zloch on Jun 7, 2011 9:37 AM

    I recommend :
    1. use SQL tracing with DBMS_MONITOR and then TKPROF on raw SQL trace file
    2. call the function as it used in your production environment
    See good examples in http://www.oracle-base.com/articles/10g/SQLTrace10046TrcsessAndTkprof10g.php (just refer to DBMS_MONITOR examples and TKPROF).
    Note that SQL trace will only trace SQL and not PL/SQL. If SQL elapsed time does not match function call elapsed time close enough, you need to use DBMS_PROFILER to know where PL/SQL non SQL code elapsed time is used.
    I don't recommend using EXPLAIN PLAN because it has known limitations http://docs.oracle.com/cd/E11882_01/server.112/e16638/ex_plan.htm#PFGRF94673 (others have said "EXPLAIN PLAN lies" - you can google for this expression ....).
    Edited by: P. Forstmann on 10 févr. 2012 19:44

Maybe you are looking for