Deprecated methods in ABAP OO

Hello,
How can I mark a method in my own classes as deprecated? Is there a framework which supports this?
Kind Regards
Koen Van Loocke

Hi Koen,
As Matt said, really this option doesn't exist.
I usually add a comment in the description of the method (when Z), some times I insert an icon in this observation, this can be done through the following syntax( @8O\Q ) in description as follow.
Method Description => "@8N\Q this method should be avoided !"
Greetings.
Marcelo Ramos

Similar Messages

  • Redefine Static Methods in ABAP OO

    Hello,
    I want to redefine an public static method and returns always an error.
    Okay, I already solved the problem with an workaround, but I still don't understand, why it is not possible to redefine static methods in ABAP OO.
    If someone can give me an plausible reason, so I don't have do die stupid. G
    Thanks for help!
    Matthias

    It is built into the language that way.  HEre is a link that may or may not give you an answer.
    redefine static method?
    Regards,
    Rich Heilman

  • Meaning of factory method in abap objects

    Hi,
    Can anybody help me in understanding the meaning of factory method in abap object? what is the importance of this?
    Regards
    Sudhansu

    Hi Krish and Sudhansu,
    Design patterns are solutions which are already verified and known by many developers. That is why it is worth to use them. There is no need to reinvent the wheel in many cases.
    I would recommend book which is placed in the ABAP world:
    http://www.sap-press.com/products/Design-Patterns-in-Object%252dOriented-ABAP-(2nd-Edition).html
    Although Java language has intuitive syntax, there are some special things in ABAP development so it is better to check solutions adjusted for ABAP editor.
    The most common usage of factory pattern is to simplify object creation.
    - By one method call you provide required parameters and do all initializations, including dependent objects.
    - Class can have many factory methods, if you want to provide more ways of initialization.
    - Factory method is usually static in the class and they return initialized instance of object for this class.
    - There is naming convention to start factory method name with "create" - easy to recognize pattern.
    - If you set property of class to "private instantiation" then you force to use factory method for object creation. In this way it is really simple to find all places where object are created with given set of input parameters - find references of factory method.
    Factory pattern becomes even more powerful if we add inheritance. Factory method returns basic object (like ZCL_VEHICLE) but its implementation can return different subclass instance, depending on input parameter (ZCL_CAR, ZCL_TRAIN etc). Each instance can implement differently behavior (methods implementation), but these are object oriented techniques.
    Regards,
    Adam

  • How to insert Method in ABAP code

    Hi Gurus,
    Plz tell me how to insert a METHOD in ABAP code as we do in the case of inserting function in ABAP code using PATTERN.Button
    Rgds
    rajesh

    Hi,
    Try this.
    Click pattern tab ans select AABAP object patterns.
    Select call method.
    Then give the instance name , class/interface name and the method name.
    Sharin.

  • Accessing the Par file or java methods in ABAP programming at ECC from EP

    Hi experts,
    Can we access par file or java methods  in ABAP programming  (ECC side)which are at Enterprise portal side .If it is possible please
    let me know the procedure.Thanks for your help.
    Thanks and Regards,
    Venkat

    Hi Das,
    The mentioned wiki is for uploading the par file ,but my question is diffrent.This file or java method  need to be used in ABAP side.
    Thanks and Regards,
    venkat

  • After changing deprecated methods in Thread Class

    I have changed the deprecated methods suspend() and stop() with JDK1.2.2 methods wait() and thread = null respectively. I wanted to know the affects after changing when I actually run the application.

    For one thing, "thread = null" won't stop the thread. In fact it will have no effect on the thread at all.

  • Deprecated methods in Interfaces

    Hi all,
    I'm implementing an interface containing some deprecated methods. These deprecated methods have to be implemented, of course. If I compile my implementation I get deprecation warnings for these implemented methods. Does anyone know how I can get rid of these warnings? I've added @deprecated flags to my implementation of these methods, but that didn't solve these warnings. I'm using JDK 1.3.1.
    Thanks
    Daniel.

    Technically it's a feature. :p
    but seriously, the whole deprecated thing is a feature, it's too bad that in this case you have to live with it, but there's no way around it.
    besides it doesn't matter if you call a depreciated method as it is still going to work. It just means that some point in the future it will not be supported. And judgeing by sun's past actions, I would say that it's more of a way to encourage people not to use old methods, but I don't think that they will ever remove the depreciated methods from the api.
    The only methods you have to watch out for are the few like those the Thread which are just not implemented at all. Like thread.destroy()

  • Deprecated methods in 10.1.3

    Many methods in 10.1.3 are marked as deprecated.
    For example, class oracle.toplink.publicinterface.Descriptor is replaced by ClassDescriptor and RelationalDescriptor where getQueryManager() is deprecated with no replacement method.
    Another example, in oracle.toplink.sessions.Session interface, method containsObjectInIdentityMap is deprecated and no replacement is specified.
    I understand those deprecated methods will probably be removed in the future TopLink release. My question is: will TopLink provide the functions currently implemented in those methods, i.e. replacement methods?
    Thanks.
    Haiwei

    Haiwei,
    Yes the work done in 10.1.3 to add formal support for non-relational mapping (Object-XML and EIS/JCA) did require some refactoring of the descriptor class. In the end the previous Descriptor class was deprecated in place of a new ClassDescriptor hierarchy. This work is backwards compatible but some of the deprecated methods were not properly Java Doc'd with their new replacement.
    getQueryManager() -> getDescriptorQueryManager() - New method on ClassDescriptor
    All of the cache access methods have been refactored into a new IdentityMapAccessor class. This is available from any session using getIdentityMapAccessor().
    Doug

  • Removing deprecated methods from legacy source?

    What does one do about deprecated methods in legacy code?
    As new versions of the compiler seem to keep supporting the deprecated methods (just offering warnings), there is no reason to invest the resources to update the source? I don't mean methods such as:
    java.lang.Thread stop(),
    I am thinking of methods such as:
    java.awt.Window show();
    Will there ever be tangible consequences to not stopping using deprecated methods? Will code with deprecated methods eventually break?
    Edited by: dpxqb on May 7, 2010 9:50 PM

    There's often an "if it ain't broke, don't fix it" mentality around deprecated methods and classes. Whether that's appropriate or not depends on the individual case. Any deprecated method/class may be removed in any future release, but you have to balance the risk of that happening against the cost of replacing it. Some methods/classes will probably never go away--like Vector, for instance. So there's not much benefit to doing a search/replace on a large codebase.
    It depends on your analysis of the various risks and rewards in your particular situation.

  • How I make deprecated method in JB4

    Hi, i make deprecated method like this:
    * @deprecated
    public String fillCharsToLimit(String value, int limit, char chr, boolean fromFirst) {
    value = value.trim();
    if (value == null || (value.length() == 0 && limit <= 0))
    ;//do st
    (in project properties i enable Show deprecations)
    I except that compiler say me warning.
    Its ignore deprecation in my code, but when I use deprecated method from JDK all is OK, only my method no why?
    Thanks DK

    You don't get a deprecation warning if the deprecated class or method and the code that uses the deprecated class or method are compiled at the same time. See Bug 4216683 http://developer.java.sun.com/developer/bugParade/bugs/4216683.html for details.

  • FInding the Replacements for deprecated methods

    I am new to using the Java environment, having been mostly a VB/VB .NET and web developer...so please forgive me if this is a dumb question:
    I inherited some java code that is an extension to a 3rd party app. It was originally written under JDK 1.2.2 (I think), and I am now trying to recompile under JDK 1.4.2, using the Borland JBuilder X IDE.
    Everything seems to be OK, except that I get two warning messages about deprecated methods:
    getFormComponent().setFormProperties()
    getFormComponent().getAllFormProperties()
    I probably should have checked more, but these names would appear to be standard java classes. What methods should I be using instead? And more importantly, how do I go about looking up the current methods?
    Thanks in advance.

    I was coming to that conclusion as well...unfortunately, the 3rd party SW vendor does not appear to have updated their supplied documentation - all of the code examples still use the deprecated methods, and their HTML help doesn't return anything when I search for the method names.
    Looks like a call to their technical support line...
    THANKS for the prompt reply.

  • Calling custom Infotype method from ABAP report

    Hi Experts,
    I am working on an application where i need to call a method of a custom defined infotype.
    I have done this -->
    1. Create a custom infotype 9111
    2. SAP creates a class of that infotype ZCL_HRPA_INFOTYPE_9111
    3. Inside this method there are few inherited method which provide me functionality of insert , update , delete
    i want to call methods IF_HRPA_INFTY_BL~MODIFY,
    IF_HRPA_INFTY_BL~INSERT
    However when i call these method from abap report this method does not work.
    where as when i try to insert an entry using PA30 transaction it works.
    Does anyone know why does this happen and what is the solution?
    Regards,
    Ashish Shah

    Hi,
    This is the code we are using. Just calling the read and modify methods of the check class. Very simple actually .. we just want once update/insert to work but it does not.
    <CODE>
    REPORT  ZTESTRAD_WD.
    FIELD-SYMBOLS <p9106> TYPE p9106.
    DATA : infty_container_tab TYPE hrpad_infty_container_tab ,
           message_list        TYPE REF TO cl_hrpa_message_list,
         w_ok type boole_d  ,
         ref_class TYPE REF TO ZCL_HRPA_INFOTYPE_9106,
         container        TYPE REF TO if_hrpa_infty_container,
         it9106_container TYPE REF TO cl_hrpa_infotype_container,
         p9106_ref        TYPE REF TO data,
        busilog type ref to if_hrpa_masterdata_bl.
    CREATE OBJECT  message_list.
    TRY.
            CREATE OBJECT ref_class
              EXPORTING
                tclas = 'A'
                infty = '9106'.
          CATCH cx_hrpa_violated_assertion .
            write :/ 'Error during initialization'.
      ENDTRY.
    call method cl_hrpa_masterdata_bl=>get_instance
       importing
         masterdata_bl = busilog.
    TRY.
    CALL METHOD ref_class->IF_HRPA_INFTY_BL~read
      EXPORTING
        tclas           = 'A'
        pernr           = 'XXXXXXXX'
        infty           = '9106'
        begda           = sy-datum
        endda           = sy-datum
        no_auth_check   = abap_true
        message_handler = message_list
      IMPORTING
        container_tab   = infty_container_tab
        is_ok           = w_ok.
    CATCH cx_hrpa_violated_assertion .
       WRITE :/ 'Infotype could not be read'.
    ENDTRY.
    *" Fill the local structure with container data:
      loop at infty_container_tab into container.
        it9106_container ?= container.
        TRY.
        CALL METHOD it9106_container->primary_record_ref
          IMPORTING
            pnnnn_ref =  p9106_ref.
         CATCH cx_hrpa_violated_assertion .
        ENDTRY.
        ASSIGN p9106_ref->* to <p9106>.
        write :/ <p9106> .
      endloop.
    *" Just change some field values of the record
      <p9106>-C1name2 = 'Test name'.
      <p9106>-C2name2 = 'Test name 2 3 4'.
    data : return TYPE BAPIRETURN1,
           return1 TYPE BAPIRETURN1.
    *CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
    EXPORTING
       number        = <p9106>-pernr
    IMPORTING
      RETURN        = return1
    *PERFORM do_nothing(sapfp50p).
    The container itself is modified
      container ?= it9106_container->modify_primary_record( <p9106> ).
    CREATE OBJECT message_list.
    the invocation - errors are always fatal !!!
      DATA : lx_exception  TYPE REF TO cx_root,
             update_mode type HRPAD_UPDATE_MODE,
             massn type massn,
             massg type massg.
      TRY.
          CALL METHOD ref_class->IF_HRPA_INFTY_BL~MODIFY(
            EXPORTING
               old_container =                   it9106_container
               massn                          = massn
               massg                         = massg
               update_mode =                 update_mode
               no_auth_check =                   'X'
               message_handler =                 message_list
            IMPORTING
               is_ok =                           w_ok
            CHANGING
               container =                       container
        CATCH cx_hrpa_violated_assertion INTO lx_exception.
          RAISE EXCEPTION TYPE cx_wd_no_handler
            EXPORTING previous = lx_exception.
      ENDTRY.
    </CODE>
    I have also tried by instantiating the cl_hrpa_masterdata_bl and then calling the methods on that object...... makes no difference.
    I used this link to proceed with the modifications:
    http://help.sap.com/saphelp_erp2005/helpdata/en/43/21d2254bba2bebe10000000a1553f7/frameset.htm
    The funny thing is that the WHOLE logic executes without any error messages or dumps or anything. I have now debugged almost every line of code that these methods call. PA30 works just fine. HR_INFOTYPE_OPERATION does not .. that's a whole differnt story.

  • How to debug the method in abap program

    How to debug the method in abap program ?
    Could you please give the solution.
    Thanks
    sai

    Hi ,
    Place break point at call method .
    It takes u in to the method implementation .
    Here u can analyse the method implementation ...
    Reward if useful
    Thanks
    Jagadeesh.G

  • Can i call a HTTP Post method in ABAP or XI?

    Hi All,
    Can you please let me know how to call a HTTP Post method in ABAP or XI?
    my HTTP Post is looks like (HTML form)
    <form action="http://111.111.111.1:8080/sample_url" method="POST">
    <table>
    <tr><th>applicationId</th><td><input type="text" name="applicationId" value="test"></td></tr>
    <tr><th>authCode</th><td><input type="text" name="authCode" value="test"></td></tr>
    <tr><th>message</th><td><input type="text" name="message" value="Hello"></td></tr>
    <!--<tr><th>version</th><td><input type="text" name="version" value="3.1"></td></tr> -->
    <tr><th>contractId</th><td><input type="text" name="contractId" value="test"></td></tr>
    <tr><th>receiverMobileNumber</th><td><input type="text" name="receiver" value="11111111111"></td></tr>
    <tr><td colspan="2"><input type="submit" name="send" value="send"></td></tr>
    </table>
    </form>
    I have a requirement to send a message to the above mention URL using the POST method.
    Please let me know the possibility of sending it from ABAP or XI adaptor.
    Thanks & Regards,
    Chaminda

    Hi Prateek,
    shoul we send the below code as the payload?
    <tr><th>applicationId</th><td><input type="text" name="applicationId" value="test"></td></tr>
    <tr><th>authCode</th><td><input type="text" name="authCode" value="test"></td></tr>
    <tr><th>message</th><td><input type="text" name="message" value="Hello"></td></tr>
    <!--<tr><th>version</th><td><input type="text" name="version" value="3.1"></td></tr> -->
    <tr><th>contractId</th><td><input type="text" name="contractId" value="test"></td></tr>
    <tr><th>receiverMobileNumber</th><td><input type="text" name="receiver" value="11111111111"></td></tr>
    Thanks.
    Chaminda

  • File handling deprecated method - which one?

    I have this code, it should basically use the lines of text in a file and use them to construct nodes in a JTree. The compilation error is that the class uses a deprecated method - so does anybody know what method is the problem and what I should use?
    private void createNodes(DefaultMutableTreeNode top)
       DefaultMutableTreeNode anode = null; 
       File theFile = new File("categories.txt");
    try
    DataInputStream din1 = new DataInputStream(new FileInputStream(theFile));     
        //while (din1.available() !=0)
        while (true)
           String topic = din1.readLine().trim();
           //set the string as a tree node
           anode = new DefaultMutableTreeNode(topic);
           top.add(anode);
         din1.close();//close the file handle
         catch (Exception e)
              System.err.println("File input error");
    }//end of method

    If you compile with deprecation it will tell you specifically.
    I think it is:
    javac -deprecation ...
    The only method from below that I think it could be is readLine() in DataInputStream...
    If you are reading text...try:
    BufferedReader br = new BufferedReader(new FileReader(theFile));
    String topic;
    while ((topic=br.readLine())!=null)
        anode = new DefaultMutableTreeNode(topic);
        top.add(anode);
    br.close();

Maybe you are looking for

  • Save As function in Labview 8.6

    I am not able to get the "save as" duplicate all dependences function to work as I assumed it would. The function will not allow me to utilize the *.lvlib files names in the project I am copying from into the new project. It gives me an box with "nam

  • Barcode 3 of 9 does not display with text value

    What barcode is standard for a text value? I wanted to scan the document name using a barcode that is standard in our company. Using 3 of 9 gave me an invalid default value. On the form, there was no barcode displayed. The numeric values on the doc d

  • Agent is up but targets are showing

    Hi My agent is up and running. But target databases are showing Current Status Agent Unreachable Agent Unreachable Since Nov 26, 2008 9:51:51 PM I don't want to remove the targets and re add them back here. This will affect our regular monthly databa

  • Ipad air cant sign in imessage and facetime for ios 8.1.2

    Hi Before I make this topic, I read a lot of topics about the same problem as mine and I cant fine any solution. So my problem is: after updating to 8.1.2 for my ipad air, I have to sign in my imessage and facetime again and it says: "Imessage or Fac

  • Phone app doesn't show up on newly updated iphone4s

    I just received a new phone and completed the upgrades and downloaded the backup from iTunes.  After completing the installation of the new phone the bar at the bottom that usually show the phone app, safari, and mail is blank.  How do I get them to