SATATIS of Procedural ABAP compared with CLASS-DATA of OO ABAP.

Hi,
Is the STATICS statement in procedural ABAP synonymous to CLASS-DATA in OO ABAP.
Please help.
Regards,
Rajesh.

Hello Rajesh
The strict answer is: no, they are different. However, they share things in common.
That's what the SAP documentation says about STATICS:
<a href="http://help.sap.com/saphelp_erp2005/helpdata/en/9f/db982c35c111d1829f0000e829fbfe/content.htm">Local Data in the Subroutine</a>
<b>Static Local Data Objects</b>
<i>If you want to keep the value of a local data object after exiting the subroutine, you must use the STATICS statement to declare it instead of the DATA statement. With STATICS you declare a data object that is globally defined, but only locally visible from the subroutine in which it is defined.</i>
Class-data are also globally defined yet they are valid everywhere within your class. That is different from local static variables that are only visible within the FORM routine where they are declared.
Regards
  Uwe

Similar Messages

  • Date compare with system date

    Given date time is in yyyyMMddHHmmss format, want to compare with system date time.
    ie given date time is greater than zero then go inside if block otherwise else block.

    I am using below code which always greater than zero. But I want to use compare to method to compare given date with system date and goto if or else condition:
    SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
             String delaytimeFormat = sdf.format(new Date("10/10/2009"));    
             System.out.println("delaytimeFormat: "+delaytimeFormat);
             long timeDiff = Long.parseLong(delaytimeFormat) - System.currentTimeMillis(); 
             System.out.println("timeDiff->"+timeDiff);
             String newCallbackUrl = null;
            if(timeDiff > 0){
                 s = s+" new URL"+"test" ;
                 System.out.println("if:->"+s);
            else{
                 System.out.println("else");
            }

  • CLASS-DATA in OO ABAP

    Hi,
    I know the definition of CLASS-DATA in OO concept. I understand that it can be accessed by on CLASS-METHODS.
    But what is the use of it ? Why do we need static data ?
    Is this different fro STATICS we use in procedural ABAP.
    Regards,
    Rajesh.

    If there are multiple instances of the class, the data area is shared between all instances, which means when instance 1 of the class sets the value, then all other instances have the attribute with the same value,  I believe that  iit points to the same memory.  Here is an example app, notice that then the first object is created, it sets the value,  then when writing out the objects,  both instances see the same value for NUM1 even though only the first object actually filled the value,  so the second is looking at the same memory area because it is labeled as CLASS-DATA.
    report zrich_0001.
    *       CLASS lcl_tst DEFINITION
    class lcl_tst definition.
      public section.
        class-data: num1 type n.
        data: num2 type n,
              num3 type n.
        methods: constructor importing im_num1 type n
                                       im_num2 type n
                                       im_num3 type n.
    endclass.
    *       CLASS lcl_tst IMPLEMENTATION
    class lcl_tst implementation.
      method constructor.
        if not im_num1 is initial.
          num1 = im_num1.
        endif.
        if not im_num2 is initial.
          num2 = im_num2.
        endif.
        if not im_num3 is initial.
          num3 = im_num3.
        endif.
      endmethod.
    endclass.
    data: o_tst type ref to lcl_tst.
    data: o_tst_list type table of ref to lcl_tst.
    data: no_value type n.
    start-of-selection.
      create object o_tst
            exporting
                 im_num1 = '3'
                 im_num2 = '4'
                 im_num3 = '5'.
      append o_tst to o_tst_list.
      create object o_tst
         exporting
              im_num1 = no_value
              im_num2 = '6'
              im_num3 = '7'.
      append o_tst to o_tst_list.
      loop at o_tst_list into o_tst.
        write:/ o_tst->num1, o_tst->num2, o_tst->num3.
      endloop.
    Regards,
    Rich Heilman

  • Stored Procedure to compare two tables data

    Hello,
    I want to have a Stored Procedure which will compare data (only a single column) of two tables and delete the row which is not present in the second table.
    For eg.,
    I have got 2 tables called Table1 and Table2, which have the same column called ID(PK).
    The data in Table1 is 1,2,3 and data in Table2 is 1,3. When the stored procedure runs, it has to compare the ID column in Table1 to ID column in Table2 and since '2' is not there in Table2, I want to delete this row from Table1.
    Thanks in advance.

    user11281601 wrote:
    Hello,
    I want to have a Stored Procedure which will compare data (only a single column) of two tables and delete the row which is not present in the second table.
    For eg.,
    I have got 2 tables called Table1 and Table2, which have the same column called ID(PK).
    The data in Table1 is 1,2,3 and data in Table2 is 1,3. When the stored procedure runs, it has to compare the ID column in Table1 to ID column in Table2 and since '2' is not there in Table2, I want to delete this row from Table1.
    Thanks in advance.
    delete from table1 where id_column in
    (select id_column from table1
    minus
    select id_column from table2);

  • DATA FROM A SELECTED RANGE COMPARED WITH OLDER DATA

    Post Author: NewITGuy
    CA Forum: General
    Hello , I have a report that I have to write that would Look at all the orders we have placed over the last year by partnumber and compare to see how many times we have purchased that part in the last 3 years. My problem I trying to figure out is that the report range I will need to lock in a record select back to 1 year from now to only show those partnumbers.
    If I lock it in that date range how will I be able to compare it to old because they wont show on the report.

    Post Author: V361
    CA Forum: General
    group by date, (select year) and setup your 1year old section, then use a subreport to pull up the current data.  Subreport can use a different date range.  or you can just use a or,  as shown below, it would pull up orders.order date between 2/18/2003 to 2/20/2003 as well as those between 2/22/2003 to 12/20/2003
    ({Orders.Order Date} in Date (2003, 02, 18) to Date (2003, 02, 20)) or{Orders.order Date} in Date (2003, 02, 22) to Date (2003, 12, 20)

  • Function Module To Copy Abap tables with data

    Hi,
    Is there an easy way to copy abap tables with the data to another destination table using function modules or sample codes?

    What do you mean for "destination"? Another SAP system e.g. an RFC destination?
    And what kind of table do you need to copy? Ztables? Standard Tables?
    If you mean Standard Tables, your task isn't a  safe procedure.

  • ABAP Dataflow using FTP data transfer method

    Hi,
    I am facing this error while executing the ABAP dataflow, the datastore configuration has FTP as data transfer method.
    I wanted to know if the ABAP program is generated succesfully and the error is while executing the ABAP program or there is an issue with the generation of ABAP program itself... Please help me understand the issue.
    Since I am unable to attach the doc, please see the error message below.
    Job name: Job_Module4_ECC_To_BW
    (12.2) 02-28-11 11:14:45 (E) (16396:17152) R3C-150607: |Data flow DF_Module4_ECC_To_BW
                                                           Execute ABAP program <C:/TEMP/ZECC_To_BW> error <    Open File Error -- 
    madap8004\tmp/SAPECC_To_BW_ZCUST_NAME.txt>.
    (12.2) 02-28-11 11:14:45 (E) (16772:15444) R3C-150607: |Data flow DF_Module4_ECC_To_BW
                                                           Execute ABAP program <C:/TEMP/ZECC_To_BW> error <    Open File Error -- 
    madap8004\tmp/SAPECC_To_BW_ZCUST_NAME.txt>.
    Regards,
    Sri
    Edited by: srilakshmi.ponnada on Feb 28, 2011 11:58 AM

    Hi,
    I am really not clear with your question. This is the first time i am executing the ABAP interface with FTP data transfer method. The madap8004 is the FTP server name. and the path is where the file whould be generated I belive. Is it the problem with any read/write permissions on the server?
    -Sri

  • Compare with text file

    Is it possible to do a line by line compare with the data in a text file and print the required data?
    BufferedReader readCode = new BufferedReader(new FileReader("code.txt"));
    String code = readCode.readLine();
    while(more) {
    System.out.print("Code:");
    String productCode = in.readLine();
    while (code != null){
         code = readCode.readLine();
         if (!(productCode.equals(code) || productCode.equals(code) || productCode.equals(code) ||productCode.equals(code) || productCode.equals(code) || productCode.equals(code) || productCode.equals(code) || productCode.equals(code))){
         // Goes back to the next loop interaction. Skiping the rest of the loop below
         System.out.println("Invalid product code. Check the product code again");     
         continue;
    productTemp[j] = productCode;
    do{
         /*Keep asking for a quantity until some valid value is entered
         System.out.print("Quantity[0-100]:");
         productQuantity = Integer.parseInt(in.readLine());
    }while(productQuantity > 100 || productQuantity < 0);
    quantity[k]=productQuantity;          
    totalQuantity = quantity[k] + totalQuantity;
    j++;
    k++;
    noOfItems++;          
    }     i cant seem to compare the user input code with the code in my textfile.i am stuck here...can somebody enlighten me?

    nvm...thanks for ur help anyway..i try others
    ways..save ur remarks for other pplThis is a public unmoderated forum. If you don't want remarks, don't post.
    Besides, if you're not willing to describe your problem in better detail, what kind of "help" do you expect? It's not like you've entered a forum full of psychics. Your problem is unclear. You've been given suggestions. If you have a more specific question, feel free to ask. Otherwise, feel free to continue floundering about.
    Good luck.

  • Class Data Sharing in Java 5

    Hi All,
    I am looking at porting over our current Java application from Java 1.4.2 to Java 1.5.
    One of the main reasons is because of the CDS facility in Java 1.5.
    Running the same app, one on 1.4.2 and the other on 1.5, on 1.5 it uses about 20% more memory !!!!
    This application involves 3 JVM's running communicating via RMI.
    When I start each of the applications with -Xshare:on, the first starts fine, indicating it is using CDS,
    (-showversion parameter will indicate sharing), but then the next two wont start giving an error indicating
    the shared archive cannot be accessed.
    Before I started the apps I manually created the shared archive using the call java -Xshare:dump which
    places the classes.jsa file in the directory jre/lib/i386/client/classes.jsa
    I am running an Intel Solaris platform.
    Any ideas why this isnt working ?

    ok, I have some more information after doing more investigation...
    Here is the bug which I submitted to Sun...
    FULL OS VERSION :
    SunOS con1 5.8 Generic_108529-29 i86pc i386 i86pc
    A DESCRIPTION OF THE PROBLEM :
    I am running an application with 3 JVM's. I have manually enabled Class Data Sharing using the command java -Xshare:dump. This seems to work fine.
    When I start the first JVM with the command line option -Xshare:on it seems to start fine and indicates "sharing" when I print out -showversion.
    Then when I start any subsequent JVM's with -Xshare:on AND the -Xmx5m parameter I receive the following error:
    An error has occured while processing the shared archive file. Unable to reserve shared region. Error occurred during initialization of VM Unable to use shared archive.
    It seems to work fine if I dont set the maximum heap size.
    THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: No
    THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: No
    STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
    Try to execute a JVM with class data sharing on, then try it again with class data sharing on, AND trying to set the maximum heap size.
    EXPECTED VERSUS ACTUAL BEHAVIOR :
    It should still allow CDS.
    ERROR MESSAGES/STACK TRACES THAT OCCUR :
    An error has occured while processing the shared archive file. Unable to reserve shared region. Error occurred during initialization of VM Unable to use shared archive.
    REPRODUCIBILITY :
    This bug can be reproduced always.
    The error only occurs when using Xshare AND Xms<NUMBER>m as parameters !

  • 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

  • Compare Hiredate with Current date in PCR

    As per the requirement I have, a certain type of accrual needs to occur on the employee's anniversary date, this accrual should only happen on the first anniversary. How can I compare hire date with current date ignoring the year, and then ignoring the same logic from second year on-wards.
    Can someone please help me with the possible method of implementing this requirement in a time PCR.

    In my humble opinion, I think that you should achieve that by means of an ABAP program, it should be scheduled to run every day and compare the hiring date with the current date of every employee, then create a batch input to Infotype 2013... it would be easier to track and monitor, since you would have all logs in SM35
    Best regards,
    Federico.

  • To compare date with another date in string in siebel bip report

    Hi,
    In my rtf I am comparing a Date1 with a date in string i.e. '10-NOV-14'. If Date1 is less than '10-NOV-14' I am dispalying a certain text and if not another text.
    This condition is working fine if Date1 have 2014 values but if  Date1 cointains 2015 date than the mentioned condition is falling.
    Kindly suggest any solutions.
    Regards,
    Siddhika

    This example may help:
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">
    <xsl:param name="currentDate"/>
        <xsl:variable name="firstDate" select="concat(substring($currentDate, 1,4),substring($currentDate, 6,2),substring($currentDate, 9,2))"/>
        <xsl:template match="/">
            <xsl:apply-templates select="//item"/>
        </xsl:template>
        <xsl:template match="item">
            <xsl:variable name="secondDate" select="concat(substring(submissionDeadline, 1,4),substring(submissionDeadline, 6,2),substring(submissionDeadline, 9,2))"/>
            <xsl:choose>
            <xsl:when test="$firstDate &gt; $secondDate">
                <xsl:call-template name="late"/>
                </xsl:when>
                <xsl:when test="$firstDate &lt; $secondDate">
                    <xsl:call-template name="ontime"/>
                </xsl:when>
                <xsl:when test="$firstDate = $secondDate">
                    <xsl:call-template name="same"/>
                </xsl:when>
                <xsl:otherwise>Monkeys<br /></xsl:otherwise>
            </xsl:choose>
        </xsl:template>
        <xsl:template name="ontime">
            This is on time
        </xsl:template>
        <xsl:template name="late">
            This is late
        </xsl:template>
        <xsl:template name="same">
            This is on time
        </xsl:template>
    </xsl:stylesheet>

  • How to compare table's date field with dropdown year field

    Hi All,
    I have one requirement to display the selected rows from a database table based on the selection of drop down.
    Here, I have one dropdown of year(like 2009,2010,....) and I have one database table which contains one field with "DATE".
    Now, I want to compare table's DATE field with my dropdown field.
    Problem is that table's DATE field is of type "DATS" and dropdown is of type INTEGER(or) STRING ...
    How to compare this fields?
    Can any one please give me solution for this...!
    Thanks in Advance!

    Hi  sreelakshmi.B,
    try the following:
    DATA lt_dats        TYPE TABLE OF dats.
    DATA l_dat_i        TYPE          i.
    DATA l_dat_c_4(4)   TYPE          c.
    DATA l_dat_c_12(12) TYPE          c.
    DATA l_dats_from    TYPE          dats.
    DATA l_dats_to      TYPE          dats.
    *Move Date from Integer to Char
    l_dat_c_4 = l_dat_i = 2005.
    *Create Date From use in WHERE-Clause
    CONCATENATE '01.01.' l_dat_c_4 INTO l_dat_c_12.
    CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
         EXPORTING
              date_external            = l_dat_c_12
         IMPORTING
              date_internal            = l_dats_from
         EXCEPTIONS
              date_external_is_invalid = 1
              OTHERS                   = 2.
    IF sy-subrc <> 0.
    ENDIF.
    *Create Date To use in WHERE-Clause
    CONCATENATE '31.12.' l_dat_c_4 INTO l_dat_c_12.
    CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
         EXPORTING
              date_external            = l_dat_c_12
         IMPORTING
              date_internal            = l_dats_to
         EXCEPTIONS
              date_external_is_invalid = 1
              OTHERS                   = 2.
    IF sy-subrc <> 0.
    ENDIF.
    * Select records in range
    SELECT *
           FROM [DBTAB]
           INTO TABLE [ITAB]
           WHERE [DATE] BETWEEN l_dats_from
                        AND     l_dats_to.
    Regards
    REA

  • How to compare current date with past date

    Sample code for comparing current date with past date
    i dont want to Calender.set method to compare it.
    How can i do it?

    PLEASE stay with ONE thread:
    http://forum.java.sun.com/thread.jspa?threadID=5143991&tstart=0

  • Class-data versus data and methods versus class-methods in OO ABAP

    Hi
    I was going thorugh following OO ABAP code.
    CLASS vessel DEFINITION.
      PUBLIC SECTION.
        METHODS: constructor,
                 drive IMPORTING speed_up TYPE i,
                 get_id RETURNING value(id) TYPE i.
        CLASS-METHODS: start,
                       objects,
                       inheritance,
                       interfaces,
                       events.
      PROTECTED SECTION.
        DATA: speed TYPE i,
              max_speed TYPE i VALUE 100.
      PRIVATE SECTION.
        CLASS-DATA object_count TYPE i.
        DATA id TYPE i.
    ENDCLASS.
    Whats is difference between methods and class-methods ?
    What is the difference between data and class-data ?

    Hi Rajesh,
    There are two types of componenets in a class
    1)Static components
    2) Instance components
    Instance components exist for every instance of the class, while static exist only once for any number of instances of the class.
    Components of the class are methods, attributes, events etc.
    static attributes are represented by CLASS-DATA and instance attributes are represented by DATA.
    static methods hence are done by CLASS-METHODS and can access only static attributes.
    Instance methods are done by METHODS and can access any attribute.
    For eg: supposing that in a class, there is a static attribute. Suppose after one instance is created, we are setting this static attribute value as 10. Now we are creating another instance of the same class. Now when you try to display the value of this attribute, it will be 10.ie. it needs to be initialized once and can be shared between instances.
    Just go through this document..You will get nice info from this.
    http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
    http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    If you want to go deeper, like object persistence and all, just refer this document.
    http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt
    Regards,
    SP.

Maybe you are looking for