Use Interface of Class object

Hi Experts,
I want to use Interface of Class object. But I'dont know how I use it (declaration,call,create etc.)
There are a lot of exam about using local interface. But I need from Global object.
Class : CL_TPDA_DIFF_STRUC
Interface: IF_TPDA_DIFF_SERVICE
Best regards.

Firstly ; Your advice book tells the "General OO".
But I need "Only ABAP OO". The basic logic is the same. But syntax are different.
If there is a book about ABAP OO and syntax You can advice to me.
Secondly;
My code is below.
I created my interface success . But It give error at runtime. Error mesaage : 'Error during interprocess communication; Debugger will be closed . Message Number TPDA151'
DATA l_ref_diff TYPE REF TO CL_TPDA_DIFF_STRUC.
data : xyz  TYPE REF TO IF_TPDA_DIFF_SERVICE.
data : p_var1 type TPDA_VAR_NAME,
          p_var2 type TPDA_VAR_NAME,
          lv_x type TPDA_DIFF_ATTR.
data : l_it_value_diff TYPE TPDA_DIFF_VALUE_DIFF_IT,
          l_it_main_diff TYPE tpda_diff_main_diffs_it.
p_var1 = 'CLIENTDATA1'.
p_var2 = 'CLIENTDATA2'.
lv_x-maxhits = 100.
CREATE OBJECT l_ref_diff.
xyz ?= l_ref_diff.
xyz->init( ).
xyz->DIFF( EXPORTING p_var1 = p_var1
                     p_var2 = p_var2
                     p_diff_attr = lv_x
           CHANGING p_it_value_diff_it = l_it_value_diff
                    p_it_main_diff_it  = l_it_main_diff ).
Best Regards.

