BOR vs. CLASS

Hi to everybody,
I'm developping an application to manage authorization requests.
I began it using BOR, for the reason that i'll manage different status creating them by SAP Workflow.
When I started with the application, we use the BOR FORMABSENC like an example, but while I were developping I found out several problems and I decided to create it with CLASS and SAP Work.
I would like to know what's the difference between BOR or Class, which of both options you recommend  me and why you've decided on it.
I´m looking forward to a response soon.
Thank you.
Nicocer.

hello,
It is always good to adapt to object oriented approach for all sort of ABAP development. Using BOR is the conventional style of build. You will have better control on the program flow and design using OOABAP. Read some demo chapters available on internet of SAP press book "official abap programming guidelines" for your answer.
Thanks

Similar Messages

  • BOR or CLASS for Document Management Service (not SAP DMS for PLM)

    Hi All,
    Does anyone know if there is already a BOR or CLASS that can be used in Workflow that works with the Document Management Service?  This is in reference to the diagram displayed in the following link
    http://help.sap.com/saphelp_crm40/helpdata/en/15/aea9375d79fb7de10000009b38f8cf/content.htm.
    I assume that there must be a BOR or CLASS that uses DMS that I can use with workflow.
    Thanks.
    Regards,
    Mel Calucin
    Bentley SAP Portal Architect

    no idea?

  • BOR to Classes conversion

    As BOR is being phased out is anyone aware of any tools around to convert some useful BOR's to Classes.
    I think in general in workflow one should try and use classes and objects wherever possible rather than the older BOR method.
    A lot of supplied SAP workflows however are still based on BOR so this area could become a bit of a minefield especially in CRM  and similar type of processing.
    As new projects come on stream I'd be interested to know how people are going to handle this topic.
    Cheers
    jimbo

    This doesn't address the topic. All of the above features can be done via OO classes --you can of course have multi-line objects and "virtual attributes" in a class.
    A problem with BOR is that you can't easily call these from "Classical ABAP" programming so say you want all the partners of a sales order  you normally have to code the functionality  yourself using the relevant tables rather than try and get the attributes of a relevant BOR in your program.
    However once you've  defined say a SALES ORDER class then any ABAP can access the public attributes and methods of  this class .
    With the BOR it's OK via workflow but a "Normal ABAP" program has to do some fancy coding using the "SWO" or workflow macros and functions to access the attributes of the BOR.
    Since these are internal SAP macros and could be deprecated at any time it's really not surprising that outside the Workflow environment BOR's are rarely used in standard ABAP programming.
    BOR was a "stepping stone" used by SAP to implement some of the features of OO abap  before OO abap  became reasonably powerful itself.
    Inheritance, encapsulation etc etc are all standard in OO -- not restricted to BOR's.
    The trick is to ensure your new class has the functionality of the old BOR and use that wherever possible on new projects.
    Like BOR if you extend methods and attributes you don't need to change any existing programs using the relevant classes.
    I'm sure the next major upgrade of sap will implement many more business classes -- the old BOR could be retained by simply calling a Class of the same name having the same attributes and objects for legacy code and workflows.
    For example here's some ABAP code to call a method which returns the Long Text of a Service notification  BOR ZBUS2080 (delagated BOR  BUS2080)
    You can see it's quite a "Dogs Dinner".
    Much more simply and easily done of course if you had a similar CLASS available. (call me=>)  etc.
    Program  ZZREADBOR.
    Sample program to execute a method of a business object
    or return an attribute of a Business object
      can be used in or outside of Workflows etc.
    Use this as a model
    Note on some definitions used in WF / Object
    programming.
    A container is a special type of "generalized"
    parameter used in workflows for passing data
    between steps.
    You can use these in "Normal" programming
    It's just a generalized structure for holding
    data.
    An Attribute in this context means a field e.g Short
    text. The attribute can be a table (multi-lined)
    as well.
    The attribut is defined in the attribute list
    of the business object
    Use transaction SWO1 to see the list.
    Operations on containers are done via
    standard SAP Workflow macros
    swc_function such as swc_create_object.
    You must supply a key to instantiate the object
    and the object name
    (Instantiation means just supplying
    the objects key --such as
    in the case of a sales order the key would be
    the sales order number).
    Parameters
    Enter Business object name e.g ZBUS2080
    key of business object e.g sales doc nr etc.
    Attribute you want if getting an attribute property
    Method name if executing a method.
    For retrieving attributes the data is returned
    in field return.
    For Methods a little extra work is required as follows:
    For Methods you may need extra container
    parameters such as
    tables  (swc_get_tabe container containerElement  Itab)
    To see what elements are needed have a look at the
    Method code (transaction SWO1=== select
    the business object(display) chose the method and then
    select the program button
    container parameters will be identified the code
    by swc_set_element / table  for export parameteres
    swc_get_element / table for import parameters.
    ensure you set your container(s) to persistent
    this ensures the container exists throughout
    the whole run and is available to sub programs
    function modules, methods etc.
    if you don't do this then the container only exists
    in the program and disappears when you enter a function
    module method etc etc.
    Jim Hawthorne       Nov 2005.
    include <cntn01>.    "SWC macros and WF container stuff
    tables: tojtb, swotdv.       "Bus Obj <====> program
    Sample demo executes method getdetail
    which retrieves long text etc from bus object ZBUS2080.
    parameters: p_bus like  tojtb-name default 'ZBUS2080',
                p_key like  swotobjid-objkey default '000300000153',
                p_attrib  like SWOTRA-ATTRIBUTE,
               p_method(32) default 'GETDETAIL'.
    constants: c_attrib value 'A',
                c_method value 'M'.
    data: BEGIN OF RETURN.
      INCLUDE STRUCTURE SWOTRETURN.
    DATA END OF RETURN.
    data: BAPIRETURN LIKE BAPIRETURN.
    data: l_invoke LIKE swotinvoke.
    data: w_prog like tojtb-progname,
          w_runname like tojtb-progname,
          w_super like tojtb-parent,
          w_type(1) type c.
    swc_container container.
    swc_container_to_persistent container.
    data: object like swotrtime-object.
    data: w_object like swotobjid.
    if p_method = ' '.
      w_type = c_method.
    else.
      w_type = c_method.
      endif.
    break-point 1.         .
    w_object-objkey = p_key.
    w_object-objtype = p_bus.
    get actual program name where method / attribute
    exists.
    If verb is not in the object type
    then use the supertype.
    select single progname  parent into (w_prog, w_super)
      from tojtb
      where name eq p_bus.
    select single * from swotdv
            where objtype = p_bus
            and verb = w_type.
    case sy-subrc.
      when 0.
         w_runname = w_prog.
       when 4.
       select single progname  parent into (w_prog, w_super)
      from tojtb
      where name eq w_super.
       w_runname = w_prog.
       endcase.
    case p_method.
    when ' '.
    Method not entered so attribute required.
    CALL FUNCTION 'SWO_PROPERTY_GET'
      EXPORTING
        OBJECT                = w_object
        ATTRIBUTE             = p_attrib
      CHANGING
        VALUE                 =  return.
    EXCEPTIONS
      ERROR_CREATE          = 1
      ERROR_INVOKE          = 2
      ERROR_CONTAINER       = 3
      OTHERS                = 4
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    when others.
    Method required.
    1 ) Must instantiate the object first.
    CALL FUNCTION 'SWO_CREATE'
    EXPORTING
       OBJTYPE                 = p_bus
        OBJKEY                  =   p_key
      IMPORTING
       OBJECT                  = object
       RETURN                  =  return.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Execute the method.
    for swo invoke -- access type 'G' ====> get attribute
                       access type 'C' ====> execute a method
    this function is executed internally.
    in the perform (p_method) statement the sap kernel knows
    that the program is actually a business object type of program
    not a "Normal" abap so the perform gets handled a little
    differently than the usual perform statement.
    You cannot execute the BOR program via SE38.
    set any input and output parameters
    for your method.
    You will have to code them here
    swc_set_element container 'User' p_key.
    l_invoke-object = object.
    l_invoke-lobjtype = p_method.
    l_invoke-verb = p_method.
    l_invoke-objkey = p_key.
    l_invoke-reftype = 'D'.
    l_invoke-synchron = 'X'.
    read comments above again to understand the difference
    in how this statement works compared
    to a normal perfom xxxx in program yyyy.
    if you have more parameters such as container tables then add them
    to the tables statement.
    for example to get long text and other info from business object
    ZBUS2080 (Service Notification)
    data:
          notifheader like bapi2080_nothdre,
          notifhdtext like bapi2080_nothdtxte,
          notlongtext like  bapi2080_notfulltxte occurs 0,
          notitem like bapi2080_notiteme occurs 0,
          notifcaus like bapi2080_notcause occurs 0,
          notifactv like bapi2080_notactve occurs 0,
          notiftask like bapi2080_nottaske occurs 0,
          notifpartnr like bapi2080_notpartnre occurs 0,
          return2 like bapiret2 occurs 0.
      swc_set_table container 'NotLongText' notlongtext.
      swc_set_table container 'NotItem' notitem.
      swc_set_table container 'NotifCaus' notifcaus.
      swc_set_table container 'NotifActv' notifactv.
      swc_set_table container 'NotifTask' notiftask.
      swc_set_table container 'NotifPartnr' notifpartnr.
      swc_set_table container 'Return2' return2.
    perform (p_method) in program (w_runname) tables container
    changing
    l_invoke.
    now retrieve your data back from the method.
    if you have extra parameters add extra swc_get statements.
    break-point 1.
    swc_get_table container 'NotLongText' notlongtext.
    swc_get_table container 'NotItem' notitem.
    swc_get_table container 'NotifCaus' notifcaus.
    swc_get_table container 'NotifActv' notifactv.
    swc_get_table container 'NotifTask' notiftask.
    swc_get_table container 'NotifPartnr' notifpartnr.
    swc_get_table container 'Return' return2.
    field-symbols: <g>.
    loop at notlongtext assigning <g>.
    write: / <g>.
    endloop.
    endcase.
    break-point 3.
    write: / 'done'.
    Cheers
    Jimbo

  • BOR Object and ABAP Class

    Hi,
        Can anybody say when to use BOR object and Abap class in the task with an example.
    Thanks,
    Mugundhan

    There is no any specific condition or rule that for this purpose you need to use BOR and Class , it depends on your requirement. not only the requirement but also the new techniques to make classes not just as simple way to create objects but when you use classes in the Workflows they are not simple classes but they are BUSINESS CLASSES which makes a lot of difference.
    Check the blogs of [Jocelyn Dart|https://www.sdn.sap.com/irj/scn/wiki?path=/pages/viewpage.action%3fpageid=55566]

  • Error in executing workflow.

    Hi All.
    I am executing a workflow task individually for Change document. ( CV02N)
    But after executing workflow if i check in workflow log i am getting following error.
    Error: subdocs could not be aligned (009)
    Could any one advise me why this is happening and what to do...?
    Thanks ,

    I've never had this problem, so here's just an educated guess: Are you changing one part in a multipart document?
    In any case you should provide a lot more information to make it easier for everyone to help. Just a few examples:
    - Is the workflow a SAP standard one, or a custom one?
    - Is the object (BOR or class) a SAP standard one, or a custom one?
    - Do you get this error every time (for all documents) or not?
    - What is your SAP release?

  • Business object /Enhancement/Badi  for Payment proposal (F110S)

    Hello All
    I need to trigger a workflow when payment proposal(F110S) is executed.
    Is there any BO available or is there any Badi/enhancement available where the workflow can be triggered.
    Thanks

    Hello,
    Your best bet would be to search this forum or the web for F110S and hope someone else asked the same question and got an answer. Otherwise, start looking through the list of BORs in SWO1 to look for some likely names.
    It's also possible that you'll have to make your own BOR or Class. It's not that difficult, but it's preferable to go with an existing one.
    Please let this forum know the result of your search for the benfit of future users with the same question.
    regards
    Rick Bakker
    hanabi technology

  • How can i find (Debug - method) the flow of program in workflow at run time

    Hi All,
    I working in Workflow monitoring. When a workflow is set into error in SWPR , i need to analyse the error and report it. In many cases the error happens in the method of class / BOR. So i could not find out the what happens inside the method. I am doing this in an productive environment.i am not given to Run any METHOD or BOR or CLASS ? How can i make my workflow monitoring better to show exact error ?
    Thanks in advance !
    Richard A

    Dear Richard,
    You cannot debug a method by directly setting a break point as we do normally.....u can do this by
    just putting an infinite loop at the point where u want to set the debug point inside the method.
    Execute the workflow where this method is being used.
    Then go to SM50, here you will find your method which has gone into infinite loop.I debug mode change the value of the variable so that it can move ahead of the infinite loop.
    Now you can debug easily and find out where the problem lies.
    Do reply back in case of any query or even if yr problem is resolved.
    Regards,
    Geet

  • Workflow and business process

    hi,
    may i know where (transaction code or table or configuration path) can tell that which business process has workflow activated.
    for example PO me21n, how do we know that me21n has workflow activated or not.
    thanks

    Hello,
    You can also look in SWE2 to see which linkages are active, and which ones could produce workflows if they were activated.
    Making the connection from the BOR or Class back to the transaction is a bit more difficult. You could try executing the transaction (e.g. creating a PR) and then look in SWEL (event trace) to see if any events are created.
    regards
    Rick Bakker / hanabi technology

  • External Program

    Hi Friend,
       How can we access or execute an external  program in  my Workflow ?
    Bye..

    Hi Sk,
    What do you mean by External Program?tell me some details.
    if you meant by calling a module pool or a report or( any transaction)
    in workflow  then it is possible  through calling BOR or Class.
    you can call an Object(BOR) and write your code in the method of that object
    or can write code in a class(se24) and  call the class.
    Thanks & Regards
    Hari Sankar M

  • ALERTS CAGETORY (Probelm)

    Hi,
    I am using this blogs and pretty much I done everying; but I have one question; when I create (Contaner variable its asking me "Object Type Widnow"
    look like:-
    XML Object type
    ABAP class
    BOR Object class
    Not Define
    I selected XML Object type (I am not sure is that right or wrong?)
    + when I goto RWB and add roles AlertInBOX show empty no error but I am getting some alert in my eamil; how to test it
    /people/michal.krawczyk2/blog/2005/09/09/xi-alerts--step-by-step

    Awan
    You have the variables "ABAP Dictionary Data Type". Use this to define container variables as given below
    http://help.sap.com/saphelp_nw04/helpdata/en/d0/d4b54020c6792ae10000000a155106/content.htm

  • BOR Objects in ABAP OO class

    Hi
              I am using a BOR objects, but in one of my activity I am trying to use a Z class. In the method of the Z class I want to get some of the attributes of the BOR class.
    I have followed the same approach ( Defining constant ) as mentioned in the blog by Jocelyn Dart.
    I am able to get the Binding in the workflow but not able to get the attribute value or instantiated object in the method.
    How do I get those attributes or the instance of the BOR object in the method. Am I missing something?
    Thanks
    Dhaval

    Hi
               Well I wanted to achieve something as follows:
    1) The workflow was getting triggered from an Event of the BOR. So the binding was from the event to the workflow
    2) Now the second step in the workflow was a method of a Zclass in the workflow. Somehow I was not getting the key of the BOR to the class so that the class can be instiated. ( Say the PR number or PO number which triggered the event)
    I am able to do it using static attribute of the class to instiate the class. I do know whether the approach is right, but somehow it resolved my issue.
    1) I declared a static attribute in the class.
    2) Defined a container and hold the value in the container from the event object id. ( This holds the PO number which triggered the workflow )
    3) In the binding between the workflow and the task where my class was used, I passed the container to the static attribute of the class.
    4) In the class method  FIND_BY_LPOR, I used the static attirbue instead of LPOR-INSTID to create the object.
    Thanks for you help.
    Regards
    Dhaval

  • BOR Object or ABAP Class

    Hi Experts,
    We are implementing the Leave Request WF using WS12300111. The user raises a leave request from the portal.
    As per the functional point of contact, they have said that this WF can be set up in the configuration in SPRO to be triggered when a leave request is raised.
    When we saw the standard SAP provided WF, the steps in it are based on ABAP class. I just want to know if the approach has to be only using ABAP classes or can BOR objects be used.
    We require some customizations in the sense, we need to add some custom logic to retrieve some data from some custom tables and also display the same.
    Kindly let me know if we need to use ABAP classes or we can use a BOR Object.
    Cheers,
    Belinda Clarke

    Hi Karri,
    Thanks a lot for your response.
    I was actually evaluating the possibilities of the same as our WF consultant is currently on leave. I was just seeing a scenario where they have used BOR Object for Travel and Expenses module. When i saw the standard WF for Leave Request WS12300111, I was seeing mainly ABAP Objects and there was no BOR objects used.
    I just wanted to confirm whether we could create a BOR Object or go on with the ABAP Classes. Does the ABAP Classes involve a lot of effort? We need to actually send email notifications and add some new steps etc...so was just thinking as to which would involve more effort.
    We need to actually retrieve data from table PTREQ_ATTABS and send the email notification to the concerned user whenever the leave request is approved/rejected/cancelled as shown below :
    Your leave request has been approved/rejected
    Name : abcde
    Emp No : 123456
    Type of Leave : Annual Leave
    Date : 7th July to 11th July
    No. of Days : 3 days
    So do u imply that all of this can be done with an ABAP Class
    Could you kindly guide us.

  • Integration of BOR functionality into a ABAP-OO Class

    Hi together,
    we are planning a WebDynpro application in which we are using about ten ABAP-OO classes. The functionality of that classes are using BOR-Objects. Since we are using the M-V-C pattern, we like to create Entities, e.g. "Business Partner" within our model. There is already a BOR "BP" existing. We like to use this BOS-Object for implementing the ABAP-OO Entity Class. By doing it that way, we are sure that the new object will satisfy any SAP compliance.
    Is there a standard way to integrate the functionality of BOR-Objects into an ABAP-OO Class?
    Best regards
        Thomas Wetzler

    Hi,
    have a look how SAP is handling this, for example in class CL_ATTACHMENT_LIST.
    There is an include CNTN01_SWC with the definitions of the data-types and macros you need to handle the BOR-objects and containers.
    Include this in the local class-implementations of your global class. Then you can handle the BOR-objects inside the methods as usual.
    Regards
    Dirk

  • BOR reference in ABAP Class

    Hello,
    I am writing method in ABAP class which I will link to the Workflow Step. I want  to access values of one of the Workflow Element which is Multiline and refering to BOR Object Type. My queries are as below:
    1. How should I define Importing Parameter of Method which will import values from the Workflow Element which is Multiline and refering to BOR object type.
    2. If I change value of that Workflow Element (Multipline refering to BOR object type)  in ABAP class method, will it be automatically reflected in Workflow Container due to binding?
    Edited by: Ashwin Sonkusare on Apr 1, 2011 3:35 PM

    Hi,
    1. How should I define Importing Parameter of Method which will import values from the Workflow Element which is Multiline and refering to BOR object type.
    Please create a table type same as workflow multiline element type. ( You can also use standard table if present ).
    Then use this table type as the type of the import parameter of the class.
    Then u can pass the multiline element of workflow to  abab calss
    2. If I change value of that Workflow Element (Multipline refering to BOR object type) in ABAP class method, will it be automatically reflected in Workflow Container due to binding?
    If u change the Workflow Element (Multipline refering to BOR object type) in ABAP class method, then  u need to update the values of the workflow multiline element through reverse binging ( binding abap class to WF ).
    Thanks and regards,
    SNJY

  • BOR or ABAP Class for MM41

    Hi all.
    I am wondering whether anyone ever use workflow in transaction MM41.
    Does SAP provide standard BOR or ABAP Class for transaction MM41.
    I  know there is BUS1001006 but this only get triggers from MM01.
    Does user exit or BADI is the only way to trigger workflow from MM41?
    Thanks

    Hello,
    It might help if you said what MM41 was.
    As usual, turn on the event trace (SWELS), create and save something in your chosen transaction and then check the event trace (SWEL) for any events.
    regards
    Rick Bakker
    hanabi technology

