HOW TO TRIGGER AN WORKFLOW FROM A PROGRAM ?

HELLO THERE ,
CAN ANYBODY PLZ TELL ME HOW TO TRIGGER AN WORKFLOW FROM AN PROGRAM AND TO PAS THE VALUE TO THE CONTAINER ?

Hello Neon,
If you want to trigger the workflow directly, use the FM, SWU_START_WORKFLOW
CALL FUNCTION 'SWU_START_WORKFLOW'
  EXPORTING
    task                  =
*   LANGUAGE              = SY-LANGU
    user                  =
*   SENDER_ID             =
* IMPORTING
*   RETURN_CODE           =
*   WORKITEM_ID           =
  tables
*   CONTAINER             =
*   MESSAGE_LINES         =
    attachment_list       =
A workflow can also be triggered by and event which is in turn triggered by a program.
By the FM, SWE_CREATE_EVENT
Example:
w_key = 'Connie'.
  w_creator-otype = 'US'.
  w_creator-objid = 'SAPDEV02'.
  CALL FUNCTION 'SWE_EVENT_CREATE'
    EXPORTING
      objtype                       = 'YH_BUDDIES'
      objkey                        = w_key
      event                         = 'event'
     creator                        = w_creator
*     TAKE_WORKITEM_REQUESTER       = ' '
*     START_WITH_DELAY              = ' '
*     START_RECFB_SYNCHRON          = ' '
*     NO_COMMIT_FOR_QUEUE           = ' '
*     DEBUG_FLAG                    = ' '
*     NO_LOGGING                    = ' '
*     IDENT                         =
*   IMPORTING
*     EVENT_ID                      =
*   TABLES
*     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.
  ELSE.
    WRITE: / 'EVENT TRIGGERED'.
  ENDIF.
  COMMIT WORK.
Hope it helps you.
Regards
Indu.

