Use of Class_Constructor in OOPS

Hi All,
Can i anyone tell me the exact use of class_constructor.
Any situation where you can use class constructor other than initializing static attributes
I want to know what's the purpose of class_constructor
Thanks
David

If you are reading one internal table based on the class attributes and you are using the READ Value to all other methods at that time class-constructore will be helpful because It will be executed only once for all instances with in a class and class-constructor must be defined in PUBLIC SECTION.
Kanagaraja L
Edited by: Kanagaraja  Lokanathan on Jun 29, 2009 6:22 PM

Similar Messages

  • How to trigger New page while using ALV with classes/oops?

    Hi All
    I am trying to print a report which has to show the data in two pages.
    I am using ALV with classes/oops.
    Though I am able to print the report but a new page is not coming. Whole of the data is coming in one single page.
    Please tell me as to how to trigger a NEW PAGE while using ALV with classes/oops.
    Please send some code samples also if available.
    Thanks in advance.
    Jerry

    using sort option you can do it. in case of grid/oo alv class ALV you can view that only in print mode/preview mode.
    in case of list you can view that directly.
    sort-fieldname = 'FIELDNAME'.
    sort-group = '*'  "triggers new page
    sort-up = 'X'.
    append sort to it_sort.

  • Use of Events in OOPS ABAP

    Hi all,
        Can anybody please say me what is the exact use of EVENTS in OOPs ABAP. Can anybody please explain me with an example.
    Thanks in advance.

    hi,
    By triggering an event, an object or a class announces a change of state, or that a certain state has been
    achieved.
    Events link objects or classes more loosely than direct method calls do. Method calls establish precisely
    when and in which statement sequence the method is called.
    However, with events, the reaction of the
    object to the event is determined by the triggering of the event itself.
    Events are most often used in GUI implementations.
    Other external object models, such as COM, ActiveX Controls etc, also provide events.
    At the moment of implementation, a class defines its
    instance events (using the statement EVENTS) and
    static events (using the statement CLASS-EVENTS)
    Classes or their instances that receive a message when an event is triggered at runtime and want to react
    to this event define event handler methods.
    Statement : (CLASS-)METHODS <handler_method> FOR EVENT <event> OF <classname>.
    These classes or their instances register themselves at runtime to one or more events.
    Statement : SET HANDLER <handler_method> FOR <reference>. (for instance events)
    SET HANDLER <handler_method>. (for static events).
    A class or an instance can trigger an event at runtime using the statement RAISE EVENT.
    Both instance and static events can be triggered in instance methods.
    Only static events can be triggered in static methods.
    Events can only have EXPORTING parameters which must be passed by value.
    Triggering an event using the statement RAISE EVENT has the following effect:
    the program flow is interrupted at that point
    the event handler methods registered to this event are called and processed once all event handler methods have been executed, the program flow starts again.
    If an event handler method in turn triggers an event, then the program flow is again interrupted and all event handler methods are executed (nesting).
    Events are registered using the command SET HANDLER. Registration is only active at program runtime.
    Events cannot be persistent.
    You want to register an object to an event belonging to another object. The SET HANDLER... statement
    enters the registration in that object’s list. All handlers for one event are entered in this list.
    When the event is triggered, the list shows which event handler methods need to be called.
    Event handler methods are triggered by events (RAISE EVENT), although they can also be called like
    normal methods (CALL METHOD).
    The interface of the event handler method consists solely of IMPORTING parameters. Only parameters
    from the definition of the corresponding event (event interface) can be used.
    An event interface only has EXPORTING parameters and is defined using the EVENTS statement in the declaration of the event. The
    parameters are typed in the event definition and the typing is passed to the event handler method, that is,
    the interface parameters of the event handler method cannot be typed in the definition of the event handler
    method.
    In addition to the explicitly defined event interface parameters, the implicit parameter SENDER can also be
    listed as an IMPORTING parameter for instance events. This passes on a reference to the object that
    triggered the event.
    Events are also subject to the visibility concept and can therefore be either public, protected or private.
    Visibility establishes authorization for event handling :
    all users only users within that class or its subclasses
    only users in that class.
    Event handler methods also have visibility characteristics. Event handler methods, however, can only have
    the same visibility or more restricted visibility than the events they refer to.
    The visibility of event handler methods establishes authorization for SET-HANDLER statements: SET
    HANDLER statements can be made anywhere in that class and its subclasses only in that class
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Feb 14, 2008 2:45 PM

  • Using field symbols in OOPs programming...have ur points.

    Hi all,
    I want to use field symbols in OOPS programming like this...
    But the system is giving me dump....help me.
    START-OF-SELECTION.
    CREATE OBJECT OBJ.
    FIELD-SYMBOLS : <AB> TYPE ANY.
    ASSIGN OBJ TO <AB>.
    CALL METHOD <AB>->add
      EXPORTING
        a      = 4
        b      = 6
      changing
        c      = Z
    WRITE : / Z.

    check the code below
    TYPES: BEGIN OF t_struct,
             col1 TYPE i,
             col2 TYPE i,
           END OF t_struct.
    DATA: dref1 TYPE REF TO data,
          dref2 TYPE REF TO data.
    FIELD-SYMBOLS: <fs1> TYPE t_struct,
                   <fs2> TYPE i.
    CREATE DATA dref1 TYPE t_struct.
    ASSIGN dref1->* TO <fs1>.
    <fs1>-col1 = 1.
    <fs1>-col2 = 2.
    dref2 = dref1.
    ASSIGN dref2->* TO <fs2> CASTING.
    WRITE / <fs2>.
    GET REFERENCE OF <fs1>-col2 INTO dref2.
    ASSIGN dref2->* TO <fs2>.
    WRITE / <fs2>.
    reward points if helpful.........

  • How to display the Logo by using TOP_OF_Page Event in OOPS

    Hi Gurus,
    I'm using TOP_OF_Page event to print Header and Logo in the same conatiner.
    Let me explain the case clearly,i have splitted the main conatiner in two parts like conatiner1 and conatainer2.
    i want to display logo and header in the container1, and i'm trying to use the * vertical_split * method ,but i'm unable to display the logo by splitting this conatiner vertically.........
    and if possible plz forward the sample code....
    Hence plz suggest me how to handle this.
    Thanks inadvance.

    Hi,
    In your top container i.e, container1, you can directly display the logo as well as text as there are methods already available in class  CL_DD_DOCUMENT(For eg, ADD_TEXT, ADD_PICTURE, ADD_ICON etc).
    Data:  lo_document TYPE REF TO cl_dd_document.
    CREATE OBJECT lo_document
        EXPORTING
          style = 'ALV_GRID'.
    CALL METHOD lo_document->add_text                   " To add text
        EXPORTING
          text         = text-006
          sap_fontsize = '18'
          sap_emphasis = cl_dd_area=>strong.               " For bold
      CALL METHOD lo_document->new_line.               " For new line
    CALL METHOD lo_document->add_text
        EXPORTING
          text         = text-018
          sap_emphasis = cl_dd_area=>strong.
      CALL METHOD lo_document->add_gap                 " To add gap in the same line
        EXPORTING
          width = 10.
    CALL METHOD lo_document->add_picture             " For picture
        EXPORTING
          picture_id       = 'TRVPICTURE01'
          width            =  '100'.
    CALL METHOD lo_document->display_document
        EXPORTING
          parent = lo_top_container1.
    Thanks and Regards,
    Himanshu

  • Prob. while using error message in OOPS ALV

    Friends,
    I have developed an OOPS ALV to display the records with cost field as editable. And the cost should not accept decimals values, if the user enter the same (12.56) and click the save button (user-defined) then need to populate the error message. I am populating the error message, then the user change the value (12) and click the save, then in the ALV screen the chanegd value 12 is automatically back to prv. one 12.56 and the same error messgae is displaying.
    If i change the message type from Error to Info, then its working fine... but the client wants only error message. So anybody came across the same scenario? if yes.. pls share the solution..
    Ganesh C

    Hi,
    In this case, after the error message issued though the value is corrected , corrected data is not transferred to progarm.
    Program still works with old data. Check how you are issuing message and how you refereshing the table after user inputs.
    you can check program BCALV_EDIT_03 for vlidating fileds.
    I believe you can simply refer a data element which does not accepts decimal values.
    Regards,
    Ravi.

  • ALV Grid Report using OOPS

    Hi Friends,
    I have to develop the ALV Grid report using the Classes ie OOPS, as i am new to OOPS and know little bit of ALV,  so it will be little bit tough to develop the object so plz try to solve my query. I'm sending the Functional specs:
    The program should display the list of Purchase orders and Purchase requisitions created for specified materials. The output should be displayed in form of ALV grid. There should be separate ALV Grid for Purchase order and Purchase requisition list. The user should also have an option to save various ALV layouts and should be able to choose the ALV layout on the selection screen.The user should be able to navigate to the relevant document form the ALV grid. (Use hyperlink).
    The output must appear in the same screen.     
    Selection screen fields–
         Material Number
         Creation date (For both, PR and PO)
         Output fields –
              List one –
                  Po Number
                                        Po Item number
                                        Vendor
                                        Date
                                        Material Number
                                        Material Quantity
              List two –
                             PR Number
                                        Material Number
                                        Material Quantity
                                        Release status
                                        Date
                                        Reference
         Tables:  EKPO, EKKO, EBAN
         Transactions: ME23N
    HINT –      Use class - CL_GUI_ALV_GRID
    thnks in advance.....

    Hi,
    Check out these standard reports, they are enough to help you out .
    BCALV_GRID_01
    BCALV_GRID_02
    BCALV_GRID_03
    BCALV_GRID_04
    BCALV_GRID_05
    BCALV_GRID_06
    BCALV_GRID_07
    BCALV_GRID_08
    BCALV_GRID_09
    BCALV_GRID_10
    BCALV_GRID_11
    BCALV_GRID_AND_POPUP
    BCALV_GRID_DEMO
    Regards,
    Amit

  • Problem in alv report coumn header in the background while using salv

    Hi  all,
            now i am working on  alv report for this i have used salv i mean oops alv ,So here i am facing one issue while executing the report  in background
            the report column headers are not displaying properly as it is displaying in front end.
           In the back ground it is always displaying column header as data element field label short text. i have written a code to pick the long text
           but it is working fine if run the report in the frontend where as in the backgroiund it is always displaying short text but it is wrong.
    here i am attaching the output screen shots in front end and background.

    Hi Satish,
    I have tried this scenario with Reuse ALV grid 1st i found the same issue as u said in background job,
    then i set in field catalog as,
    wa_fcat-ddictxt = 'L'. Now its working fine. L stands for long text.
    Before...
    After...
    For LVC u can try the below fields in fieldcatlog.
    COLDDICTXT = 'L'.
    SELDDICTXT = 'L'

  • How to use arrays in view criteria

    Hi all,
    Am using Oracle Jdeveloper ,Studio Edition Version 11.1.1.2.0.
    I have a query panel with three comboxes,which can multiselect
    company,application & user respectively.When I mutiselect company,
    then based on the selected value I need to populate the application
    & user comboboxes.I want to search based on the selection.
    I have used viewcriteria to filter the apllication&
    user comboboxes.When a company is selected then company_id is passed as
    bind variable to the view criteria,then it can filter application combobox.
    Its working fine on single selection.
    So I want to pass the selected values as an array to view criteria.
    Please help
    Thanks

    cn u chk this..
    http://jobinesh.blogspot.com/2010/12/using-oraclejbodomainarray-with.html
    oops.. i am late by three minutes.. ;)
    you can check the link provided.. above

  • ALV using class

    I hve radio button in selection screen . if i executet his prog by selecting any of this radio button it shuld go to alv list. here alv list using the concept of oop.
    whether i need to add 2 screens to display this 2 ALV list.since the method to display the ALV is writing in PBO output of the screen.
    is it possible to pass the internal table to same screen depends on the selection of radio button.

    but in
    MODULE PBO OUTPUT. (of the screen 100)
    CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
    exporting
       I_BUFFER_ACTIVE               =
       I_BYPASSING_BUFFER            =
       I_CONSISTENCY_CHECK           =
       I_STRUCTURE_NAME              =
       IS_VARIANT                    =
         I_SAVE                        = 'A'
       I_DEFAULT                     = 'X'
         IS_LAYOUT                     = gs_layout
       IS_PRINT                      =
       IT_SPECIAL_GROUPS             =
       IT_TOOLBAR_EXCLUDING          =
       IT_HYPERLINK                  =
       IT_ALV_GRAPHICS               =
       IT_EXCEPT_QINFO               =
          CHANGING
            IT_OUTTAB                  = t_output1[]
            IT_FIELDCATALOG            = w_gt_field
       IT_SORT                       =
       IT_FILTER                     =
    EXCEPTIONS
       INVALID_PARAMETER_COMBINATION = 1
       PROGRAM_ERROR                 = 2
       TOO_MANY_LINES                = 3
       others                        = 4
    will call this method passing t_output1.
    but for the next radiobutton internal table dat shuld pass to this method is t_output2.
    can i pass internal table to module PBO output?

  • OOPS CONCEPTS IN  ALV

    Hi ,
          Can anyone help me out where we use the concepts of oops in alv's..I nned to work on alv with oops concepts so do anyone have any kind of material for oops concepts in alv.Can u pls tell me do we use any oops specific function modules to generate an alv report ??? Pls help me out ASAP in this regard..

    The following site points you in the direction of a few standard SAP programs which create OOPS ALV grids.
    http://www.sapdevelopment.co.uk/reporting/alv/alvscr.htm

  • Calendar Template

    I am looking for a calendar template I can use in either Pages, Numbers or Keynote - surely there is one somewhere?

    Smile. Don't worry about that ...
    As of now, though, I can't open it. Did you use
    iWork '06 ?
    D
    I did use iwork'06. Oops... There is now an update on the same page that includes a copy saved as an iWork'05 file which you should be able to open in Pages 1. There are a few limitations where the tables no longer use forumlas and the scaling and mask on the image placehold does not carry across to replacement images, but it should work for your needs.
    Sorry for the delay.
    Gerry.
    (PS. the attachment is on the first message in the iWorkAbuser thread.)
    Message was edited by: Gerry Straathof

  • ITunes Library file content / format

    I am using the iTunes library file to process song titles for a label program, and I have two questions about these files:
    1) There are two library files on my disk, Library.xml, and iTunes Music Library.xml. When double-clicked, the latter opens with Firefox, and the former opens in TextEdit. Library.xml is the file I use, which I parse with Perl and generate input for a PostScript label program. The question here, what is the purpose of these two files; i.e., how are they used by iTunes?
    2) I need to extract the Total Time and the Size parameters, which are given in (very large!) integer format. I have found that Size is nearly a constant multiple of Time, so apparently Time is redundant. Also, I can't make any sense of these numbers, except to use the resulting ratio for one and then to apply that ratio to all the others. When I do this, I get nearly accurate results, but they are always off by 3 to 5 seconds. As for the Size, I tried to make sense of the large integer in terms of sampling rate and size 44.1/16-bit), but without success. So, if anyone has the secret to these parameters, I would appreciate knowing it! Thanks much in advance for any help on this.
    PS: I will post some specifics here if needed. For example, Total Time 182437 shows up in iTunes as 3:02 (182 seconds). The ratio here is 1,002.4010989011, which, when applied to another title with a Total Time of 222477 gives 221.9 seconds, or 3:42; this item shows up correctly in iTunes, but not all do when I use the same ratio.

    Oops! I forgot that. My hunch was correct, though. Unix reports exactly the same sizes as the iTunes file. My error was not dividing by 1028. (I thought the finder was the culprit!) Thanks for all the help.
    By the way, why are there two .xml files for the library? The Library.xml file is the one I am using, because the structure is pretty obvious in a text editor.
    For your information, I belong to the Illini Folk Dance Society at the University of Illinois, Urbana-Champaign Illinois. We have some 200 titles on 78 rpm records, already digitized, and approximately 600 or so on 45 rpm, which I am now in the process of recording. After that, there are many LP recordings to do (our total collection consists of approximately 3000 titles), although they can keep for a while. After lots of experimenting, I decided that the quality of the 78s and 45s merited the 44.1/16-bit recording levels, and that is working out nicely, and it keeps the files to a reasonable size. I started out with Garage Band (all the 78s were done that way), but got fed up with that pretty quickly, especially the tight link to iTunes, so when Audacity came along, I started using it, and am very happy with it. We have one 250 gig hard drive, and I plan to add another. Also, I plan to put everything on CDs, which is why the present project. I wrote a PostScript program to print the titles on the labels in circular arcs, and am writing a Perl script to parse out the titles and sizes, grouping things in sets that will fit on one CD. If you are interested in the PostScript program, I will gladly send it to you. The Perl script is fairly trivial.
    Well, I just passed my 75th birthday, so I better get cracking! Cheers.
    Ed
    [email protected]

  • Asking for user input in the middle of a function

    Here's my issue.
    I need to launch and input window in the middle of a function for user input.  Before I can continue through the function I need a response back from the user first.  Psuedo code below:
    function
         function begins
         pop up window is launched to ask for user input
         function continues after users submits input
         user input from pop up window is used in function return value
    Let me know if you need more clarification but this is essentially what I'm attempting to do.

    The way actionScript works it isn’t really designed to work that way
    Is there any reason why you have to only use one function as you have written
    I think you really do need to split up your code into sections that a, set up the pop-up with  event listeners waiting for the input to be completed, trigger the pop up with user input, then have a handler function that then interprets the results of the user action.
    Trying to force the system into a closed loop while waiting will be a bad idea.
    By using a pop-up or an alert window that is set to be modal, you are effectively stopping your application doing anything else until the user input has been completed, but still not locking the app into a closed loop. Imagine what would happen if you did put the system into a closed loop, the mouse movement wouldn’t be updated, the screen wouldn’t refresh and the system wouldn’t be able to handle your user input. the reason for using async model is you are able to let the system still do all its background task (move the mouse, give inputs focus, keep the screen drawn etc) but still tell a part of your app to ‘wait for input’ before carrying on it execution of your logic
    Do you come from another programming language? Maybe one that uses less of an OOP approach? I only ask, as the method you are describing is much more like how I had to program when  I worked on computers years ago as an assembly programmer.
    In actionscript and most other modern languages and Oss you don’t have total control of the system and cant lock it into an action as you describe.
    You need to have an asynchronous approach to situations like you describe and let the system run in the back ground while you are waiting for input (or date from a server for that matter)
    Please excuse me if I am telling you things you already know.
    What exactly is your use case for this? Maybe if we knew exactly what you are working on I might be able to offer a solution that would make sense for your particular situation.
    Hope all is going well and please feel free to contact me if you are stuck

  • About filter in alv grid display

    Hi,
       I am practicing on REUSE_ALV_GRID_DISPLAY in that i want to know about how to use some fields like
       *ITFILTER*_
       IT_ALV_GRAPHICS
       IT_HYPERLINK
       IT_ADD_FIELDCAT
       IT_EXCEPT_QINFO

    Hi Rock.
    I would like to suggest you a couple of references which quite relate to your case,
    REUSE_ALV_GRID_DISPLAY -  Output of a simple list (single-line)
    [SDN - Reference for Using REUSE_ALV_GRID_DISPLAY - Basic Program|alv prog;
    [SDN - Reference for Use of IT_FILTER in REUSE_ALV_GRID_DISPLAY |Doubts in ALV?;
    [SDN - Reference for use of IT_FILTER with CODE in REUSE_ALV_GRID_DISPLAY|ALV Report;
    [SDN - Refernce for Using IT_ALV_GRAPHICS in REUSE_ALV_GRID_DISPLAY|OOPs :  SAVE and ALV Display Variant;
    [SDN - Reference for Editing a graph in ALV (IT_ALV_GRAPHICS) using REUSE_ALV_GRID_DISPLAY|Edit Graph display ALV list display;
    [SDN - Reference for use of IT_HYPERLINK in REUSE_ALV_GRID_DISPLAY|editable fields on ALV grid;
    [SDN - Reference including example of IT_ADD_FIELDCAT in REUSE_ALV_GRID_DISPLAY|building top of page in ALV list;
    [SDN - Reference for scenario for use of IT_EXCEPT_QINFO in REUSE_ALV_GRID_DISPLAY|Background ID in ALV Grid;
    [SDN - Reference for application example of IT_EXCEPT_QINFO in REUSE_ALV_GRID_DISPLAY|PF Status in ALV list.;
    Hope That's Usefull.
    Good Luck & Regards.
    Harsh Dave

Maybe you are looking for

  • Mavericks won't accept 'change all' command to open ALL pages files with v 4.3 app

    Hello again, I upgraded my MacBook Air mid June 2013 build to Mavericks at my Apple store. The download was fast, under 30 min., and the installation went well, also fast at about 40 minutes. All apps are working fine. I spent much time before taking

  • Vendor Advance through Cash Journal

    Hi, Is it possible to post Vendor advances (downpayment) through Cash journal. Client will pay advances to employees for travel. We created employee as a vendor and we need to pay and recover advances from vendors. Is it possible to post vendor advan

  • Need to add a Signature to my Text, to be Bill C-28 Compliant

    Hello all.  I am new to the forums and would like to thank everyone in advance for any help you may reply with.  I have searched the topics before posting without very much success. Being that come July 1st 2014 Bill C-28 will commence which requires

  • Satellite Pro M10: firmware upgrade issue DVD UJ-830B FW:1.50, HW:1.00

    Hi, I had tried to replace the old DVD/CDRW with the above UJ-830B ( FW: 1.50, HW: 1.00) but the result was IDE error. It is not recognize it in Windows at all. I have tried to solder the contact 48 and 49 but result is the same. How can I make to wo

  • Runtime Tab missing -J2ee Visual Admin

    Hi We want to maintain the PIRWBUSER in the PMIstore (j2ee visual admin ) under Cluster ® Server ® Services ® Destinations. but we are not able to see the "runtime " tab as mentioned in the following help doc. http://help.sap.com/saphelp_nw2004s/help