Method called reverse that switches complex number coordinates.

I have written a class called "Complex" and there are no errors in the program.
What I am confused about is how to answer an assigned question. The question
is this: "Write a method called reverse which will return a new complex number
with the coordinates reversed. That is, if the complex number which invokes
the method has coordinates (a,b), then the method should return a new complex
value with coordinates (b, a)."
I will include my code for the class here (I'm using the NetBeans IDE):
* To change this template, choose Tools | Templates
* and open the template in the editor.
package tutorial8;
* @author Aleks
public class Complex
    private int I; // Real Part
    private int J; // Imaginary Part
    public Complex(int I, int J)
    setComplex(I, J);
public int getI()
    return I;
public int getJ()
    return J;
public void setComplex(int I, int J)
this.I=I;
this.J=J;
if (I==J)
System.out.println("true");
else
System.out.println("false");
}thanks.

Your right it compiles without errors but it says it's missing a main method.
This main method thing is driving me insane. Some of my classes work such as the following
one:
* To change this template, choose Tools | Templates
* and open the template in the editor.
package tutorial7;
* @author Aleks
import java.util.Scanner;
public class Shortcalculation
    public static void main(String[] args)
        Scanner keyboard = new Scanner(System.in);
        System.out.println("Enter a positive integer");
        int positiveInteger = keyboard.nextInt();
       if (positiveInteger < 2)
        System.out.println("First positive integer output");
        positiveInteger = 4;
        while ((positiveInteger/3 >=1) && (positiveInteger/3 < 2))
            System.out.println("4");
        else if (positiveInteger < 3)
        System.out.println("Second positive integer output");
        positiveInteger = 21;
        while ((positiveInteger/5 >=2) && (positiveInteger/5 < 3))
            System.out.println("21");
        else if (positiveInteger < 4)
        System.out.println("Third positive integer output");
        positiveInteger = 43;
        while (positiveInteger/7 <=3)
            System.out.println("43");
        else
        System.out.println("Not a valid integer");
}But I don't see why THIS one shouldn't. I try to include a "public static void main(string[] args)"
in the class complex but it says it's an illegal start of the expression. Maybe it depends on
where in the class I put it. I'm only practicing writing classes for 3-4 weeks now because I've read
a lot of the book. Too bad my memory is kind of bad. Ok, I have changed the class for this
question, I have added a reverse method. I did it without a return statement.
* To change this template, choose Tools | Templates
* and open the template in the editor.
package tutorial8;
* @author Aleks
public class Complex {
    private int I; // Real Part
    private int J; // Imaginary Part
    public Complex(int I, int J)
    setComplex(I, J);
    public int getI()
    return I;
public int getJ()
    return J;
public void setComplex(int I, int J)
this.I=I;
this.J=J;
if (I==J)
System.out.println("true");
else
System.out.println("false");
public void reverse()
this.I=J;
this.J=I;
}sorry for the long post.

