ABAP Objects - Obsolete Statements

How to get the list of obsolete statements in ABAP Objects?
Moderator message: please search for available information/documentation before asking.
locked by: Thomas Zloch on Oct 6, 2010 1:08 PM

hi
Check table RODIR
and pass field name obselete ='X' and check data in table
it wil give all details..
it will help you out.
ankit
Moderator message: do not copy other peoples replies, whether in the same thread or not!
Edited by: Thomas Zloch on Oct 6, 2010 1:09 PM

Similar Messages

  • Export statement in ABAP Objects

    Hi All,
    I am using A Statment like this a BADI.
    EXPORT XXXXX TO MEMORY ID 'YYY'.
    But this statement is not supported in ABAP Objects can any one please let me know how i can use export statment is abap objects?
    Thanks in advance.

    I have pass a structure to the memory.
    Here is my structure : ztest.
    And i am using like this
    EXPORT ZTEST TO MEMORY ID 'HK'.
    Its not supporting in ABAP Objects.
    Can you please more clear with your answer?
    Thanks

  • ABAP list processing statements in ABAP Objects

    Hi,
    Based on the Online help "The ABAP statements used for list processing are not yet fully available in ABAP Objects".
    Is there any chnage planned about this for the next WAS release?
    Thanks,
    Peter

    Hi Peter
    I believe, most of the measures taken are for some compatibility and performance issues. So, there is no need to expect great changes about this.
    *--Serdar

  • Throw statement equivalent in ABAP Objects

    Hi All,
    I am trying to raise an exception and use a throw statement after catch inside try endtry in ABAP objects. Later i understood that there is no throw statement defined in ABAP objects. Could anyone help me out to understand the equivalent throw statement in ABAP and how to use in raise exception. I am pasting my code below for reference.
    try.
        CATCH Zxx_EXCEPTION into err.
         write:/ err->local_text.
        message err->LOCAL_TEXT type 'I'.
         if err->local_text = ZIF_XXXX~BUSOBJLOCKED.
          throw CX_AI_APPLICATION_FAULT.
    endtry.
    Thanks
    Deno

    Hello Deno
    The TRY/CATCH logic of ABAP-OO is pretty much the same like in Java. Instead of throwing exception we have to raise them.
    Method execute somewhere raise an exception of class zcx_myexception.
    method execute.
      if ( condition = abap_true ).
      else.
        RAISE EXCEPTION TYPE zcx_myexception
          EXPORTING
            textid = ...
            <parameter> = ...
      endif.
    endmethod.
    TRY.
      call method go->execute( ).
      CATCH zcx_myexception INTO lo_error.
    * Do error handling
    ENDTRY.
    If the method that calls go->execute does not surround the method call by TRY/CATCH then it must define the exception class in its interface and, thereby, propagate the exception to the next higher level calling method.
    Regards
      Uwe

  • FAQ's, intros and memorable discussions in the ABAP Objects Forum

    Welcome to the SDN ABAP Objects Forum!
    In addition to release dependent information avalaible by:
    - pressing the F1 key on an ABAP statement,
    - or searching for them in transaction ABAPDOCU,
    - using the [SDN ABAP Development Forum Search|https://www.sdn.sap.com/irj/sdn/directforumsearch?threadid=&q=&objid=c42&daterange=all&numresults=15&rankby=10001],
    - the information accessible via the [SDN ABAP Main Wiki|https://wiki.sdn.sap.com/wiki/display/ABAP],
    - the [SAP Service Marketplace|http://service.sap.com] and see [SAP Note 192194|https://service.sap.com/sap/support/notes/192194] for search tips,
    - the 3 part [How to write guru ABAP code series|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f2dac69e-0e01-0010-e2b6-81c1e8e5ce50] ... (use the search to easily find the other 2 documents...)
    ... this "sticky post" lists some threads from the ABAP forums as:
    - An introduction for new members / visitors on topics discussed in threads,
    - An introduction to how the forums are used and the quality expected,
    - A collection of some threads which provided usefull answers to questions which are frequently asked, and,
    - A collection of some memorable threads if you feel like reading some ABAP related material.
    The listed threads will be enhanced from time to time. Please feel welcome to post to [this thread|Suggestions thread for ABAP FAQ sticky; to suggest any additional inclusions.
    Note: When asking a question in the forum, please also provide sufficient information such that the question can be answered usefully, do not repeat interview-type questions, and once closed please indicate which solution was usefull - to help others who search for it.
    ABAP Objects
    About polymorphism - still not sure after searching... => Polymorphism adaptation with referencing the source, and a Guest who did not...

    Obsolete ABAP Statements from 2004s - what about your existing code-base?  A great discussion about the changes in syntax checking between 46c and basis release 7.0.

  • ABAP Objects and Upgrade

    Hi,
    I would like to discuss pro and cons of using ABAP Objects for custom development related to upgrades. For example, it seems to be an advantage to encapsulate standard functionality. Through encapsulation the calling programs do not have to care about whether or not the underlying functionality has been changed. Reuse makes it possible to adapt affected areas centrally without having to make changes in various places. However, I saw a thread in this forum regarding older ABAP Objects programming which was obsolete after an upgrade. Even if it seems good that obsolete statements are detected and can be exchanged, it is additional upgrade work which would have been avoided if the code had not been written in ABAP Objects.
    Please share you pros and cons regarding this subject.
    Thanks!

    J@Y - it's a good link to an interesting discussion.  But it's 5 years old...  ABAP Objects has moved on since then.  ( Also, (moderator hat on) please refrain from just posting links without at least giving an indication of what the links are about ).
    To the original poster.  I think it is VERY unlikely that statements that are allowed now in an OO environment will be disallowed in future.  I've been working in Objects since 46C, and have been careful to observe the warnings, and also quick to adopt the new syntax and reject the obsolete (even before it became necessary).  The only remedial work I've had to do in ten years, is on a few classes, where the constructor wasn't calling the super constructor.  And that was easily identified and remedied.
    My experience has been, in those last ten years, that properly written object oriented code leads to developments that are much easier and quicker to maintain - and therefore, a lot cheaper.  And that's the bottom line.
    matt

  • Obsolete statement

    Hi friends,
    I have used the statement:
    "ON CHANGE OF........ENDON." in my program.
    during extended check in program.... this satement is showing as obsolete statement error.
    The error is as follows:
    " The current ABAP command is obsolete and problematic, especially so in ABAP
    Objects
    "ON CHANGE OF ... ENDON" is not supported in the OO context."
    Can you give any way to get rid of this? What can i use instead of this statement?
    As this is very necessary in my program. I am not finding any solution.
    Please help me out....
    Thanks,
    Chinmay

    on change of is obsolete statement so u r getting this message,
    use at new to get rid of this.
    or else if at new doesnot solve ur problem,
    see the following
    The pseudo control structure ON CHANGE OF - ENDON is not allowed in ABAP Objects.
    Error message in ABAP Objects if the following syntax is used:
    ON CHANGE OF f.
    ENDON.
    Correct syntax:
    DATA g LIKE f.
    IF f <> g.
      g = f.
    ENDIF.
    Reason:
    A global invisible work field over which the program has no control is created internally. A separate work field should be declared and processed using the IF control structure.

  • REG: Obsolete statements in SLIN ecc 5.0

    Hi all,
    When i am executing the ABAP EPC for obsolete statements.(with Also display Hidden Messages)
    I get the 2 Obsolete statements and as following :
          Program:  ZXXXXX     Row:    652                                                                               
    The current ABAP command is obsolete and problematic, especially so in ABAP                                                        
    Objects                                                                               
    An explicit work area is necessary in the OO context. Use "APPEND wa TO S_WERKS                                                    
    [SORTED BY]".                                                                               
    (The message can be hidden with "#EC *)                                                                               
    Program:  ZXXXXX     Row:   2558                                                                               
    The current ABAP command is obsolete and problematic, especially so in ABAP                                                        
    Objects                                                                               
    At "LOOP AT itab", one of the additions "INTO", "ASSIGNING", or "TRANSPORTING NO                                                   
    FIELDS" is required. in the OO context.                                                                               
    (The message can be hidden with "#EC *)                                                                               
    Though i put the  "#EC after above variable still i can see it in the SLIN overview.
    Pls help me to hide these Obsolete statements.
    Thanks and Regards
    Srikanth.P

    Lest you find yourself labelled as "out of date" or "obsolete", perhaps you could spend a little time to bring your coding practices up to the state of the product.  A LOT of things used in ABAP within my 12 years are now obsolete.  For instance, the "Official ABAP Programming Guidelines" by SAP Press, written by Drs. Thummel and Keller, describes FORM....ENDFORM and REFRESH as obsolete.
    In current versions, we loop at ...assgining <Field-symbol> or into structure.... 
    We do read table into structure or assigning <field-symbol> or (where possible) transporting no fields.
    We don't have tables with header rows, since those can't be used in OO.
    We don't use REFRESH, we use CLEAR tabname[].
    In OO, we use the SoC, software layering concepts, with GUI, Application and Persistence level Class definitions and implementations.
    We used class-based exception handling where possible to avoid abends which are, of course, detrimental to our users' experiences.
    etc.

  • Hi removing the obsolete statements.....

    Hi all
    when i am running the EPC i am gettting obsolete statements for these statements
    here is the code where it was showing the obsolete status
    can any body help me in correcting this:
    FORM alv_init_report_events TABLES ot_events TYPE slis_t_event.
      CLEAR   ot_events.
      REFRESH ot_events.
      ot_events-name = slis_ev_user_command.
      ot_events-form = 'USER_COMMAND'.
      APPEND ot_events.
      ot_events-name = slis_ev_pf_status_set.
      ot_events-form = ''.                 "'PF_STATUS_SET'.
      APPEND ot_events.
      ot_events-name = slis_ev_top_of_list.
      ot_events-form = 'TOP_OF_LIST'.
      APPEND ot_events.
      ot_events-name = slis_ev_end_of_list.
      ot_events-form = 'END_OF_LIST'.
      APPEND ot_events.
      ot_events-name = slis_ev_top_of_page.
      ot_events-form = 'TOP_OF_PAGE'.
      APPEND ot_events.
      ot_events-name = slis_ev_end_of_page.
      ot_events-form = 'END_OF_PAGE'.
      APPEND ot_events.
      ot_events-name = slis_ev_foreign_top_of_page.
      ot_events-form = ''.
      APPEND ot_events.
      ot_events-name = slis_ev_foreign_end_of_page.
      ot_events-form = ''.
      APPEND ot_events.
      ot_events-name = slis_ev_top_of_coverpage.
      ot_events-form = ''.
      APPEND ot_events.
      ot_events-name = slis_ev_end_of_coverpage.
      ot_events-form = ''.
      APPEND ot_events.
      ot_events-name = slis_ev_before_line_output.
      ot_events-form = 'BEFORE_LINE_OUTPUT'.
      APPEND ot_events.
      ot_events-name = slis_ev_after_line_output.
      ot_events-form = ''.
      APPEND ot_events.
      ot_events-name = slis_ev_caller_exit_at_start.
      ot_events-form = ''.
      APPEND ot_events.
      ot_events-name = slis_ev_list_modify.
      ot_events-form = ''.
      APPEND ot_events.
      ot_events-name = slis_ev_subtotal_text.
      ot_events-form = ''.
      APPEND ot_events.
    ENDFORM.                    "ALV_INIT_REPORT_EVENTS
    i am getting this error
    The current ABAP command is obsolete and problematic, especially so in ABAP
    Objects
    An explicit work area is necessary in the OO context. Use "APPEND wa TO OT_EVENTS
    [SORTED BY]".
    (The message can be hidden with "#EC *)
          Program:  ZF_NOTA_FISCAL_REPORT_BRZL  Row:   1242
    The current ABAP command is obsolete and problematic, especially so in ABAP
    Objects
    An explicit work area is necessary in the OO context. Use "APPEND wa TO OT_EVENTS
    [SORTED BY]".
    (The message can be hidden with "#EC *)

    Hi,
    declare ot_events as below
    Data: ot_event type table of slis_alv_event,
             wa_event type slis_alv_event.
    CLEAR wa_events.
    REFRESH wa_events.
    wa_events-name = slis_ev_user_command.
    wa_events-form = 'USER_COMMAND'.
    APPEND wa_events to ot_events.
    <b>Reward Points if this helps,</b>
    Satish

  • List the used ABAP objects

    Hi all,
    I'm looking for a standard tool to list the used ABAP objects (Reports, Include, Function Group, CLASSes) in a time
    frame of one year or at least since the start-up.
    My goal is the identification of the obsolete custom developments to dismiss it.
    I have found the transaction SCOV but the goal of this transaction is the estimation of the code
    coverage during the test.
    Anyone can help me?
    Thanks in advantage

    This kind of data is stored in table MONI - Monitor table MONI (summarized cluster table!) and in some files of the application server (in the OS behind SAP)
    - Transaction STAT or ST03n use data stored in these tables
    - Some FM like [SAPWL_SERVLIST_GET_LIST|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=sapwl_servlist_get_list&adv=false&sortby=cm_rnd_rankvalue] and  [SAPWL_WORKLOAD_GET_STATISTIC|https://www.sdn.sap.com/irj/scn/advancedsearch?query=sapwl_workload_get_statistic&cat=sdn_all] may be used to get the data from each application server
    (click on the links to get more information and samples on how to use these FM)
    Regards

  • Logical Database in Abap Objects

    Hi to All
    I want do it a program report using a Logical Database.
    Is this possible ??? But when I make a GET <node>, occurs the following error:
             "" Statement "ENDMETHOD" missing.  ""
    I'm doing the following:
    CLASS MONFIN IMPLEMENTATION.
           METHOD TRAER_DATOS.
                   GET VBRK.
           ENDMETHOD.
    ENDCLASS.
    Please, somebody tell me how I use the logical database in Abap Objects.
    Thank you very much
    Regards
    Dario R.

    Hi there
    Logical databases whilst of "some use" are not really part of OO.
    If you want to use a logical database in an abap OO program I would create a special class which just does the get data from your DB and pass this either at record or table level.
    Techniques such as GET XXXX LATE aren't really part of any OO type of application since at Object Instantiation time you should be able to access ALL the attributes of that object.
    As far as OO is concerned Logical databases are a throwback to "Dinosaur Technology".
    Since however modules such as SD and FI are still heavily reliant on relational structures (i.e linked tables etc)  then there is still some limited life in this stuff but for OO try and solve it by another method.
    If you really must use this stuff in OO then do it via a FMOD call and save the data in a table which your method will pass back to your application program.
    You can't issue a GET command directly in a method.
    Cheers
    Jimbo

  • Adding leading zeros in abap objects.

    Can anyone explain me
    1. How to add leading zeros to a field in abap objects.
    For eg:
    data: dmb(6) type c value '123456',
    actually the output value of c should have leading zeros added to it for length 16.
    i.e '0000000000123456' . If the length of dmb is less than 16 then leading zeros should be added to that value to make it 16 as length.
    Please tell me how to do it in ABAP Objects.

    Hi Camila
    Try to use the statement
    DATA: ALPHABET(15) VALUE '     ABCDEFGHIJ',
          M1(4)        VALUE 'ABCD',
          M2(6)        VALUE 'BJJCA '.
    SHIFT ALPHABET LEFT DELETING LEADING M1.
    The field
    ALPHABET
    remains unchanged.
    SHIFT ALPHABET LEFT DELETING LEADING SPACE.
    The field ALPHABET now has the following contents:
    'ABCDEFGHIJ     '.
    SHIFT ALPHABET RIGHT DELETING TRAILING M2.
    <b>ALPHABET</b> now has the following contents:
    '      ABCDEFGHI'.
    <u><b>IN CHARACTER MODE</b></u>
    <b>Effect</b>
    This is the default setting (see above), and the addition is therefore optional.
    <b>Note
    Performance:</b>
    For performance reasons, you should avoid using SHIFT in WHILE loops.
    The runtime required to shift a field with length 10 by one character to the right or left requires about 5 msn (standardized microseconds). A cyclical shift requires around 7 msn. The runtime for the ...
    LEFT DELETING LEADING
    ... variant is around 3.5 msn, for ...
    RIGHT DELETING TRAILING
    ... around 4.5 msn.
    Reward all helpfull answers
    Regards
    Pavan

  • Exception 'error_message' in ABAP Objects

    I've got a heterogeneous scenario with new program parts in ABAP objects and older parts in classical ABAP.
    In the older parts some R/3 standard functions are called which dump dialog messages which are not allowed at that state of the program flow ('on commit').
    The simple solution in classical ABAP was to use standard exception 'error_message' in the top level 'call function' statement thus catch all dialog messages in lower levels.
    I am looking for an analog solution in object oriented ABAP. But exception 'error_message' is not allowed with 'call method'. It cannot be defined statically in the methods declaration. And the system exception caused by the dialog error message is not included in the set of catchable system errors.
    I would be grateful for any hints concerning this problem.

    Hi
    Excuse me! But I didn't want to sent you my answer.
    Anyway:
    CLASS lcl_my_class DEFINITION.
      PUBLIC SECTION.
        METHODS my_method
                  EXPORTING
                    EXCEPTION TYPE CHAR1
                  EXCEPTIONS error_messages.
    ENDCLASS.                    "LCL_MY_CLASS DEFINITION
    CLASS lcl_my_class IMPLEMENTATION.
      METHOD my_method.
        IF EXCEPTION = 'X'.
          MESSAGE e208(00) WITH 'Message error'
                      RAISING error_messages.
        ELSE.
          MESSAGE I208(00) WITH 'OK!'.
        ENDIF.
      ENDMETHOD.                    "MY_METHOD
    ENDCLASS.                    "LCL_MY_CLASS IMPLEMENTATION
    So you did want to do a call like this:
    CALL METHOD lcl_my_class=>my_method
       EXCEPTIONS
         error_messages = 1
         error_message  = 2
         OTHERS         = 3.
    No! you can't do it, but you try to insert your call in fm where you use ERROR_MESSAGE addition. I think you can do it if your methods are std.
    Max
    Message was edited by: max bianchi

  • Re : select-options in abap objects

    Dear friends,
    I want to give select-options in abap-objects program. How to give that.
    Thanking You
    with regards,
    Mani

    HI Mani,
    It's common mix ABAP Procedural with ABAP Objects in the same program.
    You should use the same way used in ABAP procedural program as Marco Cerdelli sad.
    But inside ABAP OBJECTS classes you can't use is these statement type.
    Don't forget to close this thread and all yours previous when your question be answered ! In case of doubt read the [rules of engagement|https://forums.sdn.sap.com/].
    Best Regards.
    Marcelo Ramos

  • Wa in ABAP Objects

    Hello!
    How can I write wa in ABAP Objects?
    CLASS money DEFINITION.
      PUBLIC SECTION.
        CLASS-DATA: wa TYPE zaa_sflight,
        wa1 TYPE TABLE OF wa.
        CLASS-METHODS zmoney.
    ENDCLASS.
    The program says, wa is unknown. How can I write it correct?
    Thanks!!

    Hi Andrei Algaier,
        This is because wa is not defined as datatype in datadictionary or in program with types statement.
    example:
    types : wa type c.
    data : xyz type wa.
    xyz will be of type c.
    This might be helpful.
    Regards,
    Kalyan.

Maybe you are looking for