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

Similar Messages

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

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

  • BOR Objects and ABAP

    Guys,
    Not even sure if this is possible...
    How do I find BOR calls in an ABAP program.
    Example: BUS2088 or BUS2008 in program SAPLCOIH - for PM/CS orders).
    PeteA

    Hi Peter,
    Specify your business object and the method of the BOR object in the BASIC data tab in PFTC transaction.
    If you want to trigger the Workflow through and event then you will have to first link your event of the Business Object to the WorkFlow Task in Workflow Builder (TCODE PFTC) and then you can do the following :
    Please refer the code below to for your information.
    Data for workflow trigger
    DATA: objtype LIKE swetypecou-objtype,
    objkey LIKE sweinstcou-objkey,
    event LIKE swetypecou-event,
    event_container LIKE swcont OCCURS 0 WITH HEADER LINE.
    objtype = 'ZBUS1001'. "Material [sub object of BUS1001]
    MOVE v_wfmatnr TO objkey. "V_WFMATNR is material number
    event = 'CreatePLMMaterial'."Custom Event defined in
    ZBUS1001 [Tcode SWO1]
    REFRESH event_container.
    *Following are the Event parameters required in the *Workflow
    swc_set_element event_container 'Attachment' v_wfattachment.
    swc_set_element event_container 'Material' v_wfmatnr.
    swc_set_element event_container 'TisGroup' v_wftisgroup.
    swc_set_element event_container 'SchDate' v_schdate.
    CALL FUNCTION 'SWE_EVENT_CREATE'
    EXPORTING
    objtype = objtype
    objkey = objkey
    event = event
    TABLES
    event_container = event_container
    EXCEPTIONS
    objtype_not_found = 1
    OTHERS = 2.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    COMMIT WORK.
    Please reward some points if it helps you.
    Regards,
    Amit M. Mishra

  • 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

  • Custom proces type based on ABAP OO class

    Hy,
    I have a process type and in one method of its asoociated ABAP OO class I have to check if their process chains are running or not.
      I know how to make the tests, but the problem is that I have to integrate them in one method. I'm lookink for a solution to adapt the process type from :
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/509f3ae6-e36e-2910-48a8-ab43dc167dd9   
    Any suggestions about what should I keep or not and in which method should I put my tests?
    Thank you.

    Hello,
    Sorry, not sure where my brain was. Actually I do know: at two clients with projects going live this month, so apologies for a rushed and inaccurate response. It's CL_SWF_EVT_EVENT.
    Jocelyn's blog I referred to includes a code sample using the same class on how to raise an event with an object key.
    Regarding your second question: No you don't need to do any binding. Just use an instance of your object and it will wait for an event with the same key. The WF part is very straightforward and works exactly like BOR, it's just raising event that can't be done with the WAPI.
    Cheers,
    Mike

  • ABAP OO class-based workflow, wait step

    Hello,
    I'm hoping someone is able to help me.  I've implemented a class which triggers a custom workflow through a custom event of the class.  At one point during the workflow I want to use a wait step that waits for another custom event to occur.  I've created my second event which I want to trigger from an ABAP ALV Grid report for users, that will allow them to select the specific workflows to trigger this event for.  My problem is, I am having trouble figuring out how to find the correct object instance of my class from within the ABAP program and trigger the event specifically for that instance, so that the workflow can continue and eventually complete.  I have implemented the IF_WORKFLOW interface and up to this point the workflow is functioning correctly.
    Thanks,
    Leslie

    Hello,
    Sorry, not sure where my brain was. Actually I do know: at two clients with projects going live this month, so apologies for a rushed and inaccurate response. It's CL_SWF_EVT_EVENT.
    Jocelyn's blog I referred to includes a code sample using the same class on how to raise an event with an object key.
    Regarding your second question: No you don't need to do any binding. Just use an instance of your object and it will wait for an event with the same key. The WF part is very straightforward and works exactly like BOR, it's just raising event that can't be done with the WAPI.
    Cheers,
    Mike

  • Webflow - Assign BOR Object to HR Org Structure

    This is posted to the BPM forum per suggestion in the ABAP Programming forum.
    I’m looking to attach a custom BOR object to our HR Org Structure; however, I can’t locate the correct transaction to perform this. As well as the transaction I need a little more detail on where in the transaction the configuration takes place. I’ve scoured all the menu options but can’t seem to locate it.
    This concept was taught at the BIT601 class in Belmont, CA last month by instructor Micah Wade. It was demo'd but not included as part of the handouts. The concept is extremely interesting for us and we would like to prototype it's functionality for some future development.

    Hi Bryan,
    Well, first off, my first reference for WF is always 'Practical Workflow for SAP', published by SAP Press, also known as 'the bible'.  However, I don't have a copy at home.
    Secondly, at the risk of touting a different forum's horn, you can always subscribe to SAP-WUG, a WF list moderated by yours truly. Almost 800 WFers worldwide.  If you go to http://mailman.mit.edu/mailman/listinfo/sap-wug you ought to be able to search archives, and also subscribe from there.
    Third, take a scenario where you have people responsible for approving something, say requisitions, on cost centers.  The approval is not hierarchical, or based on positions or jobs.  By attaching the Cost Object in table T7791, you are allowed to assign a specific cost center to the person, position, or job responsible for the approval of the requisition.  You can attach the same cost center value to multiple people too.  Then you write your role (or rule) resolution to look like (or call function like)RH_SAP_ORG_OBJECT_ACTORS_LIST, passing in the business object for Cost Center, and the specific Cost Center value.  That would return all the people associated with that specific Cost Center.
    Hope this helps,
    Sue

  • BOR object cannot use function module as method

    Hi All,
    I have a function module with an import parameter referring to data element DE_ABC. BOR indicates that it doesn't support this data type. However, if I define a DB table with a field whose type is DE_ABC and use that field as reference in FM interface definition, that FM can be used by the BOR object. Does anybody have any idea about this issue?
    Best Regards
    Jerome

    Hello,
    Please always mention version. It may help if you told us what data type, but to give a theoretical answer I'd say this would be correct behaviour.
    BOR is old, it was created to bring some kind of OO to then procedural ABAP. It has also not changed much, therefore doesn't support some of the newer data types. On the other hand it doesn't look at the components of a structure, so placing an unsupported element into a structure is a perfect workaround.
    Be careful however when using deep structures or one of the variable length types such as STRING. As I use classes most of the time I have no idea how they would behave but a quick test should verify whether it works.
    Hope that helps,
    Mike

  • How can I call a ABAP proxy class from BADI? PLease help

    hi Experts,
        I have a scenario where I have to call a ABAP proxy class from a BADI. How can I do this? Does anybody has sample code for the same?
    Please help.
    Thanks
    Gopal

    Hi,
       You can call a method of a class from BADI. Here are the steps.
       1) In the BADI implementation create a object for the proxy class.
       2) Call the Execute_Synchronous method.
        You can define a BADI by using SE18 and you can implement it by using SE19.
    Sample code...
    ================================================
      METHOD ZIF_EX_VBADI~CONVERTUPPER.
      DATA: OBJ TYPE REF TO ZTESTCLASS.
      DATA: IT_DATA  TYPE ZIN_MT,
                IT_RES   TYPE ZOUT_MT,
                SEXCEPTION TYPE REF TO CX_AI_SYSTEM_FAULT.
      TRY.
          CREATE OBJECT OBJ
             EXPORTING
                 LOGICAL_PORT_NAME = 'TESTPORT'.
      CATCH CX_AI_SYSTEM_FAULT INTO SEXCEPTION.
      ENDTRY.
    ENDMETHOD.
    ================================================
    Thanks,
    Vivek LR

  • How to use CL_PROXY_BASIS instead of CL_PROXY_CLIENT your ABAP Proxy class?

    Hello experts,
    I have a scenario where a new basis release was done in my development and testing SAP boxes (Basis Release 710 I believe) which means from then on when generating an ABAP Proxy class the inheriting class will be used is CL_PROXY_CLIENT as opposed to the previous CL_PROXY_BASIS.
    This causes a problem though because the target date for the project, which uses this ABAP proxy, is supposed to be in the production system before the date when the basis release will be done in the production system.  Obviously this will cause delays in my project since if I were to move my objects to production before the basis release a dump/syntax error will occur in production because the class CL_PROXY_CLIENT is not expected be production yet.
    The next plan is to try to use CL_PROXY_BASIS instead of CL_PROXY_CLIENT, by editing my ABAP Proxy Class be force. My question is, what steps do I need to take so that I can change these classes so CL_PROXY_BASIS will be referenced/used instead of CL_PROXY_CLIENT ?
    I hope to hear from all of you soon.
    Regards

    >
    Rich Heilman wrote:
    > Bad idea.  Your dev and prod boxes should be at the same basis level at all times. 
    >
    Which release and SP level are you still on?

  • ABAP OO Class and Change Documents

    I have created a class based on the IF_WORKFLOW interface.  I created a couple of events.  I created a workflow task assigned to a custom method of the class.  I setup the Material Change Document to trigger the class event when there is a change.  The workflow task does trigger when I change a material, but I don't know how to pass the key of the Change Document (matnr) to the workflow task/method using the ABAP OO Class interface.  Any help?
    Thanks,
    Kenneth

    Thanks for the reply Florin.  Yes, I have seen Joclyn Dart's Whitepaper and blogs.  They are very helpful, but I haven't seen much information within them about Change Documents.  I tried your suggestions, but the material key is still not being filled when I trigger the change document and workflow task using tcode MM02.
    Here is what I have done:
    Created an Attribute 'Material' type mara-matnr and checked 'Key Attribute'.
    Created an Attribute M_POR type SIBFLPOR.
    Here are the methods:
    Constructor with parameter 'Material' *
    METHOD constructor.
      me->m_por-catid = 'CL'.
      me->m_por-typeid = 'ZMM_WF_MATTEC'.
      me->m_por-instid = me->material.
    ENDMETHOD.
    Find_by_lpor with parameters LPOR and RESULT (default params) *
    METHOD bi_persistent~find_by_lpor.
      DATA: p_material TYPE matnr.
      MOVE lpor-instid TO p_material.
      TRY.
          CREATE OBJECT result
            TYPE
              zmm_wf_mattec
            EXPORTING
              material      = p_material.
        CATCH cx_bo_error .
          EXIT.
      ENDTRY.
    LPOR with parameter RESULT (default param) *
    method BI_PERSISTENT~LPOR.
    result = me->m_por.
    endmethod.
    ENDMETHOD.
    Custom method MAT_CHANGED with parameter 'Material' * (not coded yet)
    This is the task being triggered by the Change Documents *
    METHOD mat_changed.
    ENDMETHOD.
    Edited by: Kenneth Moore on Nov 4, 2008 11:00 AM

  • Terminating event and abap oo class

    Hi, gurus,
    I 'd like to know how the terminating event works.
    for example,  i define a custom abap oo class (which has been implemented the interface of IF_WORKFLOW), and i want to use it as the terminating event of a standard task.
    could you please tell me how does it works?
    1. there must be an instance defined in the container of the task?
       which must be instanciated in the run time?
    2. then in another abap report, i simply raise the event defined as the terminating event, using the same key, then the pending task will be terminated?
    could you pls provide more information on this ?
    thanks and best regards.
    Jun

    Hi Jun Zhang,
    An event that is used to stop a workflow or task, or change the behavior of an already started workflow is called Terminating Event.
    If the event linkage is active and the linkage rules are satisfied, the status of the work item is set to COMPLETED.
    Defining Event Linkage  Terminating event linkage consists of 2 parts.
    Type linkage which specifies business object type, event name, generic name for event receiver (WORKITEM for terminating events of tasks or EVENTITEM for wait for event steps)
    Instance linkage which identifies the particular receivers (I.e. work item Ids) per object instance.
    Terminating event linkages can be seen in SWE3.
    For terminating events, along with Business object and Event a Container Element should be specified that holds the Object Instance.
    Terminating Event for Workflow is available from Release 6.10 only. This is defined in Basic Data of Workflow Builder.
    Binding Definition is optional for Terminating Events. Binding can be defined b/n event container and workflow container to pass event information to the workflow if required. That is the only way of passing information from an asynchronous method to the task that started it.
    Thanks and Regards,
    Prabhakar Dharmala

  • Extend or delegate ABAP OO class

    Hi,
    How could I extend or delegate ABAP OO class in workflow. I have a scenario whereby I make copy of Standard workflow WS61000090 which uses ABAP class as workflow Objects. In one of the task, I need to put my logic with zmethod. I am in ECC 6.0 environment.
    Any Help is appreciated.
    Thanks.
    Bijay

    Hi Bijay,
    I encountered the same problem previously with leave requests (WS12300111) whose class (CL_PT_REQ_WF_ATTRIBS) was marked as final so I couldn't change or extend it. In addition, the workflow triggering logic coudn't be touched.
    Thus, I had two options:
    1. Create custom class for leave requests
    - in this option I would have had to rewrite the CL_PT_REQ_WF_ATTRIBS class and instantiate it in my workflow
    2. Create static class for leave request utilities
    - in this option I created a static (=no instances to be created) class with a few static methods with e.g. the request ID as an import parameter
    - and called the methods from my workflow
    I chose to go with option 2 since I only had a few methods I needed and was under time constraints. If there would then be other needs in the future for extracting/updating leave request data the class would then allow for further enhancements.
    I don't know what would be the most elegant way of going forward, but at least for me the static class/methods approach has worked all right. It just feels kind of silly to make a custom class completely rewriting the original abap class functionality to make it work. Especially because there might be upgrade changes to the class in the future...
    Best regards,
    Mikko

Maybe you are looking for