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

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

  • 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

  • What is the equivalent for 'On Change of' Event in ABAP OBJECTS?

    What is the equivalent for 'On Change of' Event in ABAP OBJECTS?  and how to use it in LOOP control?

    hi,
    There is no such Equivalent in OO ABAP.
    You have to Raise your own Event within tha class checking the value of the field whose value is changing.
    Regards
    Sumit Agarwal

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

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

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

  • Abap Objects doubts.

    Hi Experts.
    Plz give me some details for the following questions.
    1. what is abstract class.
    2. give me some example program using inheritance.
    3. Some sample programs using events.
    4. Narrow casting & wide casting.. And describe the use of it.
    5. How to declare internal table in ABAP OOPS.
    6. What is the use of table type.?
    7. What is instance.?
    8. Explain friend class.
    Thank in advance.
    Points will be given for the answers.
    regards,
    J.Joe

    HI
    <b>1. what is abstract class.</b>
    Abstract classes are normally used as an incomplete blueprint for concrete (that is, non-abstract) subclasses, for example to define a uniform interface.
    Classes with at least one abstract method are themselves abstract.
    Static methods and constructors cannot be abstract.
    You can specify the class of the instance to be created explicitly: CREATE OBJECT <RefToAbstractClass> TYPE <NonAbstractSubclassName>.
    Abstarct classes themselves can’t be instantiated ( althrough their subclasses can)
    Reference to abstract classes can refer to instance of subclass
    Abstract (instance) methods are difined in the class , but not implemented
    They must be redefined in subclasses
    CLASS LC1 DEFINAITION ABSTARCT
    PUBLIC SECTION
    METHODS ESTIMATE ABSTARCT IMPORTING…
    ENDCLASS.
    <b>2. give me some example program using inheritance.</b>
    The following simple example shows the principle of inheritance within ABAP Objects. It is based on the Simple Introduction to Classes. A new class counter_ten inherits from the existing class counter.
    REPORT demo_inheritance.
    CLASS counter DEFINITION.
      PUBLIC SECTION.
        METHODS: set IMPORTING value(set_value) TYPE i,
                 increment,
                 get EXPORTING value(get_value) TYPE i.
       PROTECTED SECTION .
        DATA count TYPE i.
    ENDCLASS.
    CLASS counter IMPLEMENTATION.
      METHOD set.
        count = set_value.
      ENDMETHOD.
      METHOD increment.
        ADD 1 TO count.
      ENDMETHOD.
      METHOD get.
        get_value = count.
      ENDMETHOD.
    ENDCLASS.
    CLASS counter_ten DEFINITION INHERITING FROM counter.
      PUBLIC SECTION.
        METHODS increment REDEFINITION .
        DATA count_ten.
    ENDCLASS.
    CLASS counter_ten IMPLEMENTATION.
      METHOD increment.
        DATA modulo TYPE I.
         CALL METHOD super->increment .
        write / count.
        modulo = count mod 10.
        IF modulo = 0.
          count_ten = count_ten + 1.
          write count_ten.
        ENDIF.
      ENDMETHOD.
    ENDCLASS.
    DATA: count TYPE REF TO counter,
          number TYPE i VALUE 5.
    START-OF-SELECTION.
       CREATE OBJECT count TYPE counter_ten .
      CALL METHOD count->set EXPORTING set_value = number.
      DO 20 TIMES.
        CALL METHOD count->increment.
      ENDDO.
    The class COUNTER_TEN is derived from COUNTER. It redefines the method INCREMENT. To do this, you must change the visibility of the COUNT attribute from PRIVATE to PROTECTED. The redefined method calls the obscured method of the superclass using the pseudoreference SUPER->. The redefined method is a specialization of the inherited method.
    The example instantiates the subclass. The reference variable pointing to it has the type of the superclass. When the INCREMENT method is called using the superclass reference, the system executes the redefined method from the subclass.
    <b>3. Some sample programs using events.</b>
    Events in ABAP Objects - Example
    The following example shows how to declare, call, and handle events in ABAP Objects.
    Overview
    This object works with the interactive list displayed below. Each user interaction triggers an event in ABAP Objects. The list and its data is created in the class C_LIST. There is a class STATUS for processing user actions. It triggers an event BUTTON_CLICKED in the AT USER-COMMAND event. The event is handled in the class C_LIST. It contains an object of the class C_SHIP or C_TRUCK for each line of the list. Both of these classes implement the interface I_VEHICLE. Whenever the speed of one of these objects changes, the event SPEED_CHANGE is triggered. The class C_LIST reacts to this and updates the list.
    Constraints
    The ABAP statements used for list processing are not yet fully available in ABAP Objects. However, to produce a simple test output, you can use the following statements:
    WRITE [AT] /<offset>(<length>) <f>
    ULINE
    SKIP
    NEW-LINE
    Note: The behavior of formatting and interactive list functions in their current state are not guaranteed. Incompatible changes could occur in a future release.
    Declarations
    This example is implemented using local interfaces and classes. Below are the declarations of the interfaces and classes:
    Interface and Class declarations
    INTERFACE I_VEHICLE.
      DATA     MAX_SPEED TYPE I.
      EVENTS SPEED_CHANGE EXPORTING VALUE(NEW_SPEED) TYPE I.
      METHODS: DRIVE,
               STOP.
    ENDINTERFACE.
    CLASS C_SHIP DEFINITION.
      PUBLIC SECTION.
      METHODS CONSTRUCTOR.
      INTERFACES I_VEHICLE.
      PRIVATE SECTION.
      ALIASES MAX FOR I_VEHICLE~MAX_SPEED.
      DATA SHIP_SPEED TYPE I.
    ENDCLASS.
    CLASS C_TRUCK DEFINITION.
      PUBLIC SECTION.
      METHODS CONSTRUCTOR.
      INTERFACES I_VEHICLE.
      PRIVATE SECTION.
      ALIASES MAX FOR I_VEHICLE~MAX_SPEED.
      DATA TRUCK_SPEED TYPE I.
    ENDCLASS.
    CLASS STATUS DEFINITION.
      PUBLIC SECTION.
       CLASS-EVENTS BUTTON_CLICKED EXPORTING VALUE(FCODE) LIKE SY-UCOMM.
      CLASS-METHODS: CLASS_CONSTRUCTOR,
                    USER_ACTION.
    ENDCLASS.
    CLASS C_LIST DEFINITION.
      PUBLIC SECTION.
      METHODS: FCODE_HANDLER FOR EVENT BUTTON_CLICKED OF STATUS
                                 IMPORTING FCODE,
               LIST_CHANGE   FOR EVENT SPEED_CHANGE OF I_VEHICLE
                                 IMPORTING NEW_SPEED,
               LIST_OUTPUT.
      PRIVATE SECTION.
      DATA: ID TYPE I,
            REF_SHIP  TYPE REF TO C_SHIP,
            REF_TRUCK TYPE REF TO C_TRUCK,
            BEGIN OF LINE,
              ID TYPE I,
              FLAG,
              IREF  TYPE REF TO I_VEHICLE,
              SPEED TYPE I,
            END OF LINE,
            LIST LIKE SORTED TABLE OF LINE WITH UNIQUE KEY ID.
    ENDCLASS.
    The following events are declared in the example:
    The instance event SPEED_CHANGE in the interface I_VEHICLE
    The static event BUTTON_CLICKED in the class STATUS.
    The class C_LIST contains event handler methods for both events.
    Note that the class STATUS does not have any attributes, and therefore only works with static methods and events.
    Implementations
    Below are the implementations of the methods of the above classes:
    Implementations
    CLASS C_SHIP IMPLEMENTATION.
      METHOD CONSTRUCTOR.
        MAX = 30.
      ENDMETHOD.
      METHOD I_VEHICLE~DRIVE.
        CHECK SHIP_SPEED < MAX.
        SHIP_SPEED = SHIP_SPEED + 10.
        RAISE EVENT I_VEHICLE~SPEED_CHANGE
                    EXPORTING NEW_SPEED = SHIP_SPEED.
      ENDMETHOD.
      METHOD I_VEHICLE~STOP.
        CHECK SHIP_SPEED > 0.
        SHIP_SPEED = 0.
        RAISE EVENT I_VEHICLE~SPEED_CHANGE
                    EXPORTING NEW_SPEED = SHIP_SPEED.
      ENDMETHOD.
    ENDCLASS.
    CLASS C_TRUCK IMPLEMENTATION.
      METHOD CONSTRUCTOR.
        MAX = 150.
      ENDMETHOD.
      METHOD I_VEHICLE~DRIVE.
        CHECK TRUCK_SPEED < MAX.
        TRUCK_SPEED = TRUCK_SPEED + 50.
        RAISE EVENT I_VEHICLE~SPEED_CHANGE
                    EXPORTING NEW_SPEED = TRUCK_SPEED.
      ENDMETHOD.
      METHOD I_VEHICLE~STOP.
        CHECK TRUCK_SPEED > 0.
        TRUCK_SPEED = 0.
        RAISE EVENT I_VEHICLE~SPEED_CHANGE
                    EXPORTING NEW_SPEED = TRUCK_SPEED.
      ENDMETHOD.
    ENDCLASS.
    CLASS STATUS IMPLEMENTATION.
      METHOD CLASS_CONSTRUCTOR.
        SET PF-STATUS 'VEHICLE'.
        WRITE 'Click a button!'.
      ENDMETHOD.
      METHOD USER_ACTION.
        RAISE EVENT BUTTON_CLICKED EXPORTING FCODE = SY-UCOMM.
      ENDMETHOD.
    ENDCLASS.
    CLASS C_LIST IMPLEMENTATION.
      METHOD FCODE_HANDLER .
        CLEAR LINE.
        CASE FCODE.
          WHEN 'CREA_SHIP'.
            ID = ID + 1.
            CREATE OBJECT REF_SHIP.
            LINE-ID = ID.
            LINE-FLAG = 'C'.
            LINE-IREF = REF_SHIP.
            APPEND LINE TO LIST.
          WHEN 'CREA_TRUCK'.
            ID = ID + 1.
            CREATE OBJECT REF_TRUCK.
            LINE-ID = ID.
            LINE-FLAG = 'T'.
            LINE-IREF = REF_TRUCK.
            APPEND LINE TO LIST.
          WHEN 'DRIVE'.
            CHECK SY-LILLI > 0.
            READ TABLE LIST INDEX SY-LILLI INTO LINE.
            CALL METHOD LINE-IREF->DRIVE.
          WHEN 'STOP'.
            LOOP AT LIST INTO LINE.
              CALL METHOD LINE-IREF->STOP.
            ENDLOOP.
          WHEN 'CANCEL'.
            LEAVE PROGRAM.
        ENDCASE.
        CALL METHOD LIST_OUTPUT.
      ENDMETHOD.
      METHOD LIST_CHANGE .
        LINE-SPEED = NEW_SPEED.
        MODIFY TABLE LIST FROM LINE.
      ENDMETHOD.
      METHOD LIST_OUTPUT.
        SY-LSIND = 0.
        SET TITLEBAR 'TIT'.
        LOOP AT LIST INTO LINE.
          IF LINE-FLAG = 'C'.
            WRITE / ICON_WS_SHIP AS ICON.
          ELSEIF LINE-FLAG = 'T'.
            WRITE / ICON_WS_TRUCK AS ICON.
          ENDIF.
          WRITE: 'Speed = ', LINE-SPEED.
        ENDLOOP.
      ENDMETHOD.
    ENDCLASS.
    The static method USER_ACTION of the class STATUS triggers the static event BUTTON_CLICKED. The instance methods I_VEHICLEDRIVE and I_VEHICLESTOP trigger the instance event I_VEHICLE~SPEED_CHANGE in the classes C_SHIP and C_TRUCK.
    Using the Classes in a Program
    The following program uses the above classes:
    REPORT OO_EVENTS_DEMO NO STANDARD PAGE HEADING.
    Global data of program
    DATA LIST TYPE REF TO C_LIST.
    Program events
    START-OF-SELECTION.
      CREATE OBJECT LIST.
      SET HANDLER: LIST->FCODE_HANDLER,
                  LIST->LIST_CHANGE FOR ALL INSTANCES.
    AT USER-COMMAND.
      CALL METHOD STATUS=>USER_ACTION.
    The program creates an object of the class C_LIST and registers the event handler method FCODE_HANDLER of the object for the class event BUTTON_CLICKED, and the event handler method LIST_CHANGE for the event SPEED_CHANGE of all instances that implement the interface I_VEHICLE.
    <b>4. Narrow casting & wide casting.. And describe the use of it.</b>
    <b>Narrowing Cast</b>
    The assignment of a subclass instance to a reference variable of the type "reference to superclass" is described as a narrowing cast, because you are switching from a more detailed view to a one with less detail.
    Description up-cast is also used.
    <b>use</b>
    A user who is not interested in the finer points of cars, trucks, and busses (but only, for example, in the fuel consumption and tank gauge) does not need to know about them. This user only wants and needs to work with (references to) the lcl_vehicle class. However, in order to allow the user to work with cars, busses, or trucks, you generally need a narrowing cast.
    <b>Widening cast</b>
    The widening cast logically represents the opposite of the narrowing cast. The widening cast cannot be checked statically, only at runtime. The Cast Operator ?= (or the equivalent MOVE ... ?TO … ) must be used to make this visible.
    It changes from a less detailed view to one with more detail.
    <b>use</b>
    The client, the car rental company  wants to execute a function for specific vehicles form the list (vehicle_list).  For example, the client wants to ascertain the truck with the largest cargo capacity.  However, not all vehicles are in the trucks list, it also includes references to cars and busses.
    <b>5. How to declare internal table in ABAP OOPS.</b>
    BEGIN OF LINE,
              ID TYPE I,
              FLAG,
              IREF  TYPE REF TO I_VEHICLE,
              SPEED TYPE I,
            END OF LINE,
    <b>6. What is the use of table type.?</b>
    Please check the SAP help , as all these things are provided in detail in it .
    In case you find it difficult to find it or search for it here is the link
    http://help.sap.com/saphelp_nw04/helpdata/en/90/8d7304b1af11d194f600a0c929b3c3/frameset.htm
    <b>7. What is instance.?</b>
    Instance methods are called using CALL METHOD <reference>-><instance_method>.
    Static methods (also referred to as class methods) are called using CALL METHOD <classname>=><class_method>.
    If you are calling a static method from within the class, you can omit the class name.
    You access instance attributes using <instance>-><instance_attribute>
    <b>8. Explain friend class.</b>
    In rare cases, classes have to work together so closely that they need access to their protected and private components. To avoid making these components available to all users, there is the concept of friendship between classes.
    To do this you use the FRIENDS additions to the CLASS statement, in which all classes and interfaces that are to be provided friendship are listed
    In principle, providing friendship is one-sided: A class providing friendship is not automatically a friend of its friends. If a class providing friendship wants to access the non-public components of a friend, this friend has to explicitly provide friendship to it.
    Classes that inherit from friends and interfaces that contain a friend as a component interface also become friends. However, providing friendship, unlike the attribute of being a friend, is not inherited. A friend of a superclass is therefore not automatically a friend of its subclasses.
    <b>Reward if usefull</b>

  • 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.

  • ABAP Objects template for HR programs

    Is there a template to use Objects in HR programs the way we had with HR-macros ? It used to be like this when using PNP LDB:
    <b>INITIALIZATION</b>
    <i><initialize buffer></i>
    <b>START-OF-SELECTION</b>
    <i><initial setup></i>
    <b>GET PERNR
    rp-provide-from-last <i><pNNNN></i> space low_date high_date.</b>
    <i><store in an internal table></i>
    <b>...
    END-OF-SELECTION</b>
    <i><process the internal table></i>
    Is there an ABAP Objects equivalent of calling standard FM/macros in HR? What are the most usefull Classes to process HR employee master data (ie. IT0000-IT0999) ? Any usefull refrences/links will be helpful.
    Thanks.

    Hi,
    This is still the approved method so stick with this.
    It works perfectly ok so there is no view to changing it.
    Cheers
    Colin

  • Begin-of-transaction in ABAP Objects

    Hi,
    I have a question regarding the (implicit or explicit) begin of a transaction (read: SAP LUW) in ABAP Objects. In this piece of code
    CREATE OBJECT mapping.
    TRY.
      mapping->delete_all_embraced_mappings( ).
      mapping->merge_with_begda_overlap( ).
      mapping->merge_with_endda_overlap( ).
      mapping->store( ).
      COMMIT WORK.
    CATCH /my/mapping_exception.
      ROLLBACK WORK.
    ENDTRY. 
    I need a all-or-nohting logic, i.e. I'd like all the methods <i>delete..(), merge..()</i> and <i>store()</i> to run in a single transaction. If any of the methods throws a <i>/my/mapping_exception</i> I want all DB changes (carried out in the methods) rolled back.
    Now, how can a mark the <b>begin-of-transaction</b> (the counterpart of the commit work)? I couldn't find information about this in the docu or in the SDN. To prevent misunderstandings: I am building a web application with ABAP Objects, so no dialog steps, PBO-PAIs, function modules, performs etc. are involved!
    Regards,
    Sebastian Kamp

    Maybe by using
    SET UPDATE TASK LOCAL
    I think this command acts as a BeginOfTransaction command, it especifies that, till the next CommitWork, all the process has to be done as part of a Transaction.
    You could try something like this:
      TRY
          SET UPDATE TASK LOCAL
          <YOUR_PROCESS_HERE>
          COMMIT WORK
       CATCH
       ENDTRY
    Hope it helps.

  • 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.

Maybe you are looking for

  • Mini display to VGA weirdness - need help connecting to CRT

    Hello, I am new here and recently purchased a Mac Mini (2011, 2.3 Mhz i5 model). I am probably in the vast minority as far as monitor choices go, as I am using a NEC FE2111SB CRT monitor. 20" viewable, looks good or better than most LCDs, so I see no

  • Sort Albums Doesn't Work

    I have a bunch of albums in iPhoto that I am trying to sort, and it just doesn't work. When I select them, right-click, and choose "Sort Albums" from the context menu, either *nothing* happens, or else the order of the albums is altered in some seemi

  • Special G/L for guarantees

    Hi, Somebody worked with special GL for guarantees in customer? Creating in SD invoice? How Can I configured it? Thanks

  • Export data to pdf file in ALBPM ?

    Hi, Can anyone tell me how to export all my data that are rendered in a jsp file to a PDF file in ALBPM i.e I want all my data that are there in jsp page, onclick of a button all those data will be printed/posted on a pdf file with a specified file n

  • How not to get back on the page i just closed when opening a new session

    How not to get back on the page i just closed when opening a new session? I do have a live stream radio on now... Therefor new session might not be the complete truth. Gerard