Similar Messages

  • SSIS OLE DB Source in Data Flow Task calling SP that returns variable number of column as output

    We have one old Stored Proc that I need to reuse. But that stored proc returns different number of Columns as output depending on input Parameter. Say, if I pass 1 to 9 it will return 'ID', if i pass 10 to 33 it will return 'ID', 'Name',  if I pass
    34 to 51 it will return 'ID', 'Name', 'DefaultPosition' 
    In this way.
    Now I wanted to use this in OLE DB Source in SSIS DFT. 
    During that time immediately it is picking all possible columns in Available External Columns. Even if I manually select/delete those, package is failing at Runtime, because in Runtime the parameter this will get, it should always return one & only one
    column which is ID. [Because in this package I will only have to pass parameters like, 1 or 2 or 5 or 7 or 9.
    Which in every  case should return only ID from stored proc.
    Any Idea how I can get this please?
    Regards, Avik M.

    Has any one tried something like it? Could you please provide me a sample if you have done it.
    I tried these options but always got errors as
    [usp_return [64]] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E55.An OLE DB record is available.  Source:
    "Microsoft SQL Server Native Client 10.0"  Hresult: 0x80040E55  Description: "Column does not exist.".
    [SSIS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on component "usp_return" (64) returned error code 0xC0202009.  The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning
    of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.  There may be error messages posted before this with more information about the failure.
    ~ Thank you so much
    Regards, Avik M.

  • Taskflow Method call receiving null parameter.

    Hi all,
    I am using 11.1.1.6. I have created in my application an extra project which is pure Java objects and exposed a master class as a POJO DC. In my application, I have a taskflow where I have dragged and dropped one method from my POJO DC - 2 of the parameters of this methods are coming from an application scope bean. I have debugged the application, and made sure that the object being returned by the getter of my app scope bean is not null. So basically, when the breakpoint is in the return statement of my getter the oject is not null and it has been correctly initialized. Just after that, the next breakpoint is in the class receiving the parameter in my POJO DC class. In there, the object is NULL.
    Does anyone knows wat could be the reason??

    Hi Frank Nimphius-Oracle,
    That is precisely the problem.  The object is being passed as to the taskflow as an input parameter (getting it from my application scope bean). If I access the pageFlowScope inside my taskflow I see it and its there, correctely intialized. However, when I call a method call activity that consumes that object as parameter, all what it gets is null.
    The method that consumes this object is in a separate project, and its exposed in a POJO DC. I don't know if it has to be with the complexity of the object I am passing or what but I don't understand why its not being passed correctly to the DC Method.

  • Fastest method call

    Hi,
    All the method calls (instance, static, newObject,...) in JNI come in 3 forms, that are different regarding the lastest argument(s), which are the actual arguments of the method call :
    - one that take a variable number of args
    - one that take a jvalue[]
    - one that take a va_list.
    Is there any one of those that is known to be faster than the others ? Is is known according to experiments or by design?
    (Note : I am currently using Sun's JDK 1.3 & 1.4 on W2K)
    Thanks for your advice...
    C.Dore

    - one that take a variable number of args
    - one that take a jvalue[]
    - one that take a va_list.I can't speak to the middle one, but the 1st and 3rd are variations of the same thing. One might suppose that the first would be slightly slower than the 3rd because a variable assignment would be required in the 1st.
      void doit(char* format, ...)
        va_list vl;
        va_start( vl, format );
    .Of course the only way that I have ever found that increasing the performance of an application is to actually benchmark/profile it.

  • Create method call

    this.getDepartmentsLocalHome().create
    (dept.getDepartmentId(), dept.getDepartmentName());
    (the example from: http://www.oracle.com/technology/obe/obe_as_1012/j2ee/develop/endtoend/defaultejbscope/defaultejb.htm#t4)
    does the create method called like that allow to insert a new record with all its attributs setted in the controller layer?? or should i define a new create which takes all the attributes as parameters?
    thank u!

    it s the first time i develop with EJB technology.
    i dont know how to use the create method.
    i m trying the following code to add a new row in myObject table:
    public void addMyObject(MyObjectLocalDTO parametre)
    try
    MyObjectDTO obj = this.getMyObjectLocalHome().create();
    obj.setAttr1(parametre.getAttr1());
    obj.setAttr2(parametre.getAttr2());
    obj.setAttr3(parametre.getAttr3());
    obj.setRelationship_idmyobjectDTO(parametre.getRelationship_idmyobjectDTO());
    catch (NamingException e)
    System.out.println(e.toString());
    throw new javax.ejb.EJBException(e);
    catch (CreateException e)
    System.out.println(e.toString());
    throw new javax.ejb.EJBException(e);
    is that correct and enaugh to insert my row? or is there a better way to do that?
    thank u.
    regards

  • How detect method calls that are not already in 1.4

    My program is compiled with JDK 1.5 or 1.6 and retroweaved to 1.4.
    If I do not take care I may type
    int i=65;
    Character.isDigit(i);
    instead of
    Character.isDigit(char)i);
    Without casting to char it uses a method that exists only since 1.5 but not
    yet in 1.4.
    There are a few other methods that had been added since 1.5
    Their use leads to NoSuchMethodError on 1.4 clients.
    Their usage must be avoided.
    How can I recognize them at compile time?
    Or has anybody written a tool to check all method calls
    whether they already exist in 1.4 ?
    If not I would write it myself and probably will use the javap output.
    After reading through the docs of java.lang.reflect.Method I guess that
    there is no flag telling when a method had been introduced.

    there was some discussion on that here:
    http://forum.java.sun.com/thread.jspa?threadID=586602
    If you use ant, you could also try and configure the src and target properties of javac task:
    http://ant.apache.org/manual/CoreTasks/javac.html
    Alper

  • Method calls in switch and for statements

    I have 2 questions concerning method calls in switch and for statements. Consider these two chunks of code:
    1)
         switch (foo.getIntegerValue()){
              case 1:
              case 2:
         }My question is, is getIntegerValue() being called for every case statement (since it has to compare with each case) or is the method called only once?
    2)
    for (Foo bla : xyz.compileFoos()) {
    }Is compileFoos called once or on every iteration?
    I assume it gets called only once but I would like to be sure. The reason I ask is of course to avoid multiple method calls.
    any help is appreciated

    sdb2 wrote:
    I have 2 questions concerning method calls in switch and for statements. Consider these two chunks of code:
    1)
         switch (foo.getIntegerValue()){
              case 1:
              case 2:
         }My question is, is getIntegerValue() being called for every case statement (since it has to compare with each case) or is the method called only once?
         Once, and the value returned compared to each "case" in turn.
    2)
    for (Foo bla : xyz.compileFoos()) {
    }Is compileFoos called once or on every iteration?
    I assume it gets called only once but I would like to be sure. The reason I ask is of course to avoid multiple method calls.
    any help is appreciatedAlso once, and the returned list/set/array is iterated over.

  • Mifi 5510l pop the battery out and on the white barcode label at the bottom right is a 6 digit code. is that 6 digit only for my device or other devices alike ? what is that 6 digit number called ?

    what is that 6 digit number called ?

    The photo did not attach but I think I can see on my own devices the 6 digit number you are referring to.  Both the 4510L and the 4620L have these 6 digit numbers posted near the IMEI number.  I would assume that these are batch numbers from the production process and are not unique for each individual device.  6 digits does not give you very many possible models to work with.
    While the origins of that specific number are not certain we can confirm for you that the MAC and the IMEI are much more reliable identification numbers to go from.  If the MAC and IMEIs from your coworkers photo do not match the MAC and IMEI of the device in your hand then there is nothing to debate.  If they do happen to match well then you may have to dig into the problem a little more.
    IMEI's are sprint identification numbers.  MAC addresses are hardware identifications used on a network.  Although IP Addresses can be dynamically assigned to anyone, a MAC address is always going to be unique and the same for a specific device.  These two should be entirely unique for each device according to the stickers on the backs of the jetpacks.

  • I got one India toll free number starting 1800 can I call to that number using my Skype account

    I got one India toll free number starting 1800  . Is it possible for me to make call to that number using my Skype account ?

    If it does not work, I do not believe it is supported.  According to the Skype FAQ only these countries are currently supported (with no timeline for other countries): https://support.skype.com/en/faq/FA24 Viewing the Pay as you go rates for India, India toll-free is not listed while other countries that are supported are listed. IndiaCalling - per minute 1excl. VATIndia1.5¢India - Ahmedabad1.5¢India - Bangalore1.5¢India - Hyderabad1.5¢India - Madras1.5¢India - Mobile1.5¢India - New Delhi1.5¢ FranceCalling - per minute 1excl. VATFrance22.3¢France - 089135¢France - 089245¢France - 089345.5¢France - Mobile4¢France - Paris22.3¢France - Shared Cost22¢France - Toll Free30¢

  • HT201229 HI, i already blocked a number, unfortunately i rcvd a call from that number today ( i didnt anwer though ) ) and it didnt  registered in my call history. why is that?

    Hi! I already blocked a number, unfortunately i recieved a call from that number just now ( though i didnt answer it) i checked my call history but that number wasnt registered in my call registry. why can it still contact you if u have already blocked it? pls help! thanks!

    Hi.  I checked on the order and it says the order is currently being processed and I should check back tomorrow. I'm mostly just concerned because I got an email saying the order was on hold, and I want to make sure it actually does go through and I'm not just waiting for a delivery that's not going to come. I'm still confused as to why I'd get an email saying I had to call the fraud department only to be told I shouldn't have called the fraud department.

  • Hi Everyone,  I am using iPhone5, my question in how to display name and contact number both stored for incoming and outgoing calls? If I have saved five different numbers with a same name, how do I recognise that from which number caller is calling?

    Hi Everyone,  I am using iPhone5, my question in how to display name and contact number both stored for incoming and outgoing calls? If I have saved five different numbers with a same name, how do I recognise that from which number caller is calling?

    I have friends all over Europe, does it matter what number they use to call me? Nope! All incoming calls are free for me.
    The only time you ever have to worry about which number is if you get charged for incoming domestic/international calls.
    You can tag their number (work/home/iphone) and that may show on the CallerID accordingly.
    It should show, John Doe
    underneath,    work/home/mobile
    For example:
    http://shawnblanc.net/images/img-0009-1.png

  • Logging method calls

    Hi all!
    I'm working on a complex java system and have problems debugging it. One of the problems is, that sometimes the program stops with a NullPointerException. Unfortunately this happens in third party code, which I do not have as source. However, I'm sure that the bug is caused by a module developed by my as exchanging this module with another implementation stops the problem.
    Is there an easy way to generate a list of method calls for an entire run of a program? At the time the exception is raised, none of my methods remains in the call stack, i.e. the exception is triggered by the foreign code, but probably caused by a value returned earlier from one of my methods. I would therefore like to see what methods have been called before the exception is triggered.
    I'm currently working with JBuilder 6. It offers a debugger, but this debugger is terrible slow and very bad when the code that is to debug is not available. You could set a method breakpoint for every method I have implemented, but this would take ages. Even with only one such exception defined, the programm takes several minutes in debug mode, while it usually takes only a fraction of a second. This seems to be completely unworkable. Another thing I have tried was the built-in profiler of the JVM, but it shows results in an aggregated and messy way, not much of a help either.
    Any better tools/techniques out there?
    Thanx in advance,
    Mathias

    A method for writing to a log file is not a problem, but I would need to add at least one line of code for every
    of my methods and, more important, a meaningful log message like the method name and arguments.
    One of the reasons I decided not to implement this, was the impossibility to determine the name or signature
    of the current method automatically.Below the code I wrote for my dissertation project. I assert my authorship and copyright of this code, and hereby grant anyone who wants it permission to reproduce this and to create derivatives. It determines the name of the current method automatically, and runs under Java 1.1 (Microsoft machine - I think the Sun machine dislikes using null as the argument for the StringStream constructor, but I wasn't worried about fixing that so haven't investigated too closely). The Tracer.enter() method appends the method name and "{" to the log file. It's proof of concept - I may write an improved version after my exams. Comments cut short to avoid annoying people who don't want to scroll too far.
    import java.io.*;
    public abstract class Tracer
        static File trace_file;
        static FileWriter fw;
        static final int METHOD = 0;
        static final int FLOW = 2;
        static final int MAJOR = 4;
        static final int MINOR = 6;
        static final int trace_level = 7;
        /* Params:    IN  filename    - a String containing the desired name for */
        /*                              the trace file.                          */
        public static void open(String filename)
            try
                trace_file = new File(filename);
                fw = new FileWriter(trace_file);
            catch (IOException ioe)
                System.out.println("IOException in Tracer.open()");  
        /* Params:    IN  s           - the String containing the trace message  */
        /*            IN  level       - the level of detail of the message       */
        /* Operation: If the specified level is sufficiently low, this method    */
        /*            constructs a Throwable and processes its stack trace to    */
        /*            find the name of the method which called trace.  It then   */
        /*            writes this method name and the trace message to the trace */
        /*            file, terminating the line with a Microsoft EOL (LF-CR).   */
        private static void trace(String s, int level)
            if (level <= trace_level)
                StringStream stringStream = new StringStream(null);
                Throwable bomb = new Throwable();
                bomb.printStackTrace(stringStream);
                String method = stringStream.getMethod();
                try
                    fw.write(method+"  "+s + "\015\012");
                    fw.flush();
                catch (IOException ioe)
                    System.out.println("IOException in Tracer.trace()");  
        /* Operation: Closes the FileWriter and sets the File and FileWriter to  */
        /*            null.                                                      */
        public static void close()
            try
                fw.close();
            catch (IOException ioe)
                System.out.println("IOException in Tracer.close()");  
            trace_file = null;
            fw = null;
        /* Operation: Calls trace with message "{" and trace level METHOD.  This */
        /*                method should be called whenever a method is entered.  */
        public static void enter(String method)
            trace("{", METHOD);
        /* Operation: Calls trace with message "}" and trace level METHOD.  This */
        /*            method should be called just before any return statement,  */
        /*            or before the final } of a method with return type void.   */
        public static void exit()
            trace("}", METHOD);
        /* Params:    IN  flow_statement                                         */
        /*                            - a description of the branch just taken   */
        /* Operation: Calls trace with message flow_statement and trace level    */
        /*            FLOW.  NB This method should be called at the start of any */
        /*            block except a method body, when enter should be called.   */
        public static void flow(String flow_statement)
            trace(flow_statement, FLOW);  
        /* Operation: Calls trace with message major_statement and trace level   */
        /*            MAJOR.  This method should be used for displaying the      */
        /*            results of important steps.                                */
        public static void major(String major_statement)
            trace(major_statement, MAJOR);
        /* Operation: Calls trace with message minor_statement and trace level   */
        /*            MINOR.  This method should be used for displaying the      */
        /*            results of minor steps.  It would probably be overkill to  */
        /*            call minor after every single statement.                   */
        public static void minor(String minor_statement)
            trace(minor_statement, MINOR);
    import java.io.*;
    /* This class, which extends PrintStream, exists to allow me to get the   */
    /* name of the method invoking trace by creating a Throwable and          */
    /* examining its stack trace.  This is more reliable than tracking the    */
    /* stack myself.                                                          */
    class StringStream extends PrintStream
        StringBuffer sb = new StringBuffer();
        int state = 0;
        public StringStream(OutputStream out)
            super(out);
        public StringStream(OutputStream out,
                            boolean autoFlush)
            super(out, autoFlush);
        String getMethod()
            String return_value = sb.toString();
            sb = new StringBuffer();
            state = 0;
            return return_value;
        public void print(char[] chars)
            for (int j = 0; j < chars.length; j++)
                print(chars[j]);
        public void print(char ch)
            switch (state)
                case 0:
                case 1:
                case 2:
                    if (ch == '\t')
                        state++;
                    break;
                case 3:
                    if (ch == ' ')
                        state++;
                    break;
                case 4:
                    if (ch == ' ')
                        state++;
                    else if (ch == '/')
                        sb.append('.');
                    else
                        sb.append(ch);
                    break;
                default:
                    // do nothing
    }

  • ADF Mobile: WebService data control method call with array

    JDev 11.1.2.3
    ADF Mobile deployed to Android emulator
    Hello All,
    I am trying to invoke a method in my Web Service data control and get the following exception
    Caused by: ERROR [oracle.adfmf.framework.exception.AdfInvocationRuntimeException] - Cannot serialize: [I@1dbae822
            at oracle.adfmf.dc.ws.soap.SoapTransportLayer.invokeSoapRequest(Lorg/ksoap2/SoapEnvelope;)Ljava/lang/Object;(Unknown Source)
            at oracle.adfmf.dc.ws.soap.SoapWebServiceOperation.invoke(Ljava/lang/String;Loracle/adfmf/dc/ws/soap/SoapGenericType;)Ljava/lang/Object;(Unknown Source)
            at oracle.adfmf.dc.ws.soap.SoapWebServiceOperation.invoke(Ljava/lang/String;Ljava/util/Map;)Ljava/lang/Object;(Unknown Source)
            at oracle.adfmf.dc.JavaBeanOperation.execute(Ljava/lang/Object;Ljava/util/Map;)Ljava/lang/Object;(Unknown Source)
            at oracle.adfmf.dc.ws.WebServiceDataControlAdapter.invokeOperation(Ljava/util/Map;Loracle/adfmf/bindings/OperationBinding;)Z(Unknown Source)
            at oracle.adfmf.bindings.dbf.AmxMethodActionBinding.execute()Ljava/lang/Object;(Unknown Source) This method is an AppModule method exposed as a service interface and the parameter for this method is a List<oracle.jbo.domain.Number>. The schema definition for the input is as follows:
    <element name="acceptTask">
       <complexType>
         <sequence>
                <element maxOccurs="unbounded" minOccurs="0" name="taskID" type="decimal"/>
         </sequence>
       </complexType>
    </element>For the input to my binding, I have tried int[], Integer[] and List<Integer>. All of these result in similar errors.
    I have also tried invoking this through a regular ADF application and that works fine with an int[]. It looks like something specific to the ADF Mobile SOAP layer.
    Is this a bug or a restriction in the framework? Any workarounds that has worked for anyone?

    No luck. A WS DC method call with a simple parameter (java.lang.String or java.lang.Integer) works fine but I can't get it to work when there is an array input.
    I have tried WS methods with int arrays and simple string arrays without any luck. All of them result in a cannot serialize error.
    I can't figure out what I am doing wrong. Are there any working WS Datacontrol samples with array inputs?

  • Show return value of a method-call within a column of ADF table component

    Hi,
    I'm currently developing a ADF "Master Form - Detail Table" component, which displays trips of a car in master form, and all related trip-point information in detail table. This detail table contains the following fields within a row :
    - idTripPoint
    - receivedAt
    - speed
    - coordinates
    Everything is displayed well when deploying my app. What I now want to implement is one more column into my detail table, which displays the result of a method-call which gets the coordinates of the corresponding tripPoint and executes a query to find the nearest neighbour to this point. This method afterwards returns a string which contains a textual description for the coordinates (e.g. 10 km south of Hilton Plaza). This method is defined within my SessionBean and also available within the Data Control Palette.
    What I first did, was just to drag the result (String) of my getTripPointDescription(JGeometry) method to a newly created column within my details table, released it there and set the corresponding NDValue for my method. I used the id of my details table table definition in PageDef for that (${bindings.TripstripPointsList.currentRow.dataProvider.coordinates}). I don't know if this is correct.
    When deploying my app, nothing happened, because my method has never been called. So I decided to implement an invokeAction within my PageDef which calls the generated methodAction within PageDef.
    It looks like that now:
    <executables>
    <invokeAction id="callDescription" Binds="getTripPointDescription"
    Refresh="prepareModel"/>
    </executables>
    <bindings>
    <methodAction id="getTripPointDescription"
    InstanceName="TripsEJBFacadeLocal.dataProvider"
    DataControl="TripsEJBFacadeLocal"
    MethodName="getTripPointDescription"
    RequiresUpdateModel="true" Action="999"
    IsViewObjectMethod="false"
    ReturnName="TripsEJBFacadeLocal.methodResults.TripsEJBFacadeLocal_dataProvider_getTripPointDescription_result">
    <NamedData NDName="tripPoint"
    NDValue="${bindings.TripstripPointsList.currentRow.dataProvider.coordinates}"
    NDType="oracle.spatial.geometry.JGeometry"/>
    </methodAction>
    </bindings>
    Now my method is called once for the coordinates of the first row of my detail table and the generated result is entered within each row.
    So how is it possible to get this standard-behaviour (within other application-frameworks) work in ADF? I just want to display a textual description of a coordinate instead of x/y coordinates within my table. And the corresponding method to get this textual description based on the x/y coordinate should be called for each row displayed in my table.
    I currently walked through all ADF-tutorials and blogs I found on the Internet, but every table example I found only displays data of the associated Entity-Bean. And method Action and accessorIterator are only used with command objects.
    Thank you,
    Thomas

    Sorry, I forgot to say which technologies I use:
    - Toplink Essentials JPA for Model layer (EJB 3.0)
    - ADF in View Layer
    I still hope someone can help me finding an answer.
    Bets Regards,
    Thomas

  • How to read the method and put that code in 1 internal table

    Hi,
    Actually in the normal ABAP, if we want to read the report,  then we will write read report statement.
    If we want to read method then this statement will not work.
    So, to read the method and put that code in 1 internal table , which statement we need to write?
    Regards,
    Radhika

    Hi Naimesh,
    Thanks for your reply.
    As, i am not aware of ABAP Objects i am having some issues:
    Actually that is working for some methods in some classes.
    Here 1 issue is there:
    In se24 1 method is there in 1 class.
    Even by using that FM in SE37 i am able to get the program name by giving class and method name,
    but while using that FM in the program i am not able to get that program name.
    so, i am unable to read the source code of the program?
    1 example here:
    Class name is CL_GUI_FRONTEND_SERVICES.
    in this class, methods like FILE_EXIST , FILE_GET_SIZE, etc are there.
    By giving the class name and method name i am able to get the program name also,
    but while using that FM in the program i am not able to get that program name.
    so, i am unable to read the source code of the program?
    Here is my code:
    REPORT  Z16059_SCAN_METHOD.
    DATA: BEGIN OF I_PROGRAM OCCURS 0,
          LINE(256) TYPE C,
          END OF I_PROGRAM.
    DATA METHOD TYPE PROGRAM.
    DATA: BEGIN OF I_STRUCTURE,
          CLS_NAME(30) TYPE C,
          METH_NAME(61) TYPE C,
          END OF I_STRUCTURE.
    I_STRUCTURE-CLS_NAME = 'CL_GUI_FRONTEND_SERVICES'.
    I_STRUCTURE-METH_NAME = 'CL_GUI_FRONTEND_SERVICES-FILE_EXIST'.
    CALL FUNCTION 'SEO_METHOD_GET_INCLUDE_BY_NAME'
      EXPORTING
      MTDKEY             =  I_STRUCTURE
    IMPORTING
       PROGNAME          = METHOD
    EXCEPTIONS
       INTERNALMETHOD_NOT_EXISTING      = 1
       OTHERS                             = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    READ REPORT METHOD INTO I_PROGRAM.
    Please help me out in this regard.
    Thanks & Regards,
    Radhika

Maybe you are looking for