Documentation on ABAP Objects with examples & programs (using se24)

Hi Guru's,
I'm new to abap objects. i need to learn this. where can i get material for this with ex. programs (using se24) also.

Hi,
Check this link-
http://help.sap.com/saphelp_nw70/helpdata/en/ce/b518b6513611d194a50000e8353423/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/content.htm
SE24-
http://help.sap.com/saphelp_nw04/Helpdata/EN/ca/c035baa6c611d1b4790000e8a52bed/frameset.htm

Similar Messages

  • How to use LDB PNP with ABAP objects in a program

    Hello,
    I am wondering if anybody has used the HR logical database(LDB) PNP with user defined ABAP objects in a program? I am using the FM- <b>LDB_PROCESS</b> but its not working. Also assigning PNP in the attributes section of the program -- so that I can use predefined fields from the LDB and then invoking the FM doesn't work -- throwing 'Logical database already active' error.
    I suppose even with the ABAP objects and the new FM -- I should still be able to utilize the pre-defined fields of the PNP database -- and also the built in authorizations. I cannot use GET PERNR and REJECT as they give errors. I understand that the use of HR-macros (RP-PROVIDE-FROM-LAST and et al.) are not allowed as they use the table work area -- which is not allowed in ABAP-OOPS.
    I would really appreciate if anyone could show me some insight regarding this. Thank you.
    Kshitij R. Devre

    Hi Kshitij
    It would be really good if we could use both together. But as I know, it is not possible. "GET pernr." is an event-like loop statement and so cannot be used in OO context. And I guess, the same restriction holds for the "LDB_PROCESS" since it uses LDB-specific processing.
    What I suggest you is to use standard and BAPI functions.
    Sorry for giving bad news...
    *--Serdar

  • ABAP Objects: Introduction to Programming SAP Applications

    Hi, does anybody knows any tutorial that would explain me how to install and make available in my SAP installation the examples and database that comes with this book ABAP Objects: Introduction to Programming SAP Applications
    The point is that i couldn't install the version of SAP BASIS that came with the book ( it was SAPmini BASIS 4.6D) on my Windows XP. Instead, i've installed Mini WAS 6.20 with Front-End 6.40 and i'd like to use it while studying the same book.
    any ideas?
    sorry, may be it could sound obviuos for some of you, but i'm complete SAP virgin

    Not sure if this data generator is available in 6.20 or now.  SAPBC_TOOLS_GENERATOR_NEW  Run this program to generate the data for the FLIGHT tables.
    Then you should check out the example programs which start with BCALV*   and also check out transaction code DWDM.
    Regards,
    Rich Heilman

  • Step By Step creation of Smartform in ECC6.0 with example program.

    Hi,
    Can anyone give me the steps to create smartforms in ECC6.0 with example program call the function module created by form.
    Regards,
    Chandru

    Hi   Chandra Prakash,
    Go through the following Links, here u can find example with step
    by step.
    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
    http://sap.niraj.tripod.com/id67.html
    Check these step-by-step links
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/ccab6730-0501-0010-ee84-de050a6cc287
    https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/8fd773b3-0301-0010-eabe-82149bcc292e
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/3c5d9ae3-0501-0010-0090-bdfb2d458985
    Check these links also.
    http://www.sap-basis-abap.com/sapsf001.htm
    http://www.sap-press.com/downloads/h955_preview.pdf
    http://www.ossincorp.com/Black_Box/Black_Box_2.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://www.sap-img.com/smartforms/smartform-tutorial.htm
    http://www.sapgenie.com/abap/smartforms.htm
    for Smartforms material
    http://www.sap-basis-abap.com/sapsf001.htm
    http://www.sap-press.com/downloads/h955_preview.pdf
    http://www.ossincorp.com/Black_Box/Black_Box_2.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://www.sap-img.com/smartforms/smartform-tutorial.htm
    http://www.sapgenie.com/abap/smartforms.htm
    How to trace smartform
    http://help.sap.com/saphelp_47x200/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
    http://www.help.sap.com/bp_presmartformsv1500/DOCU/OVIEW_EN.PDF
    http://www.sap-img.com/smartforms/smart-006.htm
    http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
    Re: Need FAQ's
    http://www.sap-img.com/smartforms/smart-006.htm
    http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
    Re: Need FAQ's
    Regards,
    Eshwar.

  • Active X object with a program to see my USB camera alive

    I´d like to use an active X object with a program to see my USB camera alive. I don't know if it is possible, does anyone could help me to do it?
    I have a program to use with my camera but I don't know what object I have to insert in the Active X container to play it.
    It could be another program, you suggest.
    I tried another solution before but it didn´t work: http://forums.ni.com/ni/board/message?board.id=170&message.id=397511
    So I thought it could be done in this way.
    Thanks in advance.
    Celia

    Thank for your help, but it didn´t work.
    But I've got a way using Imaq, it is an attchment. The difference from the others is the Imaq USB PropertyPage.vi. Even if I cancel the dialog box it works, but it don't work if I don't use it. As I don´t want the dialog box opens I am figuring out how to eliminate the Imaq USB PropertyPage.vi, what kind of configuration i have to do...
    Thanks again,
    Celia
    Attachments:
    TesteInternet.vi ‏41 KB

  • I want the Definitaion fo  Class and its Components  in ABAP . With Example

    Gowri

    <b>Classes</b>
    Classes are templates for objects. Conversely, you can say that the type of
    an object is the same as its class. A class is an abstract description of an object. You could say that it is a set of instructions for building an object. The attributes
    of objects are defined by the components of the class, which describe the
    state and behavior of objects.
    <b>
    Local and Global Classes</b>
    Classes in ABAP Objects can be declared either globally or locally. You define global classes and interfaces in the Class Builder (Transaction SE24) in the
    ABAP Workbench. They are stored centrally in class pools in the class library
    in the R/3 Repository. All of the ABAP programs in an R/3 System can access the global classes. Local classes are defined within an ABAP program. Local classes and interfaces can only be used in the program in which they are defined. When you use a class in an ABAP program, the system first searches for a local class with the specified name. If it does not find one, it then looks for a global class. Apart from the visibility question, there is no difference between using a global class and using a local class.
    There is, however, a significant difference in the way that local and global classes are designed. If you are defining a local class that is only used in a single program, it is usually sufficient to define the outwardly visible components so that it fits into that program. Global classes, on the other hand, must be able to be used anywhere. This means that certain restrictions apply when you define the interface of a global class, since the system must be able to guarantee that any program using an object of a global class can recognize the data type of each interface parameter.
    The following sections describe how to define local classes and interfaces in an ABAP program. For information about how to define local classes and interfaces, refer to the  Class Builder section of the ABAP Workbench Tools documentation.
    <b>Defining Local Classes</b>
    Local classes consist of ABAP source code, enclosed in the ABAP statements CLASS ... ENDCLASS. A complete class definition consists of a declaration part and, if required, an implementation part. The declaration part of a class <class> is a statement block:
    CLASS <class> DEFINITION.
    ENDCLASS.
    It contains the declaration for all components (attributes, methods, events) of the class. When you define local classes, the declaration part belongs to the global program data. You should therefore place it at the beginning of the program.
    If you declare methods in the declaration part of a class, you must also write an implementation part for it. This consists of a further statement block:
    CLASS <class> IMPLEMENTATION.
    ENDCLASS.
    The implementation part of a class contains the implementation of all methods of the class. The implementation part of a local class is a processing block. Subsequent coding that is not itself part of a processing block is therefore not accessible.
    <b>Structure of a Class</b>
    <u>The following statements define the structure of a class:</u>
    A class contains components
    Each component is assigned to a visibility section
    Classes implement methods
    The following sections describe the structure of classes in more detail.
    <b>Class Components</b>
    The components of a class make up its contents. All components are declared in the declaration part of the class. The components define the attributes of the objects in a class. When you define the class, each component is assigned to one of the three visibility sections, which define the external interface of the class. All of the components of a class are visible within the class. All components are in the same namespace. This means that all components of the class must have names that are unique within the class.
    There are two kinds of components in a class - those that exist separately for each object in the class, and those that exist only once for the whole class, regardless of the number of instances. Instance-specific components are known as instance components. Components that are not instance-specific are called static components.
    In ABAP Objects, classes can define the following components. Since all components that you can declare in classes can also be declared in interfaces, the following descriptions apply equally to interfaces.
    <b>Attributes</b>
    Attributes are internal data fields within a class that can have any ABAP data type. The state of an object is determined by the contents of its attributes. One kind of attribute is the reference variable. Reference variables allow you to create and address objects. Reference variables can be defined in classes, allowing you to access objects from within a class.
    <b>Instance Attributes</b>
    The contents of instance attributes define the instance-specific state of an object. You declare them using the DATA statement.
    <b>Static Attributes</b>
    The contents of static attributes define the state of the class that is valid for all instances of the class. Static attributes exist once for each class. You declare them using the CLASS-DATA statement. They are accessible for the entire runtime of the class.
    All of the objects in a class can access its static attributes. If you change a static attribute in an object, the change is visible in all other objects in the class.
    <b>Methods</b>
    Methods are internal procedures in a class that define the behavior of an object. They can access all of the attributes of a class. This allows them to change the data content of an object. They also have a parameter interface, with which users can supply them with values when calling them, and receive values back from them The private attributes of a class can only be changed by methods in the same class.
    The definition and parameter interface of a method is similar to that of function modules. You define a method <met> in the definition part of a class and implement it in the implementation part using the following processing block:
    METHOD <meth>.
    ENDMETHOD.
    You can declare local data types and objects in methods in the same way as in other ABAP procedures (subroutines and function modules). You call methods using the CALL METHOD statement.
    <b>Instance Methods</b>
    You declare instance methods using the METHODS statement. They can access all of the attributes of a class, and can trigger all of the events of the class.
    <b>Static Methods</b>
    You declare static methods using the CLASS-METHODS statement. They can only access static attributes and trigger static events.
    <b>Special Methods</b>
    As well as normal methods, which you call using CALL METHOD, there are two special methods called CONSTRUCTOR and CLASS_CONSTRUCTOR, which are automatically called when you create an object (CONSTRUCTOR) or when you first access the components of a class (CLASS_CONSTRUCTOR).
    <b>Events</b>
    Objects or classes can use events to trigger event handler methods in other objects or classes. In a normal method call, one method can be called by any number of users. When an event is triggered, any number of event handler methods can be called. The link between the trigger and the handler is not established until runtime. In a normal method call, the calling program determines the methods that it wants to call. These methods must exist. With events, the handler determines the events to which it wants to react. There does not have to be a handler method registered for every event.
    The events of a class can be triggered in the methods of the same class using the RAISE EVENT statement. You can declare a method of the same or a different class as an event handler method for the event <evt> of class <class> using the addition FOR EVENT <evt> OF <class>.
    Events have a similar parameter interface to methods, but only have output parameters. These parameters are passed by the trigger (RAISE EVENT statement) to the event handler method, which receives them as input parameters.
    The link between trigger and handler is established dynamically in a program using the SET HANDLER statement. The trigger and handlers can be objects or classes, depending on whether you have instance or static events and event handler methods. When an event is triggered, the corresponding event handler methods are executed in all registered handling classes.
    <b>Instance Events</b>
    You declare instance events using the EVENTS statement. An instance event can only be triggered in an instance method.
    <b>Static Events</b>
    You declare static events using the CLASS-EVENTS statement. All methods (instance and static methods) can trigger static events. Static events are the only type of event that can be triggered in a static method.
    <u>See also Triggering and Handling Events.</u>
    <b>Types</b>
    You can define your own ABAP data types within a class using the TYPES statement. Types are not instance-specific, and exist once only for all of the objects in a class.
    <b>Constants</b>
    Constants are special static attributes. You set their values when you declare them, and they can then no longer be changed. You declare them using the CONSTANTS statement. Constants are not instance-specific, and exist once only for all of the objects in a class.
    <b>Visibility Sections</b>
    You can divide the declaration part of a class into up to three visibility areas:
    CLASS <class> DEFINITION.
      PUBLIC SECTION.
      PROTECTED SECTION.
      PRIVATE SECTION.
    ENDCLASS.
    These areas define the external visibility of the class components, that is, the interface between the class and its users. Each component of a class must be assigned to one of the visibility sections.
    <b>Public Section</b>
    All of the components declared in the public section are accessible to all users of the class, and to the methods of the class and any classes that inherit from it. The public components of the class form the interface between the class and its users.
    <b>
    Protected Section</b>
    All of the components declared in the protected section are accessible to all methods of the class and of classes that inherit from it. Protected components form a special interface between a class and its subclasses. Since inheritance is not active in Release 4.5B, the protected section currently has the same effect as the private section.
    <b>Private Section</b>
    Components that you declare in the private section are only visible in the methods of the same class. The private components are not part of the external interface of the class.
    <b>Encapsulation</b>
    The three visibility areas are the basis for one of the important features of object orientation - encapsulation. When you define a class, you should take great care in designing the public components, and try to declare as few public components as possible. The public components of global classes may not be changed once you have released the class.
    For example, public attributes are visible externally, and form a part of the interface between an object and its users. If you want to encapsulate the state of an object fully, you cannot declare any public attributes. As well as defining the visibility of an attribute, you can also protect it from changes using the READ-ONLY addition.
    "Example  :
    CLASS C_COUNTER DEFINITION.
      PUBLIC SECTION.
        METHODS: SET_COUNTER IMPORTING VALUE(SET_VALUE) TYPE I,
                 INCREMENT_COUNTER,
                 GET_COUNTER EXPORTING VALUE(GET_VALUE) TYPE I.
      PRIVATE SECTION.
        DATA COUNT TYPE I.
    ENDCLASS.
    CLASS C_COUNTER IMPLEMENTATION.
      METHOD SET_COUNTER.
        COUNT = SET_VALUE.
      ENDMETHOD.
      METHOD INCREMENT_COUNTER.
        ADD 1 TO COUNT.
      ENDMETHOD.
      METHOD GET_COUNTER.
        GET_VALUE = COUNT.
      ENDMETHOD.
    ENDCLASS.
    The class C_COUNTER contains three public methods - SET_COUNTER, INCREMENT_COUNTER, and GET_COUNTER. Each of these works with the private integer field COUNT. Two of the methods have input and output parameters. These form the data interface of the class. The field COUNT is not outwardly visible.
    Reward   points  if it is usefull...
    Girish

  • ABAP Objects with Workflows / Classes and Instances

    Hello,
    I am currently designing a workflow using an ABAP-Objects. So far I have been been able to get my Workflow to run with my class, but I have a couple of problems:
    - I am using the Function 'SAP_WAPI_START_WORKFLOW' to start other subflows, which enables me to decide which subflow to start at runtime. All of the subflows have standart importing-parameters in their containers, such as the key of my class. In each workflow I instantiate my class using a self-written method, which checks the table T_INSTANCES in my object, and then either returns the object reference to an existing instance or creates a new one. Obviously all of the subflows that I call from my main workflow should be able to find the instance. As far as I can see in their protocolls, this happens without any problems. The problem starts when I make changes to the instance. For example the changing of attributes (with setter methods) seems not to work. After the subflows are finished, in my main workflow, I do not see (with getter methods) any changes that has been made to the object. Is local persistence really limited to one workflow ?
    - My second problem is basically about the workflow container in workflow protocoll. In the same workflow, I can change the attributes of my object. Nevertheless, the protocoll always show the initial attribute, even though, my task with the getter-method returns the new value of the attribute.
    I appreciate any help and thanks a lot in advance.

    Hello Pauls,
    Thank you for your answer. I think we are misunderstanding each other. The problem occurs (I think) because my class is not a singleton class. Or am I mistaken ?
    When I directly start a subflow from my main workflow, then the instance that I have created in my main workflow is also visible to the subflow. As well as the static table which actually keeps track of the instances. So, in this case the subflows finds the instance and then can use the object as is.
    When I start a subflow from my main workflow using the function I mentioned above, then even though the same object key is used, there is a new instance. And the static table (I assume that you mean a static variable from type table, when you say "class table") is completely empty. In this case, my "new" instance is created which overwrites every attribute that I have set in the main workflow, before I started the subflow. More interestingly, my main workflow instantiates another new object, as soon as the subflow has finished. (I am using an event to wait for the subflow to finish.)
    On the other hand, I am not quite sure that I understood your approach with refresh and how it could help me. This method is not well documented anywhere, and all of the examples that I have found are about "leave it empty"
    As far as I understood, this method is called by the workflow between the steps, when an object is used. I slowly start to think that I need advanced information about Workflows and Memory Management.
    Thanks a lot again. Apparently, I am the only person who came across such a problem
    Greetz
    G.Fendoglu

  • Abap Objects With or Without persistence

    Hi forum!
    I'm looking for examples of abap OO programs with BD interaction using persistence or not, when do you suggest to use persistence in abap programing?, and, when i do easy reports?, i'm working in R3 enterprise 4.7 basis 6.20.
    Thanks in advance,
    John.

    I think it depend on your requirement.
    I have some experience on persistence class.
    It will generate a class combine with a table, and you can populate the table with this class, include select, insert, modify.
    It offer you a way to populate table in a OO way.
    But unfortunatly, single persistence class can only combine one table. And after you save the combine relation of the class and table, it is difficult to do further change.
    So if your application need to populate multiple table in same time, and do some join select, persistence class won't help too much.
    I think BO (business object) will be helpful to you.
    If you don't want to access the relate table directly.
    But BO is not a OO way.
    thanks

  • ABAP Objects - real example

    Hello everybody,
    can someone please navigate me to some "real example" of using abap objects?
    I went through demos in sap (I am using SAP R/3 4.6C) in <i>transaction ABAPDOCU, I have a book Horst Keller: Abap Objects (where partially the object orientation is written), I am reading articles in SAP professional journal or on web www.erpsapgenie.com, etc.
    This is all nice, but no real example can I find.
    What I mean with real example:
    For example report, where I select data from database ("select *.." or "get ..." etc.), put this data to internal table, maintenance these data, output these data.
    Or: in dialog programming write simple dialog, get data from PBO/PAI, put to into it, write data to database table, etc.
    I have tryed the first case: simple, but meaningfull report, and I start to struggle with problems - if I will have internal table it should be variable of given class, and the table will be in interfase? Or it should be in some "global class main" - but - it is recomended to have as possible protected/private data - so if I will have global data it is worse programming behaviour the to use old procedural approach...
    So generally, WHERE are some examples, where all standard behaviour of procedural programming is shown? - like
    <i>- put data to internal table/get if from it,
    - communication with dialog modules/calling selection screen,
    <i>- open text file in present. server, </i>
    <i>- preparing data for batch input processing, </i>
    <i>- exist abap objects equivalent of logical databases or (we, application programmers) have to write it by ourselves? </i>
    <i>- where are some real programs in R/3 4.6C, which are written fully object oriented? (but please not in HR module )</i>
    <i>- etc.</i></i></i>
    Are these things available to use in version R/3 4.6C?
    Thanks a lot,
    Alexander Talac.

    Hi,
    OOPS ALV links are as below...Check them,if they are useful,kindly reward points by clicking the star on the left of reply.
    OOPS ALV
    OOPS - Events.
    Editable ALV
    Tree
    TabStrip
    Multigrid
    Check this for basic concepts of OOPS
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/abap%20objects/abap%20code%20sample%20to%20learn%20basic%20concept%20of%20object-oriented%20programming.doc
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20to%20display%20data%20in%20alv%20grid%20using%20object%20oriented%20programming.doc
    Tabstrip
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20for%20tab%20strip%20in%20alv.pdf
    Editable ALV
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20to%20edit%20alv%20grid.doc
    Tree
    http://www.sapdevelopment.co.uk/reporting/alv/alvtree/alvtree_usrint.htm
    General Tutorial for OOPS
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/an%20easy%20reference%20for%20alv%20grid%20control.pdf

  • Problem in calling abap editor with the program name in Web Dynpro ABAP

    Hi,
    I have to caal ABAP Editor screen with the display of program after clicking a button from web dynpro abap application.
    I am able to call the ABAP Editor initial screen, but i want the editor display screen with a program.
    How to do that?
    Please find my code below:
      DATA : FINAL_URL TYPE STRING,
             URL TYPE STRING.
      DATA: LV_HOST TYPE STRING,
            LV_PORT TYPE STRING.
    DATA V_TCODE TYPE TCODE.
      DATA:  LO_WINDOW_MANAGER TYPE REF TO IF_WD_WINDOW_MANAGER.
      DATA:  LO_API_COMPONENT  TYPE REF TO IF_WD_COMPONENT.
      DATA:  LO_WINDOW         TYPE REF TO IF_WD_WINDOW.
      DATA:  LD_URL TYPE STRING.
    V_TCODE = 'SE38'.
    *Call below method to get host and port
      CL_HTTP_SERVER=>IF_HTTP_SERVER~GET_LOCATION(
         IMPORTING
           HOST = LV_HOST
           PORT = LV_PORT ).
      CONCATENATE 'http'
      '://' LV_HOST ':' LV_PORT '/sap/bc/gui/sap/its/webgui/?sap-client=&transaction=' V_TCODE '&OKCODE=SHOW'
      INTO URL.
      LO_API_COMPONENT  = WD_COMP_CONTROLLER->WD_GET_API( ).
      LO_WINDOW_MANAGER = LO_API_COMPONENT->GET_WINDOW_MANAGER( ).
      LD_URL = URL.
      CALL METHOD LO_WINDOW_MANAGER->CREATE_EXTERNAL_WINDOW
        EXPORTING
          URL    = LD_URL
        RECEIVING
          WINDOW = LO_WINDOW.
      LO_WINDOW->OPEN( ).
    Now, how to pass my Zprogram name into the URL.
    I need to get the editor screen with the display of the program.
    Thanks,
    Radhika

    Hi Kiran,
    Please find my code below:
    DATA :   URL TYPE STRING.
      DATA: LV_HOST TYPE STRING,
            LV_PORT TYPE STRING.
      DATA:  LO_WINDOW_MANAGER TYPE REF TO IF_WD_WINDOW_MANAGER.
      DATA:  LO_API_COMPONENT  TYPE REF TO IF_WD_COMPONENT.
      DATA:  LO_WINDOW         TYPE REF TO IF_WD_WINDOW.
      DATA:  LD_URL TYPE STRING.
    *Call below method to get host and port
      CL_HTTP_SERVER=>IF_HTTP_SERVER~GET_LOCATION(
         IMPORTING
           HOST = LV_HOST
           PORT = LV_PORT ).
      CONCATENATE 'http'
    '://' LV_HOST ':' LV_PORT '/sap/bc/gui/sap/its/webgui/?&transaction=se38&RS38M-PROGRAMM=Y2PSOLTREE&~okcode=shop'
      INTO URL.
      LO_API_COMPONENT  = WD_COMP_CONTROLLER->WD_GET_API( ).
      LO_WINDOW_MANAGER = LO_API_COMPONENT->GET_WINDOW_MANAGER( ).
      LD_URL = URL.
      CALL METHOD LO_WINDOW_MANAGER->CREATE_EXTERNAL_WINDOW
        EXPORTING
          URL    = LD_URL
        RECEIVING
          WINDOW = LO_WINDOW.
      LO_WINDOW->OPEN( ).
    Here,, Y2PSOLTREE is the program, that should show in SE38 screen.
    I used the above code, but still it is showing the SE38 initial screen.
    Thanks,
    Radhika

  • Error in compiling boost example program using sun studio 12

    I am trying to compile the below example program from boost using sun studio 12 C++ compiler.
    #include <boost/interprocess/shared_memory_object.hpp>
    #include <boost/interprocess/mapped_region.hpp>
    #include <cstring>
    #include <cstdlib>
    #include <string>
    int main(int argc, char *argv[])
    using namespace boost::interprocess;
    if(argc == 1)
    {  //Parent process
    //Remove shared memory on construction and destruction
    struct shm_remove
    shm_remove() { shared_memory_object::remove("MySharedMemory"); }
    ~shm_remove(){ shared_memory_object::remove("MySharedMemory"); }
    } remover;
    //Create a shared memory object.
    shared_memory_object shm (create_only, "MySharedMemory", read_write);
    //Set size
    shm.truncate(1000);
    //Map the whole shared memory in this process
    mapped_region region(shm, read_write);
    //Write all the memory to 1
    std::memset(region.get_address(), 1, region.get_size());
    //Launch child process
    std::string s(argv[0]); s += " child ";
    if(0 != std::system(s.c_str()))
    return 1;
    else
    //Open already created shared memory object.
    shared_memory_object shm (open_only, "MySharedMemory", read_only);
    //Map the whole shared memory in this process
    mapped_region region(shm, read_only);
    //Check that memory was initialized to 1
    char mem = static_cast<char>(region.get_address());
    for(std::size_t i = 0; i < region.get_size(); ++i)
    if(*mem++ != 1)
    return 1; //Error checking memory
    return 0;
    Using the below command :
    CC -c 1.cpp -I/home/syogacha/satish/boost_1_43_0 -library=stlport4
    "/home/syogacha/satish/boost_1_43_0/boost/interprocess/shared_memory_object.hpp", line 284: Error: The function "shm_open" must have a prototype.
    "/home/syogacha/satish/boost_1_43_0/boost/interprocess/shared_memory_object.hpp", line 307: Error: The function "shm_unlink" must have a prototype.
    "/home/syogacha/satish/boost_1_43_0/boost/interprocess/mapped_region.hpp", line 549: Error: Formal argument 1 of type char* in call to shmdt(char*) is being passed void*.
    3 Error(s) detected.
    I even tried to include sys/mman.h but got the same compilation errors.
    Do we need to take care of few other specific things while using boost headers.
    Thanks in advance ...

    Hope this helps....
    #include <sys/mman.h>
    #include <boost/interprocess/shared_memory_object.hpp>
    #include <boost/interprocess/mapped_region.hpp>
    #include <cstring>
    #include <cstdlib>
    #include <string>
    #include <iostream>
    #include <iterator>
    int main(int argc, char *argv[])
    {      //main
            using namespace boost::interprocess;
            if(argc == 1)
            {  //Parent process
                    //Remove shared memory on construction and destruction
                    struct shm_remove
                            shm_remove() { shared_memory_object::remove("MySharedMemory"); }
                            ~shm_remove(){ shared_memory_object::remove("MySharedMemory"); }
                    } remover;
                    //Create a shared memory object.
                    shared_memory_object shm (create_only, "MySharedMemory", read_write);
                    //Set size
                    shm.truncate(1000);
                    //Map the whole shared memory in this process
                    mapped_region region(shm, read_write);
                    //Write all the memory to 1
                   std::memset(region.get_address(), 1, region.get_size());
                    //Launch child process
                    std::string s(argv[0]); s += " child ";
                    if(0 != std::system(s.c_str()))
                    return 1;
            else
                    //Open already created shared memory object.
                    shared_memory_object shm (open_only, "MySharedMemory", read_only);
                    //Map the whole shared memory in this process
                    mapped_region region(shm, read_only);
                    //Check that memory was initialized to 1
                    char *mem = static_cast<char*>(region.get_address());
                    for(std::size_t i = 0; i < region.get_size(); ++i)
                    if(*mem++ != 1)
                    return 1;   //Error checking memory
            return 0;
    }

  • Link with examples of using dbms_stats package

    Please,
    Should Someone let me know when I could find a link or some example on using the new DBMS_STATS package to gather data statisitcs?
    Thanks

    All, made in Oracle:
    http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14231/general.htm#sthref1861
    http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14211/stats.htm#PFGRF30102
    http://download-west.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_stats.htm#sthref7887
    http://download-west.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_stats.htm#sthref7903
    http://download-west.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_stats.htm#ARPLS059

  • How to Implement Abap Object and Access Key for se24 developers.

    Hi every One,
    This is Abdul Rahman, Started Learning Abap Objects i want a simple program to be executed i.e. in Local class (Abap program)and as well in global class(class builder).
    Also i would like to know  When ,Were and Why Abap Object should be used.
    prob to Me :- When i wanted execute F8 a Class in se24 Class Builder it is asking me AcessKey , plz if this is required plz any one send Me.
    I have this key 36687663221261278694 it is already used in Abap editor , it is not accepting in se24 .
    plz help Me , waiting for response ..
    thankyou so much
    Abdul Rahman.

    Hello Abdul
    Here are my answers to your questions:
    (1) <b>Local classes</b>: <i>Do not use them.</i>
    - As long as your class is rather small (few attributes and methods), local classes  are ok yet as soon as they become larger you will loose the overview
    (2) <b>Global classes</b>: <i>Do use them.</i>
    - Make use of global classes even if they are only used for your training. The big advantage over local classes is that you will get used to the classe builder (SE24) which has a plethora of functions.
    (3) <b>Executing global classes</b>: <i>Can be done if you have defined an OO-transaction.</i>
    - An OO-transaction has a class and one of its public methods as parameters (similar like report transactions). When you all the OO-transaction an instance of you class is created and the public method is called.
    (4) <b>Where and Why use ABAP Objects?</b> <i>Everywhere. Anytime.</i>
    - ABAP objects is about stability, maintainability and re-usability of coding. These developer aims can be much more fulfilled using ABAP OO means than in classical programming.
    Regards
       Uwe
    PS: There are situations where local classes are quite appropriate and, using ABAP Unit testing, are obligatory.

  • New to ABAP Objects. Need help using events

    Hi all,
    I got a program from one of the text books which has the output as
             pursur helps pilot
             stewardess helps passenger on seat 11
             stewardess helps passenger on seat 17
    I am trying to modify this program to get an output:
    purser helps pilot
    stewardess helps passenger on seat 11 to have 2 foodservice.
    stewardess helps passenger on seat 11 to have 2 drinkservice.
    stewardess helps passenger on seat 17
    stewardess helps passenger on seat 17 to have 1 foodservice.
    stewardess helps passenger on seat 17 to have 1 drinkservice.
    stewardess helps passenger on seat 21
    stewardess helps passenger on seat 21 to have 3 foodservice.
    stewardess helps passenger on seat 21 to have 3 drinkservice.
    stewardess helps passenger on seat 25
    stewardess helps passenger on seat 25 to have 1 foodservice.
    stewardess helps passenger on seat 25 to have 1 drinkservice.
    stewardess helps passenger on seat 31
    stewardess helps passenger on seat 31 to have 2 foodservice.
    stewardess helps passenger on seat 31 to have 2 drinkservice.
    I have modified the program and am getting some errors. The program is:
    REPORT  Z_KMADHUR_PROGRAM5.
    class declarations.
    class pilot definition.
    public section.
    methods: call_flight_attendant.
    EVENTS: call_button_presses.
    endclass.
    class passenger definition.
    public section.
    methods: constructor importing value(i_seatnumber) type i,
             service_number importing value(i_servicenumber) type i,
             service_type importing value(i_servicetype) type i,
             call_for_help.
    EVENTS: call_button_pressed exporting value(e_seatnumber) type i,
            call_service_number exporting value(e_servicenumber) type i,
            call_service_type exporting value(e_servicetype) type i.
    PROTECTED SECTION.
    data seatnumber type i.
    data servicenumber type i.
    data servicetype type i.
    endclass.
    class flight_attendant DEFINITION.
    PUBLIC SECTION.
    METHODS: constructor
             importing i_id type string,
             help_the_pilot for EVENT
             call_button_presses OF pilot,
             help_a_passenger FOR EVENT
             call_button_pressed OF passenger
             IMPORTING e_seatnumber, e_wervicenumber, e_servicetype.
             PROTECTED SECTION.
    DATA id TYPE string.
    ENDCLASS.
    class Implementations
    class pilot implementation.
    method call_flight_attendant.
    RAISE EVENT call_button_presses.
    ENDMETHOD.
    ENDCLASS.
             class passenger implementation.
             method: constructor.
             seatnumber = i_seatnumber.
             servicenumber = servicenumber.
             servicetype = servicetype.
             endmethod.
             method: call_for_help.
                      RAISE EVENT: call_button_pressed
                      EXPORTING e_seatnumber = seatnumber,
                      RAISE EVENT call_service_number
                      exporting e_servicenumber = servicenumber,
                      RAISE EVENT call_service_type
                      exporting e_servicetype = servicetype.
                      endmethod.
                      endclass.
    class flight_attendant implementation.
    method constructor.
    id = i_id.
    endmethod.
    method help_the_pilot.
    write: / id, 'helps pilot'.
    endmethod.
    method: help_a_passenger.
    write: / id, 'helps passenger on seat',
    e_seatnumber.
    write:  'to have', e_servicenumber.
    write: e_servicetype.
    endmethod.
    endclass.
    global data
    DATA: o_pilot type ref to pilot,
          o_passenger_1 type ref to passenger,
          o_passenger_2 type ref to passenger,
          o_passenger_3 type ref to passenger,
          o_passenger_4 type ref to passenger,
          o_passenger_5 type ref to passenger.
    DATA: o_purser type ref to flight_attendant,
          o_stewardess type REF to flight_attendant,
          0_foodservice type REF to flight_attendant.
          0_drinkservice type REF to flight_attendant.
    classical processing blocks
          start-of-selection.
          create object: o_pilot,
          o_passenger_1 exporting i_seatnumber = 11,
          o_passenger_2 exporting i_seatnumber = 17,
          o_passenger_2 exporting i_seatnumber = 21,
          o_passenger_2 exporting i_seatnumber = 25,
          o_passenger_2 exporting i_seatnumber = 31.
    create object: o_purser
                   exporting i_id = 'purser',
                   o_stewardess
                   exporting i_id = 'stewardess',
                   o_foodservice
                   exporting i_id = 'foodservice',
                   o_drinkservice
                   exporting i_id = 'drinkservice'.
    set handler: o_purser->help_the_pilot for o_pilot,
                 o_stewardess->help_a_passenger for all instances.
    call method: o_pilot->call_flight_attendant,
    o_passenger_1->call_for_help,
    o_passenger_2->call_for_help.
    I am getting an error "object type passenger doesnot have an event RAISE".
    Any help is appreciated.
    Thanks in advance
    Thanks..

    Hi Madhuri,
    the error that you are getting 'statement is not accessible' is just because u didnt end the data statements with '.'...it is ','...check that
    one more thing when you are creating the object passenger you have to export the 'service number' and the 'service type' also along with 'seatnumber' as you have declared that way in the constructor.
    i made the changes...please check the code..there are no errors but please pass suitable values according to your requirement. right now all the events are getting triggered.
    check this changed code..code in bold
    *& Report  ZTEST_EVENTS
    REPORT  ZTEST_EVENTS.
    class declarations.
    CLASS PILOT DEFINITION.
      PUBLIC SECTION.
        METHODS: CALL_FLIGHT_ATTENDANT.
        EVENTS: CALL_BUTTON_PRESSES.
    ENDCLASS.                    "pilot DEFINITION
          CLASS passenger DEFINITION
    CLASS PASSENGER DEFINITION.
      PUBLIC SECTION.
        METHODS: CONSTRUCTOR IMPORTING VALUE(I_SEATNUMBER) TYPE I
                                      VALUE(I_SERVICENUMBER) TYPE I
                                         VALUE(I_SERVICETYPE) TYPE I,
        CALL_FOR_HELP.
        EVENTS: CALL_BUTTON_PRESSED EXPORTING VALUE(E_SEATNUMBER) TYPE I,
        CALL_SERVICE_NUMBER EXPORTING VALUE(E_SERVICENUMBER) TYPE I,
        CALL_SERVICE_TYPE EXPORTING VALUE(E_SERVICETYPE) TYPE I.
      PROTECTED SECTION.
        DATA SEATNUMBER TYPE I.
        DATA SERVICENUMBER TYPE I.
        DATA SERVICETYPE TYPE I.
    ENDCLASS.                    "passenger DEFINITION
          CLASS flight_attendant DEFINITION
    CLASS FLIGHT_ATTENDANT DEFINITION.
      PUBLIC SECTION.
        METHODS: CONSTRUCTOR
        IMPORTING I_ID TYPE STRING,
        HELP_THE_PILOT FOR EVENT
        CALL_BUTTON_PRESSES OF PILOT,
        HELP_A_PASSENGER FOR EVENT
        CALL_BUTTON_PRESSED OF PASSENGER
        IMPORTING E_SEATNUMBER,
    <b>    CALL_SERVICE_PRESSED FOR EVENT
        CALL_SERVICE_NUMBER OF PASSENGER
        IMPORTING E_SERVICENUMBER,
        CALL_TYPE_PRESSED FOR EVENT
        CALL_SERVICE_TYPE OF PASSENGER
        IMPORTING  E_SERVICETYPE.</b>
      PROTECTED SECTION.
        DATA ID TYPE STRING.
    ENDCLASS.                    "flight_attendant DEFINITION
    class Implementations
    CLASS PILOT IMPLEMENTATION.
      METHOD CALL_FLIGHT_ATTENDANT.
        RAISE EVENT CALL_BUTTON_PRESSES.
      ENDMETHOD.                    "call_flight_attendant
    ENDCLASS.                    "pilot IMPLEMENTATION
          CLASS passenger IMPLEMENTATION
    CLASS PASSENGER IMPLEMENTATION.
      METHOD: CONSTRUCTOR.
        SEATNUMBER = I_SEATNUMBER.
        SERVICENUMBER = I_SERVICENUMBER.
        SERVICETYPE = I_SERVICETYPE.
      ENDMETHOD.                    "constructor
      METHOD: CALL_FOR_HELP.
        RAISE EVENT: CALL_BUTTON_PRESSED
        EXPORTING E_SEATNUMBER = SEATNUMBER.
    <b>    RAISE EVENT: CALL_SERVICE_NUMBER
        EXPORTING E_SERVICENUMBER = SERVICENUMBER.
        RAISE EVENT: CALL_SERVICE_TYPE
        EXPORTING E_SERVICETYPE = SERVICETYPE.</b>
      ENDMETHOD.                    "call_type_help
    ENDCLASS.                    "passenger IMPLEMENTATION
          CLASS flight_attendant IMPLEMENTATION
    CLASS FLIGHT_ATTENDANT IMPLEMENTATION.
      METHOD CONSTRUCTOR.
        ID = I_ID.
      ENDMETHOD.                    "constructor
      METHOD HELP_THE_PILOT.
        WRITE: / ID, 'helps pilot'.
      ENDMETHOD.                    "help_the_pilot
      METHOD: HELP_A_PASSENGER.
        WRITE: / ID, 'helps passenger on seat',
        E_SEATNUMBER.
      ENDMETHOD.                    "help_a_passenger
    <b>  METHOD CALL_SERVICE_PRESSED.
        WRITE: 'to have serviceno', E_SERVICENUMBER.
      ENDMETHOD.                    "call_service_pressed
      METHOD CALL_TYPE_PRESSED..
        WRITE: 'service type' ,E_SERVICETYPE.
      ENDMETHOD.</b>                    "call_type_pressed
    ENDCLASS.                    "flight_attendant IMPLEMENTATION
    global data
    DATA: O_PILOT TYPE REF TO PILOT,
    O_PASSENGER_1 TYPE REF TO PASSENGER,
    O_PASSENGER_2 TYPE REF TO PASSENGER,
    O_PASSENGER_3 TYPE REF TO PASSENGER,
    O_PASSENGER_4 TYPE REF TO PASSENGER,
    O_PASSENGER_5 TYPE REF TO PASSENGER.
    DATA: O_PURSER TYPE REF TO FLIGHT_ATTENDANT,
    O_STEWARDESS TYPE REF TO FLIGHT_ATTENDANT,
    O_FOODSERVICE TYPE REF TO FLIGHT_ATTENDANT,
    O_DRINKSERVICE TYPE REF TO FLIGHT_ATTENDANT.
    classical processing blocks
    START-OF-SELECTION.
      CREATE OBJECT: O_PILOT,
      O_PASSENGER_1 EXPORTING I_SEATNUMBER = 11
                              I_SERVICENUMBER = 12
                              I_SERVICETYPE = 13,
       O_PASSENGER_2 EXPORTING I_SEATNUMBER = 14
                              I_SERVICENUMBER = 15
                              I_SERVICETYPE = 16,
       O_PASSENGER_3 EXPORTING I_SEATNUMBER = 17
                              I_SERVICENUMBER = 18
                              I_SERVICETYPE = 19,
       O_PASSENGER_4 EXPORTING I_SEATNUMBER = 20
                              I_SERVICENUMBER = 21
                              I_SERVICETYPE = 22,
    O_PASSENGER_5 EXPORTING I_SEATNUMBER = 23
                              I_SERVICENUMBER = 24
                              I_SERVICETYPE = 25.
    *o_passenger_2 exporting i_seatnumber = 17,
    *o_passenger_2 exporting i_seatnumber = 21,
    *o_passenger_2 exporting i_seatnumber = 25,
    *o_passenger_2 exporting i_seatnumber = 31.
      CREATE OBJECT: O_PURSER
      EXPORTING I_ID = 'purser',
      O_STEWARDESS
      EXPORTING I_ID = 'stewardess',
      O_FOODSERVICE
      EXPORTING I_ID = 'foodservice',
      O_DRINKSERVICE
      EXPORTING I_ID = 'drinkservice'.
      SET HANDLER: O_PURSER->HELP_THE_PILOT FOR O_PILOT,
      O_STEWARDESS->HELP_A_PASSENGER FOR ALL INSTANCES,
    <b> O_STEWARDESS->CALL_SERVICE_PRESSED FOR ALL INSTANCES,
      O_STEWARDESS->CALL_TYPE_PRESSED FOR ALL INSTANCES.</b>
      CALL METHOD: O_PILOT->CALL_FLIGHT_ATTENDANT,
      O_PASSENGER_1->CALL_FOR_HELP.
    similarly call the methods for the other objects also.
    Regards,
    Vidya

  • Can anyone help me with this program using the Scanner Class?

    I have to write a program that asks for the speed of a vehicle (in miles-per-hour) and the number of hours it has traveled. It should use a loop to display the distance a vehicle has traveled for each hour of a time period specified by the user. Such as 1 hour will equal 40 miles traveled, 2 hours will equal 80, 3 hours will equal 120, etc. This is what I've come up with thus far. Any help is appreciated.
    import java.util.Scanner;
         public class DistanceTraveled
              public static void main(String[] args)
                   int speed;
                   int hours;
                   int distance;
                   Scanner keyboard = new Scanner(System.in);
                   System.out.print("What is the speed of the vehicle in miles-per-hour?");
                   speed = keyboard.nextInt();
                   System.out.print("How many hours has the vehicle traveled for?");
                   hours = keyboard.nextInt();
                   distance = speed*hours;
                   while (speed < 0)
                   while (hours < 1)
                   System.out.println("Hour     Distance Traveled");
                   System.out.println("------------------------");
                   System.out.println(hours + " " + distance);
    }

    When you post code, wrap it in code tags. Highlight it and click the CODE button above the text input area.
    You seem to be trying to reuse the speed and hours variables in your loop. That's probably a mistake at this point. Keep it simpler by defining a loop variable.
    Also I don't see the need for two loops. You just want to show how far the vehicle has traveled for each one-hour increment, assuming constant speed, for the number of hours it has been traveling, right? So a single for loop should be sufficient.

Maybe you are looking for