Similar Messages

  • How to trigger MDM Workflow  from ABAP Program.

    HI
    I have requriment  to trigger MDM Workflow(Design in MDM) from My Module pool program. Suggest how to do it?
    Thanks in Advance.
    Regards,
    Shyam Babu Sah.

    Hi,
    This question is for forum SAP Netweaver --> Workflow. There are functions and programmes that SAP delivers for this.
    [Example here|Re: How can I trigger workflow from my report]

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

  • How to trigger the workflow from the excel sheet

    hello friends,
    my problem is that i should trigger the workflow from a excel sheet which contains a list of appraisers and appraisees.how to do this. can anyone  help on this.
    thanks.

    Hi Murthy,
    If you are asking if a workflow can be started on R/3 while in Excel - may be possible if you can develop some fancy macros that can make RFC calls to an ABAP function module. I won't even attempt to travel that route.
    Save the excel sheet as CSV or Tab delimited file and process it using ABAP. You can use the WAPI function module SAP_WAPI_CREATE_EVENT (Rel 4.7)to start the Workflow by raising the relevant event. In earlier releases, see FM SWE_EVENT_CREATE.
    Please do keep in mind there could be performance and response time issues for dialog users of the system if you are going to start several workflows using a report program.
    Cheers,
    Ramki.

  • How to trigger the workflow from RFC

    Hi,
    I need to trigger a workflow from a RFC.How can I call the event and start my workflow?
    How can i do this?
    please advice.
    Thanks,
    Anand

    Hello Anand,
    Goto swetypv transaction.Mention the abap class/bor object with the corresponding event.
    In the receiver type, just mention some unique name.In the receiver function module mention the async RFC.
    Mention the SENDER     TYPE     SIBFLPORB                        Local Persistent Object Reference - BOR Compatible
    EVENT     TYPE     SIBFEVENT                               Event
    RECTYPE     TYPE     SWFERECTYP                               Name of Receiver Type
    HANDLER     TYPE     SIBFLPORB                               Local Persistent Object Reference - BOR Compatible
    EXCEPTIONS_ALLOWED     TYPE     SWEFLAGS-EXC_OK     SPACE     Checkbox
    XML_SIZE     TYPE     SWF_XMLSIZ                               Size in Bytes
    EVENT_CONTAINER     TYPE     SWF_XMLCNT                               Container as XML Stream of Fixed Width
    So that the guid can be used inorder to identify the instance.
    you can use : "sap_wapi_start_workflow" fn module.
    Hope this helps.
    Best Regards,
    Saujanya

  • How to trigger a workflow in webdynpro programs

    Hi Experts,
    I am new to SRM Workflow, and I need to trigger a workflow in my webdynpro programs.
    But I don't know how to achieve it.
    I am using SAP SRM 7.0, so I want to use Process Controlled workflow.
    Any suggestions would be greatly appreciated.
    Thanks and Regards
    Wei

    Hi, thank you for the attention, and my requirement is as below.
    1. Creating a web dynpro program
    2. User can execute the program and input data on it. Such as Expense application, Leave application...
    3. When the user click the "Apply" button on the form, the application should be sent to the boss for approval.
    *** I want to trigger a workflow when the user click the "apply" button.***
    I have achieved the similar functions in SAP ERP systems, by generating Events in my custom programs.
    But I don't konw how to do it in SRM 7.0.
    Or it is impossible to achieve it, under Process Controlled workflow architecture.
    Thanks and Regards
    Wei

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

  • How to trigger a workflow from event - newbie question

    Hi,
    I have a simple workflow, with the start node triggered by an XML event.
    What JMS destination I am supposed to send the XML document to in order for
    the workflow to be triggered. I thought that it was the wlpiEvent, but the
    workflow doesn't start. Also tried WLI_BPM_EVENT, with no joy.
    If anyone can point me in the right direction, then I would be grateful
    Lucy

    If it is one workflow sending a message to another, you can use internal destination.
    If it is another application then it would be WLI_BPM_EVENT ( which goes by the
    jndi name com.bea.wli.bpm.EventQueue in default installation ).
    "Lucy Collins" <[email protected]> wrote:
    Hi,
    I have a simple workflow, with the start node triggered by an XML event.
    What JMS destination I am supposed to send the XML document to in order
    for
    the workflow to be triggered. I thought that it was the wlpiEvent, but
    the
    workflow doesn't start. Also tried WLI_BPM_EVENT, with no joy.
    If anyone can point me in the right direction, then I would be grateful
    Lucy

  • Trigger an workflow from webdynpro abap.

    hai
    gurus!
        iam new to webdynpro.iam femilier with workflow . can anybody explain me with an clear example, how to trigger an workflow from webdynpro abap.
    regards
    rose

    Hi Rose
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/using%20web%20dynpro%20java%20and%20web%20dynpro%20abap%20applications%20in%20universal%20work%20list.pdf">Click</a> Here, to know the step by step procedure of using Webdynpro in Workflows
    Use SAP_WAPI_START_WORKFLOW RFC
    Regards
    Abhimanyu L
    Message was edited by:
            Abhimanyu Lagishetti

  • How to trigger a workflow though a class event

    Hi,
    I have created a class and included interface IF_WORKFLOW in the interface. Also created a event 'START' with one parameter. I have created a workflow and assigned the class event 'START' as its triggerring event.
    I want to trigger my workflow from a custom program. But I am not able to trigger the workflow by passing the event container.
    How do I start trigger the class event with the req. container element?

    Hi
    You could check the class CL_HRECM00_WORKFLOW_EVENT, together with the corresponding workflows of package
    PAOC_ECM_ADM_PLANNING_OVERVIEW.
    Best Regards
    Raquel

  • Workflow from abap program

    I created one workflow with a zbusines object. I did not create any event for the business object. only key fields and method.
    now my question is, how can I call or trigger the workflow from the abap program. please adive

    Hi Mat,
    u can use FM SAP_WAPI_START_WORKFLOW.
    Please find sample coding
    data: z_bus2080 type swc_object.
    data: begin of bus2080_key,
    id like viqmel-qmnum,
    end of bus2080_key.
    data: wf_cont type SWR_CONT occurs 0 with header line.
    parameters: qmnum like viqmel-qmnum.
    bus2080_key-id = qmnum.
    swc_create_object z_bus2080 'BUS2080' bus2080_key.
    Populate first container element - object type BUS2080
    clear wf_cont.
    move: 'BUS2080' to wf_cont-element,
    z_bus2080 to wf_cont-value.
    append wf_cont.
    Populate second container element - char variable USERNAME
    clear wf_cont.
    move: 'USERNAME' to wf_cont-element,
    sy-uname to wf_cont-value.
    append wf_cont.
    Call WAPI function
    CALL FUNCTION 'SAP_WAPI_START_WORKFLOW'
    EXPORTING
    TASK = 'WS94600159' "<-- Your workflow ID
    LANGUAGE = SY-LANGU
    IMPORTING
    RETURN_CODE =
    WORKITEM_ID =
    TABLES
    INPUT_CONTAINER = wf_cont
    MESSAGE_LINES =
    MESSAGE_STRUCT =

  • How to trigger a workflow using generic object services?

    Hi Experts,
    Let me know on how to trigger a workflow using generic object services.
    My requirement is to trigger the FI document reversal document using Object services.
    Any info or docs relevant to this, please share with me..
    Thanks,
    Dinesh.

    Dinesh,
    First of you need to check if the transaction has a BO (in released status) published to use the GOS.
    These are the pre-requisites for GOS
    http://help.sap.com/saphelp_46c/helpdata/en/94/aa532cddd511d289860000e8216438/content.htm
    Once done.. check that you have valid workflow linkages active for this BO.
    Now when you click on the 'start workflow' the system will show all relevant workflows for the BO to choose from and to start.

  • How to raise an event from a program

    Hi,
    I am creating a workflow for HR, the person will request a basic pay change than, this will start the workflow. For this i am making a screen from where i need to triger the event for the workflow.
    Does anybody has any idea? of how to raise an event from a program. or has anybody worked on a scenario like this
    Khusro Habib

    You can also use the FM SAP_WAPI_CREATE_EVENT which is a little newer I think. (I don't have access to a system today so that may not be the exact name of the FM but if you search SE37 under SAPWAPIEVENT* you should find it.
    the parameters will be the event name, and the object key.  The object key will be the key field of the workflow object you are using. 
    For example if you were using the saled document object then the object key would be the sales document number.  Carefull how you enter the object key, it can be a little tricky on whether or not you need the leading zeros in the input parameter. 
    Hope this helps.
    Brent

  • How to trigger sender rfc from r3 system

    Hi experts,
    can any body send  documents about " how to trigger sender rfc from r3 system"
    regards
    sandeep.

    HI Sandeep,
    To send RFC data on timely basis you can schedule the programs.
    In Partner Profile use setting collect program. Use program RSEOUT00 to send data at particular time.
    You can schedule the report RSEOUT00 according to your requirements. So it flushes all the idocs in the background as per your schedule this program.
    Plese refer the below thread, it will help you.
    Re: Triggering Idocs from sender  side
    Idoc triggering from a transaction
    Cheers..
    Vasu
    <i>** Reward Points if found useful **</i>

  • 2013 Workflows - Trigger a workflow from a Content Type

    So now that a workflow cannot be triggered from a Content Type, how are people doing this now? 
    Any suggestions appreciated.
    Thanks
    J Sykes

    Hi,
    According to your description, my understanding is that you want to trigger a workflow from a Content Type.
    As we all know, we can attach a workflow to a Content Type, but the workflow cannot run until the Content Type is added to a list or library.
    The elements of a list content type include the columns of metadata that are associated with the content type and workflows that can run on items of that content type.
    More information about the content type and workflow are provided in the link below:
    http://technet.microsoft.com/en-us/library/cc262735.aspx
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

Maybe you are looking for

  • Photoshop Elements 12 Editor crashing

    A number of people have posted about Elements Organiser crashing but I have a problem with Photoshop Elements 12 Editor and would be grateful for any suggestions on how to resolve them.  I have a 64bit Sony Vaio running Windows 7 OS.  I have been usi

  • Why can't i transfer my apps from iPhone to iTunes,file transfer does not work

    ive tried everything to get my apps to sync to my itunes i dont kno what im missing ive tried file trnasfer so many times.up at the top of itunes where it shows all the apps downloading the bar under that wont load i dont kno if it has something to d

  • How to modify column width in sql output

    hi when i display phone number in the output in sql plus it is displaying as follows: SQL> select mobile_no from purchase_history; MOBILE_NO 9.1971E+11 how to correct it.....i tried with column format..but its still not working....

  • Safari closed unexpectedly and will no longer open.

    Safari froze while I was on my MacBook Pro.  Laptop is current with updates and operating system.  I was unable to force close the app, so I restarted my computer.  Now safari will not open.  Thoughts?  Ideas?

  • CALL TO COLUMN IN TITLE IN PIVOT TABLE

    Hi all, In Oracle BI Asnwer i create a pivot table and i want to call a column data(column data in criteria), i think that i call with "@" and name column or position column, i think this because in gauge i can do it, i put "@1","@2","@3",.... "@+pos