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

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.

  • Business object reference in ABAP Classes

    Hi All,
    Here is my requirement.
    1) I have a Business Object (say e.g BUS2012) instance in my workflow container
    2)  I have a task in my workflow referring to a Z-Class and its method (M1)
    3)  I want to access the attributes of the above Business Object (BUS2012)in the method (M1)of the class.
    Please let me know how ?  Sample code will be more helpful.
    Thanks,
    Deb

    Hi Deb,
    Please check the following [thread|Re: Creating instance of Business Objects;
    Hope this helps!
    Regards,
    Saumya

  • How to Handle Business Object event in ABAP class

    Hello Everybody,
    I wanted to know if it was possible to reference BOR objects in ABAP class and handle BOR events in ABAP Objects.
    Thanks in advance.

    Hi,
    Catch the et_VALIDATE event, when InnerEvent = False and ItemChanged = True.
                If pVal.EventType = BoEventTypes.et_VALIDATE Then
                    If pVal.InnerEvent = False And pVal.ItemChanged Then
                        'TODO Your code here...
                    End If
                End If
    Regards,
    Vítor Vieira

  • Include in ABAP class for Workflow

    Hi,
    In order to use BOR macros inside ABAP class, (From SAP help) came to know that we need to use include <cntn02> .
    How to add this include to ABAP class for workflow?
    Regds,
    Akshay

    Hi Akshay,
    Slight difference, I said "keeping the class clean of BOR <i>code</i>". By all means use BO's in the class: basically create a ZCL_MATERIAL, and use BUS1001 as an attribute (I use a naming convention BO_* for these). As long as it's the right type (SIBFLPORB I think - no system handy right now), and the key values are populated correctly the system will instantiate it as necessary. So in WF I can refer to ZCL_MATERIAL.BO_MATERIAL whenever I need any of the BO's functionality.
    You are correct though, creating a proper business class which you can instantiate such as material does involve a fair bit of effort and coding to set up. e.g. my last project I ended up creating one ZBOR subtype because all I needed was one new attribute - definitely not worthwhile creating a new class for. (USR01.zEmailAddress for what it's worth).
    I've said before somewhere, it's not without pain, so if you're under time pressure etc, then it may be better to do whatever's quickest. There's nothing wrong with using BOR macros, it will still work for quite a few versions. I just meant to say that pure class(y) code is a preferred way to go if it makes sense to do so. This is not always the case.
    Hope that helps,
    Mike

  • ABAP Class reference in persistent container

    Hi all,
    Has anyone ever tried to read an abap class reference from a rule container in the rule's function module?
    This doesn't seem to work, unless I am doing something wrong...
    Here is the scenario:
    I have an abap class ZCL_CLASS instantiated in my workflow container. In one of my workflow steps I pass that class object reference to a rule (Function Module based). In the rule function module I use macro swc_get_element to try to get the class object reference. And there it is not getting anything.
    I have already tried the following:
    - Try to run macro swc_container_to_runtime on the rule container before retrieving the object reference -> doesn't work. The internal table ac_container doesn't even look different before and after having run this macro.
    - Try to replace the declaration of include <CNTN01> by <CNTN02> + <CNTN03>. Doesn't change anything either.
    When I look at ac_container in debugging it seems my object reference is there but looks a bit strange:
    ELEMENT | TAB_INDEX | ELEMLENGTH | TYPE | VALUE
    WFIBF_PORTAB | 000011 | 004 | u | SWFTSTRUCT
    WFIBF_PORTAB | 000012 | 032 | C | STEP
    WFIBF_PORTAB | 000014 | 032 | C | 1CCC1000C
    WFIBF_PORTAB | 000015 | 104 | C | <object key>    <class>    CL
    Any idea of how I should proceed to retrieve my object reference?
    For the moment the workaround I found is to pass the object key to the rule and to reinstantiate the class in the rule function module. Not a very elegant solution...
    Thanks in advance and kind regards,
    Patrick

    Hi Mike,
    I understand what you're saying. But the problem is that the swc_get_element macro does not even get me the LPOR value, and therefore I can't call the FIND_BY_LPOR method.
    That means I have two solutions:
    - Passing the LPOR instead of the object reference to the rule container => Not a very nice solution, for many different reasons.
    - Find an alternative to swc_get_element to get the LPOR value.
    I had a look at class cl_swf_cnt_container, and it seems it can do the trick for me.
    So what I will finally do is:
    1. Convert the BOR container into an instance of cl_swf_cnt_container.
      DATA: lo_cnt    TYPE REF TO if_swf_cnt_container,
                 lt_container TYPE swconttab.
      lt_container[] = ac_container[].
      TRY.
          CALL METHOD cl_swf_cnt_container=>if_swf_cnt_conversion~create_from_bor_container
            EXPORTING
              values                = lt_container
            RECEIVING
              container           = lo_cnt.
        CATCH cx_swf_utl_obj_create_failed.
      ENDTRY.
    2. Get my container element.
    DATA: lo_myobj TYPE REF TO zcl_class.
    CALL METHOD lo_cnt->if_swf_ifs_parameter_container~get
      EXPORTING
        name       = 'MyContainerElement'
      IMPORTING
        value      = lo_myobj
    I didn't take the time to debug that deep in the standard SAP code, but I assume the if_swf_ifs_parameter_container~get re-instantiates my class for me.
    Please feel free to comment.
    Kind regards,
    Patrick

  • 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

  • [WF Attributes] DDIC vs ABAP class

    Hi,
    I am having a hard time understanding which CL (ABAP Class) does not behave like DDIC structure.
    I use both in my Workflow but I cannot manage to pass data (meaning reference) and trigger the Workflow
    - from the FM 'SAP_WAPI_START_WORKFLOW'
    - from an event
    Am I forced to use the IF_WORKFLOW (I don't see why I have to use the FIND_BY_LPOR method ??) ?
    -> if the static method FIND_BY_LPOR is returning the value, what has gone all the job in the first place ?)
    I have simply created a customer-specific class that would avoid me adding new structure to the Workflow container and the Workflow Tasks again and again... simply extend the class and the element will all follow.
    Many thanks in advance for your help.
    Best regards,
    Guillaume

    Hello Guillaume,
    I know this is closed but an interesting discussion nevertheless. The first part I am confused about is what exactly you are trying to accomplish and why:
    >
    Guillaume Garcia wrote:
    I have simply created a customer-specific class that would avoid me adding new structure to the Workflow container and the Workflow Tasks again and again... simply extend the class and the element will all follow.
    Why can you not do this with a DDIC structure? I use this a lot. Particularly useful if you work with MOVE CORRESPONDING in your code. Just extend the structure and new fields are automatically transported (if they exist in the DB of course).
    OO in WF is generally used in the same way as a BOR. The distinction is Business Object versus an OO class as you would use in an ABAP program.
    >
    Karri Kemppi wrote:
    As far as I know (and understand your point) it is not possible. Maybe someone disagrees with me, but I am happy to hear about that. The object instantiates itself whenever it is needed in the workflow. And during the instantiation you need to populate the attributes of the object, etc...
    Correct, but.... if you are really determined, there are some tricks you can use: Who cares whether your object really exists in the DB, as long as your FIND_BY_LPOR always returns an instance. If this is always the same instance it can work. The thing to be careful of is that you MUST have an unbroken chain of tasks that execute in the same logon/RFC session. Once that session ends (e.g. by switching users/background tasks) the data is gone. Needless to say you need to know exactly what you're doing.
    Cheers,
    Mike

  • File to Proxy Scenario using ABAP Class and DB Multi Connect

    Hello Friends,
    I have a scenario below and a proposed solution. I would like some input as to whether i am headed the right way.
    Scenario: Thousands of records come in from the legacy accounting system. The fields of these records need to be mapped to SAP fields using cross-reference tables stored in DB2. Finally, summarize the records by deleting a few fields and feed to R/3.
    Solution i proposed:
    (1) File Adapter is used to send the file
    (2) Although JDBC adapter comes first to mind but since i need to access the DB2 tables multiple times for each record i propose to use an ABAP class for the mapping. Within the ABAP class the intent is to open an database connection to DB2, read the relevant cross tables using native SQL and finally generate the output XML.
    (3) Reciever is Proxy which feeds this generated XML to SAP for creating posting via BAPI_ACC_DOCUMENT_POST
    Question: Is the above solution correct or is there a better method to implement this scenario?
    Please let me know.
    Thanks,
    Minhaj.

    Looks fine. Few observations -
    1. Whether it is ABAP class or Mapping in RFC lookup, you are making multiple trips to the database.
    2. It looks like PI is being used only for reading the file and converting it to XML.
    3. If using PI is not mandatory, then a complete ABAP class on ECC it self would be faster than swtching between PI Java, PI ABAP then round trips to DB2 finally data push to ECC.
    If you could look at something like fetching all the required RFC look up data in one go and then map the fields according, might save u on processor and network resources.
    VJ

  • Calling Portal event from ABAP class

    Hi Experts,
    I need a following clarificatrion, Please help,
    1. Is it possible to call a webdynpro method from a normal ABAP class?
    2. If no, we need a functionality of a class 'CL_WDR_HTTP_EXT_MIME_HANDLER' having method 'DO_DOMAIN_RELAX_HTML'.
    Is there any alternative method which can be used in ABAP having the same functionality.
    3. Is there any ways with which we can call portal event from ABAP class?
    Thanks,
    Shabir

    >1. Is it possible to call a webdynpro method from a normal ABAP class?
    I wouldn't necessarily recommend this approach. You shouldn't try to trigger events or any of the standard WDDO* methods from outside the WD Component itself.  That said, you can pass the object reference (like the WD_COMP_CONTROLLER object reference or the View Object Reference) into methods of normal classes.  Be careful if you are finding yourself calling a lot of your added methods from outside WD.  This is probably a sign that these methods should be in the Assistance Class or some other Class functioning as a Model Object.
    >2. If no, we need a functionality of a class 'CL_WDR_HTTP_EXT_MIME_HANDLER' having method 'DO_DOMAIN_RELAX_HTML'.
    Is there any alternative method which can be used in ABAP having the same functionality.
    What exactly do you want to do here?  Do you just want to get the relaxation script?  For what purpose?  You should never need to inject the relaxation script into WDA. 
    >3. Is there any ways with which we can call portal event from ABAP class?
    To what purpose.  Do you just want to delegate the triggering of the event that is inside WD Component to be called from a class?  If so you can pass the portal API object reference into a class from the WD Component.  However this only works while running within WD.
    How is this class used?  Are you running in WD?  Are you trying to generate some HTML code that runs in the portal independent of WD?

  • Error handling in Abap Class for SAP Workflow

    Hi Experts,
    I would like to know if we have an option in abap classes used in workflows to send errors to the workflow log. We can achieve this in BOR Object methods by using the EXIT_RETURN <CODE> var 1 var 2 to send the errors back to the workflow, but how is this achieved through methods from classes  used in workflows.
    Appreciate your quick responses,
    Chaitanya

    Just raise exceptions in the normal OO way. Any exception that is a subclass of CX_BO_ERROR should be automatically available in workflow. Use subclasses of CX_BO_TEMPORARY for temporary errors.

  • BOR representation in ABAP

    Is it possible to create an ABAP class that inherits from a business object in the BOR ?
    If it isn't possible, is there a way to create a business object instance in an ABAP program ?
    Thank you,
    Elad.

    Hi,
    You can have a look at the TRXN SE24 -> class browser. Here you will find all the Classes related to all the application components....
    I think you can instantiate these classes and use...
    Hope it helps...
    Lokesh
    Pls. reward appropriate points

  • XML to flat File:ABAP Class

    Hi ,
    Please can someone answer my question asap.
    I have to write an ABAP Class which receives an XML Document which has multiple IDOCS.The IDOC has several Segments which can repeat and also the segments have Sub-Segments.
    Please can someone provide me a sample code which can convert the fields of each segment to a line of the output flat file.
    I need a flat file where fields under each segment should come in one line.I mean the control record should come in one line.The fields of 1st segment ex:E1EDK01 should come in 2nd line.....
    Please revert.
    Thanks in Advance,
    Harish.

    You will need to use ABAP ixml technology to parse the content from the xml file:
    You can reference following ABAP mapping.
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/15ecdf90-0201-0010-d792-941a3c3c30a4
    or SAP help doc:
    http://help.sap.com/erp2005_ehp_04/helpdata/DE/86/8280d212d511d5991b00508b6b8b11/frameset.htm
    Regards.
    Liang

  • Create Attachment in workflow through ABAP Class in ECC 5.0

    Hi,
    Wr are using SAP ECC 5.0 and i am trying to create attachment through ABAP class.
    Here in ECC 5.0, macro INCLUDE cntn01_swc is not available.
    I am getting an error in declaration of SOFM object, because again SWC0_OBJECT is not available.
    I've tried creating the parameter as type SOFM and of type table of SOFM but it also not working.
    Can anybody help me how i can create SOFM instance in ABAP class in ECC 5.0?
    Regards,
    Smit

    Hi
    I am not very much sure about ECC 5.0 environment. Firstly are you looking to create a SOFM object inside any class or program or Function module , If yes then you need to include a include INCLUDE CNTN01_SWC (No arrow brackets) if this include is not available then use INCLUDE<CNTN01>  then declare a variable of type SWC0_OBJECT if you are using first include or declare of type SWC_OBJECT.
    Once you include any of the includes then by making use of SWC macros you can create a object
    SWC0_CREATE_OBJECT <VARAIBLE> <BOR NAME> <BORKEY> for first include.
    SWC_CREATE_OBJECT <VARAIBLE> <BOR NAME> <BORKEY> for second include.
    Regards
    Pavan

Maybe you are looking for