Workflow and ABAP OO

Hi,
I have read the excellent blogs on Workflow and ABAP OO by Joycelyn Dart (/people/jocelyn.dart/blog/2007/07/16/referencing-bor-objects-in-abap-oo-classes). I have sucessfully created a  BO (of type SIBFLPORB) in my class. However, I cannot figure out how to retrieve the workitem container that holds the BO. I have used macros before in workflow programming exists, but there I get the container from a workitem context. I can't find the workitem context in my class. Please provide me with some code samples of how I can retrieve the workitem container that holds the BO.
I am considering passing the workitem id to the method and reading the container via SAP_WAPI_READ_CONTAINER. If this is a good solution, then I see no point in having the BO as an attribute of the classe. Is it a good solution?
Thanks!
Elvez

I am probably missing something obvious here (or we are not even speaking about a same thing), but I still try to clarify my point.
>I could of course just pass the necessary data as parameters to the class
This is the part that I don't really understand. If you already have an instance of a class existing (=there is an object instantiated), which has the BO as an attribute, there shouldn't be any need to change a signature of any method(?). The only thing you need to enhance is the constructor of your class.
Currently you create the BO instance as an attribute in your constructor method (isn't this correct?). Just create the attributes you need from the BO into your class, and "populate" them in your constructor. Or if it is an method that you need, just create a similar method (=you can copy the code) into your class.
This all might be much easier than using the WF macros, which shouldn't be that difficult either - as Jocelyn says:
"You will still need to use BOR macros in your ABAP OO classes if and only if you want to call BOR attributes and methods in your ABAP OO methods.
If you need to do this then make sure you include the BOR macro definitions in your class by putting the special include program <cntn02> in the "Macros" section of your ABAP OO class."
Regards,
Karri

Similar Messages

  • How to Trigger a Workflow from ABAP Webdynpro

    Hi All Gurus,
    I have the following urgent requirement, my client is implementing HR and there is a requirement, where is a ABAP Webdynpro component in which we have integrated a Adobe Interactive Form. When the user calls this from through Portal and fills out the relevant data and submits it, a Workflow in the backend ECC system should lauch,
    I am not familiar with, this concept although I have worked in Workflow this is the first time I am interfacind with ABAP Webdynpro and Adobe Interactive From.
    Can you please let me know in steps what needs to be done to make the workflow trigger for my scenario and also the specific settings to be done in the bacckend.
    Regards,
    Pratima Jain

    Hi,
    If you are using HCM Processes and Forms, the Workflow and form are not directly related, thats true.
    But the method in the task calls the corresponding webdynpro application which responds to the action triggered by the user in turn to trigger the workflow and update the data in the HR Master Data.
    There are 3 layers  1. UI (webdynpro which launches Adobe Interactive form based on ISR Framework)
    2. Workflow
    3. Backend framework (used for retrieving F4 helps, default values, save data in the infotypes).
    for more documentation, please refer it on help.sap.com.
    http://help.sap.com/erp2005_ehp_03/helpdata/EN/82/b6b94278560c31e10000000a1550b0/content.htm
    hope this helps.
    Best Regards,
    Saujanya.

  • Attachments from Workflow to ABAP Webdynpro launched from UWL

    Hi All,
    You might have seen a recent post from me for sending attachments from ABAP Webdynpro to Workflow.
    I could do that by just calling SAP_WAPI_ATTACHMENT_ADD. I didnt have to create an instance of the SOFM object
    by passing the ATT_ID from this function module.
    Now the next task of the workflow which is sent to UWL, automatically carries the attachements in the Workitem.
    I didnt do binding from workflow container to Task container. (I dont know how!!)
    But I need to get those attachments on my ABAP Webdynpro after it is launched from UWL.
    For this I am using SAP_WAPI_GET_ATTACHEMENTS. But this FM is giving me the BOR reference.
    How do use this to get the attachments displayed on my Webdynpro as links?
    Thanks
    Deb

    Hi Debabra,
    I have similar requirement where I want to add new attachment from Webdynpro abap to workflow and again next level want to view it in UWL in another Webdynpro abap from workflow.
    I am trying to attach the document from Webdynpro to Workflow I used FM SAP_WAPI_ATTACHMENT_ADD and looks like it attached in workflow.
    Can you please tell  how the second part was solved where I want to attach document from workflow to Webdynpro abap
    Thanks,
    ST

  • Call purchase requisition approval workflow in abap program

    Hello,
    I copied the standard workflow for the approvaI of a purchase requisition WS00000038 and i tested it. I create a purchase requisition in me51n. This is triggering the event releasestepcreated which starts my workflow. Everything goes ok.
    Now, i want to call this workflow in ABAP. I do not know exactly how to do it. Here is the code I tried.
    data: ls_objkey type SWR_STRUCT-OBJECT_KEY,
    lt_mesage type table of SWR_MESSAG,
    gt_container type table of swr_cont,
    gs_container type swr_cont.
    gs_container-element = 'ReleaseCode'.
    gs_container-value = '01'.
    append gs_container to gt_container.
    gs_container-element = 'requisition'.
    gs_container-value = '0010000362'.
    append gs_container to gt_container.
    gs_container-element = 'RequisitionHeader '.
    gs_container-value = '0010000362'.
    append gs_container to gt_container.
    ls_objkey = '0010000362'.
    CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
    EXPORTING
    object_type = 'BUS2009'
    object_key = ls_objkey
    event = 'RELEASESTEPCREATED'
    TABLES
    input_container = gt_container
    MESSAGE_LINES = lt_mesage.
    As you can see i filled he RequisitionHeader, requisition and release code. I saw in the workflow that i copied, that these are import parameters. Requisition and release code are mandatory. 0010000362 is a purchase requisition that i created.
    After i run the program i receive a work item in SBWP but it has the status error.
    Can you help me?Perhaps anyone has done this. I think that i am not filling the correct data or something like that. Maybe you can look in the standard workflow WS00000038 and tell me what I should pass and how.
    Thank you,
    Efren

    Hi Efren,
    The Problem is, for the purchase requisition there is two key fields.
    So when you pass the keyfiled to workflow it should be the concatenation of Purchanse requisition number and the item number.
    You have to pass the object key as below.
    ls_objkey = '00100003620010'.
    Then only your business object will getting insatanciated.
    Thanks,
    Viji.

  • Call workflow from ABAP program

    created a zbusiness object (ZPRODH)with
    one key field product hierarchy,
    one attribute level number and
    one method display.
    I tested that zobject and using this object created workflow to display product hierarchy ,it is displaying it. now I have to call it from one abap program.
    In the abap program I am calling the funcion module, I
    CALL FUNCTION 'SWW_WI_START_SIMPLE'
    EXPORTING
    TASK = TASK
    IMPORTING
    WI_ID = WI_ID
    TABLES
    AGENTS = AGENTS
    WI_CONTAINER = WI_CONTAINER.
    It is calling the workflow and subrc is 0, but not passing the value to the workflow. Because of that the method is not working, any idea?
    Thanks in advance

    ttpa,
    Please check this thread:
    Re: Workflow from abap program
    Also check that your Fm do requires any explicit commit or not?
    Hope it will help u
    Cheers
    Jai

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

  • Workflow and WD integration

    Hi,
    We are implementing Workflow and Webdynpro ABAP integration.Employee submits competences from portal, this triggers an approval task to the manager .Manager will approve the task from worklist and when he clicks on task, Web dynpro application opens up where he has to approve or reject accordingly.
    We have approve and reject buttons in Web dynpro and we have used User Decision Step type in Workflow to open the Web dynpro application.User decision step decisions are mapped to Web Dynpro approve/reject actions.
    So we are able to successfully launch the Web dynpro and perform the actions.But problem is the rest of Wrokflow after User Decision step is not getting executed. Workflow is getting stopped at this point.
    We have tried using FM's SAPI_WAPI_DECISION_COMPLETE and SAP_WAPI_WORKITEM_COMPLETE.
    Both these FM.s complete the User Decision step but does not execute rest of Workflow.
    Please help me if you have come across this scenario.

    Hello Archana !
             After user decision step, you have maintained the step that updates database as immediate step.
             Have you tested this step separately ? If it have yielded successful results, check the binding for the immediate step after user decision.
             Also, check the workflow log whether the containers for the step that updates the database are populated with required values.
             Is the method that updates the database is custom method ?
    Regards,
    S.Suresh.

  • How to trigger GP workflow through ABAP Program.

    Hi All.
    i have one scnerio , i want to create BOM through Custom Ztransaction that will be developed in ABAP Modulepool.
    User will create BOM  from this ztransaction through  Transactional Iview in PORTAL,Once the user save transaction , i want to trigger a GP(Guided Procedure ) workflow,from ABAP Program.
    is it possible to trigger GP workflow?
    if yes how  to  do it , please suggest the way out.
    Regards,
    Shyam.

    Hi lingana,
    As u see in my requriment that, Workflow is not designed within SAP , But the Workflow will be designing
    in SAP Netweaver, its a GP Workflow. And Ztransaction(Developed by ABAP) will  be seen by user through portal  and
    he save transaction on PORTAL, In backend  ABAP program will run , and after meeting certain condition, it should create
    or(Initiate) GP workflow(process).
    So my question is , how ABAP Program will call GP workflow, How the connection will be made in between ABAP Code and GP workflow framework.
    If any doubt regarding requriment let me know,
    Regards,
    Shyam.

  • Help regarding ABAP and ABAP Objects

    Dear all,
    I am very new in abap and abap objects. But i have some expr. in other language..specialy development. Right now i am working for srm module...So i want to move my self into abap object and specialy in workflow...Please provide me help regarding this...along with the starting point for this.
    Best Regards
    Vijay Patil

    hi
    Object Oriented prg
    A programming technique in which solutions reflect real world objects
    What are objects ?
    An object is an instantiation of a class. E.g. If “Animal” is a class, A cat
    can be an object of that class .
    With respect to code, Object refers to a set of services ( methods /
    attributes ) and can contain data
    What are classes ?
    A class defines the properties of an object. A class can be instantiated
    as many number of times
    Advantages of Object Orientated approach
    Easier to understand when the system is complex
    Easy to make changes
    Encapsulation - Can restrict the visibility of the data ( Restrict the access to the data )
    Polymorphism - Identically named methods behave differently in different classes
    Inheritance - You can use an existing class to define a new class
    Polymorphism and inheritance lead to code reuse
    Have a look at these good links for OO ABAP-
    http://www.sapgenie.com/abap/OO/
    http://www.sapgenie.com/abap/OO/index.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
    http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt
    http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
    http://www.allsaplinks.com/
    http://www.sap-img.com/
    http://www.sapgenie.com/
    http://help.sap.com
    http://www.sapgenie.com/abap/OO/
    http://www.sapgenie.com.
    http://www.sapgenie.com/abap/OO/index.htm
    http://www.sapgenie.com/abap/controls/index.htm
    http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    http://www.esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
    http://www.sapgenie.com/abap/OO/index.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    http://www.sapgenie.com/abap/OO/
    check the below links lot of info and examples r there
    http://www.sapgenie.com/abap/OO/index.htm
    http://www.geocities.com/victorav15/sapr3/abap_ood.html
    http://www.brabandt.de/html/abap_oo.html
    Check this cool weblog:
    /people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
    /people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b6254f411d194a60000e8353423/frameset.htm
    http://www.sapgenie.com/abap/OO/
    http://www.sapgenie.com/abap/OO/index.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
    http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt
    http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
    http://www.allsaplinks.com/
    http://www.sap-img.com/
    http://www.sapgenie.com/
    http://help.sap.com
    http://www.sapgenie.com/abap/OO/
    http://www.sapgenie.com/abap/OO/index.htm
    http://www.sapgenie.com/abap/controls/index.htm
    http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    http://www.esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
    http://www.sapgenie.com/abap/OO/index.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    http://www.sapgenie.com/abap/OO/
    these links
    http://help.sap.com/saphelp_47x200/helpdata/en/ce/b518b6513611d194a50000e8353423/content.htm
    For funtion module to class
    http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5954f411d194a60000e8353423/content.htm
    for classes
    http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5c54f411d194a60000e8353423/content.htm
    for methods
    http://help.sap.com/saphelp_47x200/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm
    for inheritance
    http://help.sap.com/saphelp_47x200/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm
    for interfaces
    http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b6254f411d194a60000e8353423/content.htm
    For Materials:
    1) http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf -- Page no: 1291
    2) http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
    3) http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    4) http://esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
    5) http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt
    6) http://esnips.com/doc/448e8302-68b1-4046-9fef-8fa8808caee0/abap-objects-by-helen.pdf
    7) http://esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder.ppt
    8) http://www.amazon.com/gp/explorer/0201750805/2/ref=pd_lpo_ase/102-9378020-8749710?ie=UTF8
    1) http://www.erpgenie.com/sap/abap/OO/index.htm
    2) http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    Hope this helps
    if it helped, you can acknowledge the same by rewarding
    regards
    ankit

  • Role Mapping For Portal Role Assignment and ABAP Role Assignment

    Summary:
    - Under the GRC configuration of Roles> Role Mapping we are trying to utilize the  role mapping feature in GRC for associating a dependent role to a main role.
    - We want to use this role mapping feature for the purposes of adding an Enterprise Portal role for every ABAP role that gets approved for the user in an ABAP component system (i.e. ECC, BW, CRM etc). We will have a 1:1 mapping of Enterprise Portal role to ABAP role defined in the role mapping section in GRC.
    - We want to set up the workflow in such a way that the main role (ABAP role) is the only role that needs to be approved. The dependent role (Enterprise Portal role) should be added or not added based on the approval or denial of the main role (ABAP role). In other words if the role owner for the abap role approves the abap role, then both the abap and EP role will be provisioned by GRC and if the role owner rejects/denies the role, then neither the abap or EP role will be provisioned by GRC.
    Problem Description:
    Our Scenarios we tested:
    Scenario 1:
    Main Role:  Attached to Initiator A & workflow A (routes to single approver based on role)
    Dependent Role:  Attached to Initiator B & workflow B (routes to auto approval or no approval)
    *Problem with the Scenario 1setup above, the dependent role will always get approved & provisioned regardless of the approval or denial of the main role. 
    Scenario 2:
    Main Role:  Attached to Initiator A & workflow A (routes to single approver based on role)
    Dependent Role:  Attached to Initiator A & workflow A(routes to single approver (same as main approver) based on role)
    *Problem with the Scenario 2 setup above, the dependent role will always also need to get approved by the same approver as main role and it opens the possibility that the approver may accidently approve the main role and deny the dependent role, which is not the ideal setup as we inherit the risk of human error.
    Questions:
    1. Does the dependent role need to be defined in an initiator at all since it will never directly be requested directly?
    2.  If the dependent role does need to be in the initiator file, please describe how to properly setup the initiator and workflow stage & path so that we can maintain the desired relationship with the main role approval dependency? (if the role owner for the main role approves the main role, then both the main role and dependent role will be provisioned by GRC and if the role owner rejects/denies the main role, then neither the main role or depedent role will be provisioned by GRC
    Edited by: Rene Griffith on Feb 26, 2010 10:22 PM

    I tested this set up.
    1.  Defined ABAP role as Manin role
    2.  Defined Non-ABAP role as dependednt role
    3. ABAP role  is set up in initiator requiring business approval.
    4.  Non-ABAP role is set up in initiator with no approval required.
    Results Where Business Approver approves the ABAP Role
    1. Only the ABAP role is displayed in approver view which is desirable.
    2.  ABAP role is approved and Non-ABAP role and ABAP role is provisioned.
    Results Where Business Approver rejects the ABAP Role
    1. Only the ABAP role is displayed in approver view which is desirable.
    2.  ABAP role is rejected but  Non-ABAP role is provisioned which is not what we want.  We want the Non-ABAP role not to provision if the ABAP role is rejected by the business approval.
    Thanks again for your help.

  • Integration of SAP Business Workflow and Webdynpro

    Hello colleague,
    Could you pls. provide any pointers in configuring the following scenario:
    There is a SAP workflow configured in R/3. When one of the steps of the workflow is executed I have to trigger a Web Dynpro (for ABAP) screen.
    Say its an approval workflow and when the manager clicks on the workitem in the inbox a webdynpro screen will pop up indicating the requisite information. The manager can approve or reject the based on information on the screen. The user action will be taken and the workflow will proceed based on that.
    Any pointers in this will be of great help.
    Regards,
    Gajendra.

    I would like to know as well about this, did you get an answer?
    Thanks for any pointers.

  • Generic decision Task and ABAP OO

    I have implemented a workflow using ABAP OO, which has a couple of user decision steps.
    Now I have made a copy of the generic decision task (8247) into my own custom task. I then copied over the code from the process method of the DECISION BO into my own custom BO. I then referenced the custom BO in my custom task. I tied this custom task to a user decision step in my workflow.
    code
    I had to this so that I could extend the functionality of the code to do something specific to my logic. This works fine.
    However when I write the same code in a method of my ABAP class and tie it to the same custom task instead of the BO, the workflow complains while activating "TASK XXXXX cannot be used as a decision task".
    Any advice would be greatly appreciated. Thanks a lot in advance.

    Hi Amlan,
    What I could figure out from your query is that, you want to use ABAP OO, functionality of classes in implementing a task. Please correct me if I am wrong.
    I would suggest you that Let your Workflow work with the BO, because there are certain tasks for which only BO works, implementation of classes might give some problem.
    check **************** - business workflows for further correspondence
    Best Regards,
    Kanika
    Edited by: kanika chopra on Dec 9, 2008 5:12 AM

  • I know sap hr and ABAP ..

    HI,
    I know SAP HR and ABAP ...then is it necessary to learn SAP ABAP HR course separately . is SAP ABAP HR is the combination of both ABAP and SAP HR or it is a different entirely course.do you suggest me to learn ABAP HR separately .

    Hi Experts,
    Please help me...
    I am new to SAP HR ABAP Programming.. Here I need to develop a Expenses claim form( ESS)
    I require a custom report to get the employee details in form and they can fill their travel expenses and other expenses manually in the form and that should be send to manager for approval.
    I don't know from which  Infotype I can get these details for the specific employee who are logged in to ESS, what are the Function Modules and which workflow process we can use for the approval ...Etc
    I am providing detail form below please give me some information about the report and workflow..
    Please someone help me to overcome this situation..
    Regards,
    Sudheer

  • Calling Shell Scripts in Business Workflow and Guided Procedures

    Hi *,
    is it possible to call shell scripts in business workflow and guided procedures? would need further documentation (how to, blog,...) about this issue.
    Thx in advance,
    Rene.

    Hello,
    Workflows consist of tasks.
    A task executed an object's method.
    Methods are written in ABAP.
    In the method you can code whatever you like, including code to execute shellscripts.
    How to do this is not really a workflow question, I would suggest asking in an ABAP forum on how to write a function module to do this in a pure ABAP context. Then it's just a matter of inserting it into a method for use in your WF.
    Cheers,
    Mike

  • FM to read the different steps in workflow and the status at each step

    Hi All,
    Is there any FM in SAP which gives the detail roadmap of the steps taken in a workflow and the diffrent status or decision at each step.
    I am looking for something like what you see when you click on the "STARTED WORKFLOW" in the business workplace outbox.
    Which shows up the "steps in the process so far "  and the decision and the agents for each of them.
    Thanks,
    Charan.

    Hi,
      You can get the status according to the task. please check with FM "SAP_WAPI_GET_WI_DELTA".
    Regards
    SM Nizamudeen

Maybe you are looking for

  • I have a 2 page PDF (portrait format), how can I convert the format to landscape?

    I have a 2 page (portaait format) PDF file how can I convert the PDF file into landscape format before I change it to XL?

  • Automatic purging of resumes in iRecruitment

    Does anyone know of a way to automatically purge/delete resumes from iRecruitment after a specified amount of time?

  • Duplexing jams

    During duplexing  the device "jams" when it retrieves the sheet of paper to print the second side. The error message is to remove the cartridge and remove the sheet. There is no page visible to remove. Powering off and then back on often ejects the s

  • Converting Date to a calender and vice vera

    Hi i've a Date object which i need to add a Day to and than convert it back to a Date object. i need the use the Calendar.add() method but i dont see any method of Date that returns a Calendar. i wish to do something like this : Calendar c = Date.get

  • Error in test with Central Output Pro Server 5.5

    I am getting the following error, when I testing the Central Output Pro Server. I begin with a Central Output Pro Server Vers. 5.5 (demonstration version) some is the example which I use, I always have the same message in the logs: [313]*** Spawn of