Similar Messages

  • How to use two activex class objects in same vi

    HI
    I am using labview to read ECU data from INCA software .INCA providing COMTOOL API(incacom.dll). I am using ACTIVEX for  communication between INCA & Labview. My problem is If I have used single activex class object  I am able to read Inca version, getting the database path etc. If I have used two activex class in same vi (one to open Inca & other one is to read the folder structure) I am not getting output.I have attached snapshot for referance
    Attachments:
    activex1.JPG ‏114 KB
    activex2.JPG ‏107 KB

    It wasnt in the first two images you posted, or I couldnt see it anyway! That was the only reason.
    Did you try the database block on its own, just to confirm that it is working?
    Beginner? Try LabVIEW Basics
    Sharing bits of code? Try Snippets or LAVA Code Capture Tool
    Have you tried Quick Drop?, Visit QD Community.

  • Why we use interfaces ?

    hi all!
    i m confused that what is the advantage of using interfaces for classes if it is for security,data hiding pupose then we can use private modifiers,then y is this think built in java and which r the cases in which we must use interfaces and y?
    plz give me any simple example to understand ur point
    thanx in advance.
    sajjad ahmad

    Hmm... First, I'm sorry about my English... but i will try.
    In C++ we can use multi-inheritance that let the developer "extends" one or more classes.
    eg.
    class Hello extends A,B,C,D
    This case can be happened in C++.
    But If both class A and B have a method call "void sayMyName()"
    How can we refer which method was called when we call "Hello.sayMyName()"
    A.sayMyName() or B.sayMyName()
    So java don't allow this thing happen.
    Java allow developers to extend "only one class"
    but to enable multi-inheritance ability Java allow developer to implement more than one class.
    That is "interface" which was implemented.
    Now lets talk about it's benefits.
    Interface is not for security or data hiding purpose.
    But interface is used for "make a template".
    When I created one class called Hello.
    But I have created another class too.
    Now I want to make sure that my classed have a method "void say()"
    What can I do ?
    1. Make some class that have a method "void say()" and let my classes extend it.
    2. Make an interface and implement it.
    Choise number one is quite good ... but !!!
    If I have to extend some another class that is more important such as "Applet"
    Now I can't extend another class.
    I need only method "void say()". But I don't care what it does.
    So I make an interface that force the implementing class to create a method "void say()"
    and I implement it.
    Question: Why I have to implement this interface ? If I only define a method "void say()"
    The problems is gone ....
    Answer: That may be true if I want them to have a method. But how can I refer to them.
    Lets see this code.
    class A extends Applet {
    void say() {System.out.println("My name is A");}
    ... go on ...
    class B extends Applet {
    void say() {System.out.println("My name is B")}
    ... go on ...
    class GO {
    public void letMeSay(............. o) {
    o.say();
    What can I fill in the argument of method "letMeSay()"?
    Object ? Object doesn't have a method "void say()"
    Applet ? With the same reason.
    Now lets see another code.
    interface Sayable {
    abstract void say();
    class A extends Applet implements Sayable {
    void say() {System.out.println("My name is A");}
    ... go on ...
    class B extends Applet implements Sayable {
    void say() {System.out.println("My name is B")}
    ... go on ...
    public void letMeSay(Sayable o) {
    o.say();
    It's ok right ... I can refer to interface "Sayable" that can "say"
    Next benefit of interface ... "define Constants field"
    We can define constants in an interface and implements it to everywhere we want to use those constants. When we change a value in this interface ... Constants in another place will be changed too .... that is very useful ....(But this may have change in J2SE 1.5 ... see more info)
    "I HOPE THIS REPLY MAY GIVE YOU SOME KNOWLEDGE ... GOOD LUCK WITH PROGRAMMING"

  • Significance of Interfaces in ABAP Objects

    Hi Guys, here I have a query -
    Why do we use Interfaces in ABAP Objects?, and what is the significance of Interfaces in ABAP Objects?
    Please clarify the above with a suitable example.

    Moderator message - Welcome to SCN.
    But
    Moderator message - But this isn't a training forum. Please ask a specific question - post locked

  • What is the advantage of using IB to create XIBs/Class Objects over coding?

    Hi all,
    I hoping someone can provide me some pros and cons as to when I should use IB to create XIBs and/or class objects as opposed to directly coding them.
    For example, if I choose Apple's Template for creating a Navigation Based Application (cocoa touch), the project creates two NIB files - MainMenu and RootViewController.
    However looking at one of demo apps SimpleDrillDown, it does not have a RootViewController XIB and instead creates it via code.
    Another example from the same two apps is that the template generates a "Navigation Controller" class object in the Mainmenu.xib. SimpleDrillDown does not bother with this in the XIB, but uses code to generate the controller:
    - (void)applicationDidFinishLaunching:(UIApplication *)application {
    // Create the navigation and view controllers
    RootViewController *rootViewController = [[RootViewController alloc] init];
    UINavigationController *aNavigationController = [[UINavigationController alloc] initWithRootViewController:rootViewController];
    self.navigationController = aNavigationController;
    [aNavigationController release];
    [rootViewController release];
    // Configure and show the window
    [window addSubview:[navigationController view]];
    [window makeKeyAndVisible];
    as opposed to the template which only needs this:
    - (void)applicationDidFinishLaunching:(UIApplication *)application {
    // Configure and show the window
    // Navigation Controller is defined in MainWindow.xib
    [window addSubview:[navigationController view]];
    [window makeKeyAndVisible];
    So what are the advantages of each approach. Why does apple suggest one approach and yet all its demos use another.
    Any thoughts, answers gratefully received.
    TIA, Michael.

    You can do whatever you're comfortable with, but most of the best Cocoa programmers--the ones on the Mac, I mean--recommend putting everything you can into Interface Builder.
    It's a little like the difference between writing a program to do a bunch of financial calculations and using a spreadsheet. Yeah, the program can do everything the spreadsheet can--and more besides--but you'll find it far easier to create, use and modify the spreadsheet.
    Interface Builder takes away a lot of completely meaningless choices ("What order should I create the objects in? How should I name the variables? How should I create their frames? What order should I set the attributes in?"), leaving you with an interface optimized for creating and arranging objects, and allowing your code to focus on what you really do need to think about--your application's logic.
    (By the way--part of the reason Apple's demos don't all use Interface Builder is that the very first SDK releases didn't have it. Back then, you had to create all your views programatically. Believe me, I have no wish to go back to setting autoresize masks manually. Now get off my lawn, whippersnapper.)

  • The use of interface in abap object

    hi,
    what is the use of interface in class? can have a simple example with explanation? i have read from help but not quite understand its purpose.
    thanks

    Hi El,
    Interfaces are pure abstract classes. The interface methods will have only definitions but no implementations.
    The classes which will implement interfaces has to provide the implementation to the methods.
    Interfaces will provide the common definition and the classes which implements these interfaces will provide them different implementation to the methods as per their requirements. This achieves Polymorphism of Object Orientation.
    REPORT zbc404_hf_events_3 .
    INTERFACE lif_employee.
      METHODS:
        add_employee
           IMPORTING im_no   TYPE i
                     im_name TYPE string
                     im_wage TYPE i.
    ENDINTERFACE.
    CLASS lcl_company_employees DEFINITION.
      PUBLIC SECTION.
        INTERFACES lif_employee.
        TYPES:
          BEGIN OF t_employee,
            no  TYPE i,
            name TYPE string,
            wage TYPE i,
         END OF t_employee.
        METHODS:
          constructor,
         add_employee      "Removed
            IMPORTING im_no   TYPE i
                      im_name TYPE string
                      im_wage TYPE i,
          display_employee_list,
          display_no_of_employees.
      PRIVATE SECTION.
        CLASS-DATA: i_employee_list TYPE TABLE OF t_employee,
                    no_of_employees TYPE i.
    ENDCLASS.
    CLASS lcl_company_employees IMPLEMENTATION.
      METHOD constructor.
        no_of_employees = no_of_employees + 1.
      ENDMETHOD.
      METHOD lif_employee~add_employee.
      Adds a new employee to the list of employees
        DATA: l_employee TYPE t_employee.
        l_employee-no = im_no.
        l_employee-name = im_name.
        l_employee-wage = im_wage.
        APPEND l_employee TO i_employee_list.
      ENDMETHOD.
      METHOD display_employee_list.
      Displays all employees and there wage
        DATA: l_employee TYPE t_employee.
        WRITE: / 'List of Employees'.
        LOOP AT i_employee_list INTO l_employee.
          WRITE: / l_employee-no, l_employee-name, l_employee-wage.
        ENDLOOP.
      ENDMETHOD.
      METHOD display_no_of_employees.
      Displays total number of employees
        SKIP 3.
        WRITE: / 'Total number of employees:', no_of_employees.
      ENDMETHOD.
    ENDCLASS.
    Check this link for some more examples on OO ABAP
    http://www.erpgenie.com/sap/abap/OO/eg1.htm
    Thanks,
    Vinay

  • What is the Use of Inner classes in Interface.

    Hi All,
    Most of us we know that We can define inner classes in the interface. Like
    public interface MyItf{
         Demo d = new Demo();     
         class Demo{
              Demo(){
              //some additional code here
    }Now I have following question in my mind:
    1. An Interface is pure abstract. Then why inner classes inside the interface?
    2. In what scenario, we can utilize these inner classes of interface?
    Plz Share your views on this...
    Thks for ur replies in advance.

    This we cando in defining Demo Class outside.That's no argument. You could write the programs in other languages, so why use Java? Just because you can use a top-level class instead, it's no argument against using an inner class. You also can make all attributes public... you don't o that either (I hope).
    Ok Also
    tell me how to pass an Object in inner class Demo. to
    the method of Interface.
    public abstract TheInterface.Demo doSomething(TheInterface.Demo d);
    Can u give some real time situation where this
    concept can be used.There are only very, very few. Just because it's possible, it doesn't mean it needs to be done or is done often.

  • Using Interface Builder to Inspect a New Object?

    I am having a major frustration following a Stanford demo on using Interface Builder. The demo shows how to create a simple slider object with a value. But when the demo pulls up the Inspector Window to examine the new Object, in the Stanford demo the inspector window has panes for CLASS ACTIONS and CLASS OUTLETS, whereas my inspector window, identical in every other respect to the demo window, doesn't have these two panes. Help!!!!!!!!!

    The first lecture gives information about joining the developer program and there are forums similar to this at their website. You can also find forums on private sites on the web that are following the courses and have their own forums for asking questions like this.
    Try one of those paths and you should find more help than on here. This is just end users helping end users not delopers.
    Jason

  • Using the Hyperion (Essbase) Objects 6.5  Base Classes

    Hi all,I am using Hyperion (Essbase) Objects 6.5 to report from an Essbase 6.5.3 database. Using the sample report.asp page as a guide, I want to use the "EssProperties" class to change the Essbase options for missing values and using aliases, however there no effect on the results returned when setting these properties.Has anyone out there had any success?

    You need to set the EssProperties class you created into the EssOperations class:set oEssOperations.EssProperties = <your property class instance>Alternatively, you can modify, in place, the instance of EssProperties that EssOperations already has:with oEssOperations.EssProperties .MissingTextString = "Boo!" .UseAliases = trueend withThink of the Essbase Objects Base Classes sort of as a molecule.. The 'basic atom' of the molecule is the EssOperations class (which contains the normal retrieve/zoom/pivot type of operations). Attached to the 'basic atom' are the things that are needed for a successful operation.. First, a connection (the EssConnection object) is 'plugged into' the molecule. Next, properties (an EssProperties object) is plugged in.. Finally, you need a grid to display it on so you plug in a grid object (or, more technically, one of the components that implement the IEssGrid interface).Once you have all of the 'atoms' of the grid plugged in, you have everything you need to do a successful operation.Tim TowApplied OLAP, Inc

  • How can i add custom attributes to a new Class Object using the API ?

    Hello everyone,
    Here is my problem. I just created a subclass of Document using the API (not XML), by creating a ClassObjectDefinition and a ClassObject. Here is the code :
    // doc is an instance of Document
    ClassObject co = doc.getClassObject();
    ClassObjectDefinition cod = new ClassObjectDefinition(ifsSession);
    cod.setSuperclass(co);
    cod.setSuperclassName(co.getName());
    cod.setName("MYDocument");
    ClassObject c = (ClassObject)ifsSession.createSchemaObject(cod);
    Everything seems to be OK since i can see the new class when i use ifsmgr. But my question is : how can i add custom attributes to this new class ? Here is what i tried :
    AttributeDefinition value = new AttributeDefinition(ifsSession);
    value.setAttribute("FOO", AttributeValue.newAttributeValue("bar"));
    c.addAttribute(value);
    But i got the following error message :
    oracle.ifs.common.IfsException: IFS-30002: Unable to create new LibraryObject
    java.sql.SQLException: ORA-01400: impossible d'insirer NULL dans ("IFSSYS"."ODM_ATTRIBUTE"."DATATYPE")
    oracle.ifs.server.S_LibraryObjectData oracle.ifs.beans.LibrarySession.DMNewSchemaObject(oracle.ifs.server.S_LibraryObjectDefinition)
    oracle.ifs.beans.SchemaObject oracle.ifs.beans.LibrarySession.NewSchemaObject(oracle.ifs.beans.SchemaObjectDefinition)
    oracle.ifs.beans.SchemaObject oracle.ifs.beans.LibrarySession.createSchemaObject(oracle.ifs.beans.SchemaObjectDefinition)
    void fr.sword.ifs.GestionDocument.IFSDocument.createDocument(java.lang.String)
    void fr.sword.ifs.GestionDocument.IFSDocument.main(java.lang.String[])
    So, what am i doing wrong ?
    More generally, are we restricted in the types of the attributes ? (for example, would it be possible to add an attribute that would be an inputStream ? Or an object that i have already created ?).
    Any help would be appreciated. Thanks in advance.
    Guillaume
    PS : i'm using Oracle iFS 1.1.9 on NT4 SP6 and Oracle 8.1.7
    null

    Hi Guillaume,
    you're welcome. Don't know exactly, but assume that ATTRIBUTEDATATYPE_UNKNOWN
    is used to check for erronous cases only
    and it shouldn't be used otherwise.
    Creating your own objects could be simply done via
    ClassObject ifsClassObject;
    DocumentDefinition ifsDocDef = new DocumentDefinition(ifsSession);
    // get class object for my very own document
    ifsClassObject = ClassObject.getClassObjectFromLabel(ifsSession, "MYDOCUMENT");
    // set the class for the document i'd like to create
    ifsDocDef.setClassObject(ifsClassObject);
    // set attributes and content for the document...
    ifsDocDef.setAttribute("MYFOO_ATTRIBUTE",....);
    ifsDocDef.setContent("This is the content of my document");
    // create the document...
    PublicObject doc = ifsSession.createPublicObject(ifsDocDef);
    null

  • Use of events and interface in class

    Dear All,
    Could you please explain why we use events and interface in class.
    Also please tell me the use of TRY and ENDTRY.
    Regards,
    Amar

    Events may be a way of communication b/w classes. Imagine you want to call certain code from one class, you would need for that public method, but you don't want to expose it to external user. So you may use events for that. Also events are used to notify that certain state of class has changed (tiggering event). Then all handlers of this event executes and react accordingly.
    Interfaces are a way of provide a service to class which implements it. Imagine that you have class office and hotel and gas station . They don't seems to have something in common. However, there can be some external energy provider which will be an interface. Each class which want to have a lease with this energy provided can implement it (the implementation can differ in some way), so he can provided energy to different classes. This way you will achieve polimorphism (meaning you call one interface method, but code behind it differs from class to class).
    Interfaces are also means of multiple inheritance. One class can implement several service (interfaces). In contrary it can oly inherit from one class.
    Try endtry are just new way of handling exceptions .
    Try to search a litte bit you will find lots of info on the above.
    Regards
    Marcin

  • When should I use abstract classes and when should I use interfaces?

    Can any body tell me in which scenario we use /we go for Interface and which scenario we go for abstract class, because as per my knowledge what ever thing we can do by using Interface that thing can also done through abstract class i mean to say that the
    behavior of the two class.
    And other thing i also want to know that which concept comes first into the programming abstract class or Interface.
    S.K Nayak

    The main differences between an abstract class and an interface:
    Abstract
    An abstract class can contain actual working code (default functionality), and can have either virtual or abstract method.
    An abstract class must be sub-classed and only the sub-classes can be instantiated. Abstract methods must be implemented in the sub-class. Virtual methods may be overridden in the sub-class (although virtual methods typically contain code, you still may
    need/want to override them). A good use for an abstract class is if you want to implement the majority of the functionality that a class will need, but individual sub-classes may need slightly different additional functioality.
    Interface
    An interface only contains the method signatures (method name and parameters), there is no code and it is not a class.
    An interface must be implemented by a class. An interface is not a class and so it cannot be sub-classed. It can only be implemented by a class. When a class implements an interface, it must have code in it for each method in the interface's definition.
    I have a blog post about interfaces:
    http://geek-goddess-bonnie.blogspot.com/2010/06/program-to-interface.html
    (sorry, I have no blog posts specific to abstract classes)
    ~~Bonnie DeWitt [C# MVP]
    http://geek-goddess-bonnie.blogspot.com

  • Create session bean using interfaces, not implementation classes

    Hi,
    I'm using interfaces and session beans for my persistence/data layer in my adf application.
    I've created a data control for my session bean and during creation of this data control, javabean.xml files are created for the different interfaces that are used in my session bean.
    If I create bindings on these methods, interfaces in jspx-documents I will get errors because he can't find the impl-classes that implement these interfaces.
    When using interfaces in your session bean (as return values or parameters) instead of classes you need to manually create javabean.xml files for the implementation classes.
    It's required by the databindings/datacontrol that the implementation-classes are described in a javabean-format as well? Is this a spec we need to adhere to?
    Could someone verify that you need to create javabean.xml-files for as well the interfaces as the classes when you're working with interfaces in your session beans?
    regards,
    Nathalie

    A patch was released by Oracle to be able to work with Interfaces and so it's not required to work with implementation-classes.
    Patch for 5726754(Base bug 5657179)

  • Using static interface inner class.. how?

    Can anyone tell me how I'm able to use an inner class that is a static interface?
    Specifically I'm getting DocumentEvents through a DocumentListener..
    Then within DocumentEvents there is an inner class which is a static interface called:
    DocumentEvent.ElementChange, I'm trying to use the methods contained within the interface ElementChange.
    Can anyone throw a helping hand as to how I go about this?
    Thanks :)

    public class A ... {
    public static interface B {
    }Just creates a public interface called A.B
    How are you supposed to use this with your DocumentEvent? I can't say

  • To get all the objects that are used inside the class

    Hi All,
    All i wanna know is to get all the objects that are used inside the class.
    Ex :
    Class A{
    Emp e;
    public add(Dept d){
    e.deptid = d.deptId;
    in this class i have two objects, one Emp obj and another Dept object.
    I wanna get the details abt this class Emp and Dept by simply parsing the file and by not loading this class in JVM.
    Could any pls hel me out.??
    thx.

    I wanna get the details abt this class Emp and Dept
    by simply parsing the file and by not loading this
    class in JVM.Your problem statement is vague and the constraint is IMO hypothetical.

Maybe you are looking for

  • How do I edit photos  stored on external wifi drive with iPad?

    I have stored many photos on a Seagate Wifi external drive and would like to edit them using my iPad.  Only photos stored on Camera Roll come up for editing.  Can anyone help solve this problem please.

  • How to apply Filter condition for a specific column but not to the report?

    Hi, I am having a issue in applying a filter condition to one of the column. I have a schema with one fact table and around 10 dimension tables. My requirement is to bring a count on the fact table with related to some other columns from the dimensio

  • Price History In MDM

    Hi All I am currently investigating into the possibility of showing price changes in the MDM Data Manager.  When items prices are updated in the Data Manager, we have a requirement to be able to view the old and new price.  I know that i can search f

  • Incompatible JRE Versions?

    Has anyone seen this problem? We use Windows XP and users have roaming profiles. About half our systems require us to use JRE 1.4.2_10, due to software compatibilty issues, while the rest have been upgraded to version 5. My problem, since the upgrade

  • IPMA service

    Trying to configure IPMA on CCM 4.1(3). Configured IPMA through Configuration Wizard. Added phones, manager, assistant etc and subscribed service on the manager phone. When trying to access the IPMA service from manager phone (7960) an error message