Maybe you are looking for

  • TOO many OPEN CURSORS during loop of INSERT's

    Running ODP.NET beta2 (can't move up yet but will do that soon) I don't think it is related with ODP itself but probably on how .Net works with cursors. We have a for/next loop that executes INSERT INTO xxx VALUES (:a,:b,:c) statements. Apparently, w

  • Adobe Reader cannot connect to the review server

    Hi all, I'm from the DoIT and some of our employees can't publish comments in one of our PDF files. When the employee opens the pdf file, it doesn't matter if he is using Adobe Reader or Acrobat, he gets this message We have review the Tracker and th

  • How to get around credit inactivity?

    I purchased Skype Credit to be used in the event that I lose or break, or need to call it to find it. Today I get an email saying that I need to make a call or send an SMS to keep my credit active. So I need to SPEND the credit I BOUGHT to be able to

  • Macbook pro won't read FLUCARD .

    Hi there , i just Brought FLUCARD , a sd card with build in wifi . I have tried this card on other macbook pro and it work but not in mine . I have use it in bootcamp using window 7 , and it is able to read it well.  My guess is the OS lion is giving

  • Bridge 8.5 thumbail's info not showing

    Hi guys; How come Bridge 8.5 thumbnail's info is not present, already selected to show size, label and data and nothing. Can someone please help? Thanks