Workflow object key

Hi Experts,
Now im working with appraisal workflow. For this the object key is 'Appraisal ID'. Now my requirement is when i create the appraisal process from transaction 'appcreate' means the appraisal ID will be generated. Now i need to get the appraisal ID from my zprogram.
How can i achieve that?
All suggestions will be highly appreciated.
Thanks.

Hi,
Once an appraisal id is generated, an event will trigger the workflow.
if the workflow is customized & if you know the workflow number, you can fetch the appraisal id from swwwihead table, by passing the workflow number.
or
you can use the macro too in your zprogram by using the include & following code.
SWC_GET_OBJECT_KEY <Object> <ObjectKey>.
or
the object key will be present in the workflow container, you can use it in your method.
Depending on your requirement you can use the above mentioned approaches.
Thanks
Mehreen

Similar Messages

  • To get the Workflow status using the Object Key

    Hi Experts,
    Do we have any transaction code or a Standard table where I can see the status of the Workflow using the Object Key.
    For example I have an Invoice Document number for which a Workflow has been triggered and now I want to see the which workflow has been triggered and what is the status for the same. I have only the Invoice Document Number.
    I think I can use the SWI1, SWEL etc but I don't have Object key as Input field.
    Thanks in advance.
    Regards,
    SRinivas

    Hi,
    You can find the workitem id in table SWW_WI2OBJ.
    Here you need to pass the invoice number in "Instacne ID" with leading zeros, business object in Object type.
    This may take little bit longer time.
    After getting the workitem number then look into table SWWWIHEAD for the workitem status.
    Thanks and regards,
    SNJY

  • Workflow status based on object key

    Hi all,
    How can we  know the status of workflow(Processing or completed) based on object key?
    Thanks,

    Hi
    1.If you have the BOR key and the name of the BOR then you can make use of the FM SAP_WAPI_WORKITEMS_TO_OBJECT the result of the function module would return you the top/parent workitem ID of the worklow which acted asa receiver.
    2. Once you have the top/parent workitem ID then try to pass the same workitem ID to SAP_WAPI_GET_WORKITEM_DETAIL  this would return you the SWWWIHEAD table entry. From the result structure check the field value WI_STAT ,  this would have the right status of the workflow whether it got completed or still in process state.
    Regards
    Pavan

  • For a BO and Object Key a particular workflow already triggered or not?

    Hi ,
    I want find for an Object Key and Event is there any workflow Trigger or not.
    e.g. My ObjectKey = “400001210000000626” and Event = “CREATED” and Worflow No = “WS91100022”.
    I want to Know Whether this workflow (WS91100022) is triggered for this same Object Key (400001210000000626). Where I can find is there any table will have entry .
    Can you please tell me?
    Regards,
    Surjith

    Hi surjith,
    Us this FM to get all the wfs triggered. This really works
    /Function Module to get all the work items created based on the key of object
          CALL FUNCTION 'SAP_WAPI_WORKITEMS_TO_OBJECT'
            EXPORTING
              objtype                  = lws_objtype
              objkey                   = lws_objkey
              top_level_items          = 'X'
              selection_status_variant = 0000
              text                     = 'X'
              language                 = sy-langu
            TABLES
              worklist                 = lws_worklist.
    regards,
    sheron

  • Set the Object Key while starting the Workflow

    Hi Experts,
    I am trigerring a workflow using the fm "SAP_WAPI_START_WORKFLOW". I am using a custom business object for my workflow
    and would like to know how we can set the object-key(i.e key attribute) for this business object at the start of the workflow so that it  can be used in the various tasks of the workflow.
    Thanks in Advance,
    Chaitanya.

    Hello,
    Please search this forum for SAP_WAPI_START_WORKFLOW and you'll see how it's done.
    Basically:
    lv_object_instance-objtype = 'FORMABSENC'.
    lv_object_instance-objkey = '0000000088'.
    lt_wf_cont-element = 'ABSENCEFORM'.
    lt_wf_cont-value = lv_object_instance.
    append lt_wf_cont.
    CALL FUNCTION 'SAP_WAPI_START_WORKFLOW'
    TABLES
       INPUT_CONTAINER          = lt_wf_cont
    Note that it's advised to use events instead of starting the workflow directly like this, if possible.
    regards
    Rick Bakker
    Hanabi Technology

  • Object Key for PO

    Hi Guys,
    I had a requirement where i need to call a particular FM whenever a PO is getting created/changed. I had the Object Type and the event which is called when a PO is changed. How can i link the Event and the FM in R/3.So that whenever that event is called it triggers that FM Importing the Object Key.
    Thanks,
    Kittu.

    Hi Kittu,
    As far as i know we cannot link a Business Object - Event to a FM directly. We can trigger a workflow whenever a Business Object - Event occurs and in this WF we can create a Step Type: Task to which we can attach the FM.
    So whenever this event occurs the WF is triggered and you FM gets executed.
    Please let me know if further details are required.
    Regards,
    Goutham.

  • What does "object-key-..." refers to ?

    Hello Workflow Fans !
    Another question... when I look at the ABAP code of a BOR Object Method that refers to, as an example, object-key-customerno... what does "object-key" truly refers to ?  Does it refers to "&_WI_OBJECT_ID& ?
    See code example:
    begin_method o23_maj_ecd changing container.
    SET PARAMETER ID 'KUN' FIELD object-key-customerno.
    CALL TRANSACTION 'XD05'.
    Thanks in advance for your precious help.
    José

    Hello Rick,
    Thanks for your prompt answer.  Considering that my workflow handles multiple different business object through the course if it's lifecycle, I am just wondering how SAP translates "object-key" considering it uses different business objects.  Does it come from the "binding" ? If so, the binding of this particular task looks like this:
    &ZBusObj1& -> &ZBusObj1&
    &ZBusObj2& <-> &_WI_OBJECTY_ID&
    ... then, if I use "object-key" in the code of my methode being called by this task, does it refer to &ZBusObj1& or &_WI_OBJECT_ID& ?  I'm trying to understand how SAP translates "object" in this context !
    Thanks.
    José

  • Object key for object type WORKITEM is not generated

    Hi experts,
    I have a problem when I create a purchase requisition by workflow. This problem happens a client copy from production to quality system has been done.
    The problem is that the object key for the object type WORKITEM is not generated. I check in transaction SWEL in quality system it displays the following data:
    For the event data I have the following data:
    Event Instance ID - 1099124
    Object Type - BUS2105
    Object key - 0120001588 (purchase requisition number)
    Event - criadaoumodificada (createdorchanged)
    For the Receiver Data I have the following data:
    Receiver Type - WS99900003 
    Object Type  (is not displayed)
    Object Key   (is empty)
    Receiver FM - SWW_WI_CREATE_VIA_EVENT_IBF
    RFC Destination - WORKFLOW_LOCAL_010
    In the Receiver Data the object type is not displayed and the object key is not generated. In production system the object type is WORKITEM, and the object key is filled by a number of workitem.
    Can anyone tell me why this happens?
    Best regards,
    Leonel

    Hi Leonel,
    as far as I remember, those fields are updated once the receiver function module was successfully processed. In your case, I'd suggest, that you ...
    - Check the workflow local RFC destination (SM59, WORKFLOW_LOCAL_<client>)
    - Check the workflow-user (SU01, User-ID WF-BATCH normally),
    - Check for entries that stuck in the event processing (tRFC queue, transaction SM58).
    - To verify the complete system, execute transaction SWU3. The section under "Runtime environment" should be marked green.  (Ignore the red sign on definition environment).
    - For a more extensive workflow runtime check, use the transaction SWUD  (workflow diagnosis).
    After all that, your problem might be solved, or at least you know, what's all okay
    Best wishes,
       Florin

  • How to attach event to custome workflow object ?

    Hi Guys,
    Could someone help me on how to raise event while creating custom workflow object.We can attach event to object in transaction swe2 . I would like to know how to create that event. Could some send sample custom workflow object with events.
    Many thanks in advance.
    Cheers,
    Garrick.

    Here's an example  using Business object BUS2080  Service notification
    I delegated ZBUS2080 to BUS2080 (service notification).  Added 2 Events REASSIGNED and MODIFIED.
    Use transaction SWO1 for manipulating business objects.
    The User performs an action on a service notification  (IW52) say PUT IN SERVICE AGAIN.
    When the user puts the service notification in service again the event triggered will start a (user defined) workflow which makes a call to a method in the business object ZBUS2080 which launches a batch job.
    This batch job creates our user event REASSIGNED which in turn calls a new workflow to be executed.
    This workflow performs the action I want -- in this case to re-assign the service notification to a new person, send an email and escalate the deadlines
    Code samples are shown below.
    So here's how it works.
    First you need to set up some entries with table SWE2. I've assumed you've already defined the events to the Business object(s) you want to use.
    In SWE2 define entries for BUS2080 (or ZBUS2080) For Events INPROCESSAGAIN and (our event) REASSIGNED.
    IN SWE2 define the receiver call as a FUNCTION MODULE
    For the receiver function modules  for the SAP event (INPROCESSAGAIN) define the receiver module as SWW_WI_CREATE_VIA_EVENT
    For the event REASSIGNED define the receiver module as SWW_WI_CREATE_VIA_EVENT_IBF.
    I have no idea whatwhat the difference is between the two but the process works when it's done like this.
    Ensure the linkage Activated box is clicked in both cases.
    Put your workflow numbers in the RECEIVER TYPE in SWE2 table.
    In the first workflow when the user puts the service notification in service ensure your workflow starts a batch job which raises another event
    Note : You need to instantiate the object (I.e supply the key) to trigger the event correctly. The key is obtained from the WF and will be in the container anyway.
    You can do this by adding this type of function module into the method of the business object you want to execute during the first workflow. The code here creates a batch job which submits the EVENT creating program.
    function z_create_event_for_cs.
    ""Local interface:
    *"  IMPORTING
    *"     REFERENCE(OBJECT_KEY) LIKE  SWOTOBJID-OBJKEY
    *"     REFERENCE(W_REASON) LIKE  HRPXXXX-DUMMY
    *"     REFERENCE(W_ESCLEVEL) LIKE  HRPXXXX-DUMMY
    Create Batch job to run ZZREASSIGNCS
    which creates event REASSIGNED in Customer query workflow.
    data: jobnr like tbtcjob-jobcount,
          jobname like tbtcjob-jobname,
          pgmname  like sy-repid,
          w_key like viqmel-qmnum,
          w_code type c,
          w_num  type c.
          w_num = w_esclevel.
          jobname = 'CREATEEVENT'.
        pgmname = 'ZZREASSIGNCS'.
    call function 'JOB_OPEN'
      exporting
        jobname                = jobname
    importing
       jobcount               =  jobnr
    CHANGING
      RET                    =
      exceptions
       cant_create_job        = 1
       invalid_job_data       = 2
       jobname_missing        = 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.
    call function 'CONVERSION_EXIT_ALPHA_INPUT'
    exporting
      input =  object_key
      importing
      output = w_key.
    w_code = w_reason.
    if w_code = ' '.
    w_code = 'Z'.
    endif.
    submit zzreassigncs
    with p_key = w_key
      with p_escl = w_code
      with p_escnum = w_num
      via job jobname number jobnr
      and return.
    call function 'JOB_CLOSE'
      exporting
         jobcount                          = jobnr
         jobname                           = jobname
       strtimmed                         = 'X'
      exceptions
        cant_start_immediate              = 1
       invalid_startdate                 = 2
       jobname_missing                   = 3
       job_close_failed                  = 4
       job_nosteps                       = 5
       job_notex                         = 6
       lock_failed                       = 7
       invalid_target                    = 8
       others                            = 9
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    endfunction.
    For the actual program which creates the event  use something like this
    program zzreassigncs.
    This program creates an event REASSIGN
    This triggers a "clone" of the initial customer query workflow
    which is now marked as completed.
    The deadline and escalation level from the original workflow
    should be passed to the new workflow via the event container
    Program is submitted from the original workflow
    Ensure transaction SWE2 has the event REASSIGN for bus object BUS2080
    defined or the WF won't start even if the event is raised correctly
    As this program is run as a background / batch task
    you need to obtain the relevant notification number and pass it
    as a parameter.
    When run from the WF the you can get the notification number obtained
    from the workflow / task  container.
    include <cntn01>.   "For WF macros.
    parameters: p_key like swotobjid-objkey,  "Service notification number
                p_escl type c,
                p_escnum type c.
    constants: c_event    like swetypecou-event   value 'REASSIGNED',
               c_attrib   like swotra-attribute   value 'USRSTATUS',
               c_object   like swetypecou-objtype value 'BUS2080'.
    data:     w_object like swotobjid,
              w_stat     like  tj30t-txt04.
    data: rc like sy-subrc.
    data: begin of event_cont occurs 0.
          include structure swr_cont.
    data: end of event_cont.
    data: begin of return.
      include structure swotreturn.
    data end of return.
    if running from WF rather than a batch job
    swc_container container.
    swc_get_element container  'Znumber' p_key.
    w_object-objkey = p_key.
    w_object-objtype = 'BUS2080'.
    call function 'SWO_PROPERTY_GET'
    exporting
        object                = w_object
        attribute             = c_attrib
      changing
        value                 =  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.
    w_stat = return(4).
    event_cont-element = 'Status'.
    event_cont-value = w_stat.
    append  event_cont.
    event_cont-element = 'Escalated'.
    event_cont-value = p_escl.
    append event_cont.
    event_cont-element = 'Escalation'.
    event_cont-value = p_escnum.
    append event_cont.
    Note WAPI calls only valid from rel 6.1 using Webflow engine
    (part of standard WF since rel 6.1)
    CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
      EXPORTING
        OBJECT_TYPE           =   w_object-objtype
        OBJECT_KEY            =   w_object-objkey
        EVENT                 =   'REASSIGNED'
      IMPORTING
       RETURN_CODE           =  rc
      EVENT_ID              =
    TABLES
       INPUT_CONTAINER       =  event_cont.
    if rc <> 0.   "Houston ---We have a problem !! '
      write: text-002 color col_negative.
      exit.
    endif.
    even though no database / table is updated here by the event
    we still need the commit work to initiate the event correctly
    commit work.
    You CAN use Objects (OO ABAP) but if you are fairly new to this sort of stuff just stick with standard BOR (Business objects) to parctice on until you've got the hang of the process.
    It's actually a lot simpler than most people realize --which is why WF consultants get paid decently !!!!.
    Cheers
    Jimbo

  • Workflow object enquiry

    Hello,
    Can anyone tell me how to display customer classification screen (XD02>extras>Classification)for a particular customer as work item in sap inbox.
    Which object i need to use...?
    I tried BUS3060 and BUS1088 iam not able to display that screen.
    Thanks,
    Larry

    Hi Larry,
    using the classification itself might be a little too complex. I suspect you would like to have an object link in the bottem right box and when you klick on it the customer's classification shall be shown in a new window?
    A pragmatic solution goes like this:
    Transactio swo1, enter KNA1, click "Create SubType".
    Fill in the new Subtype starting with Z and name it "CustomerClassification" or something useful.
    Then create a new Method "DisplayClassification" with no parameters and such.
    Within the object's method coding you can use the field object-key-customerNo to adress the current customer number.
    Display the classifcation by just execution XD02 with a batch-input that clicks on the menu button "Display classification".
    It's not very smooth but it'll work.
    To enable the "click" when you click on the object, enter the DisplayClassification as the DEFAULT METHOD for the object type.
    Then instantiate this new object within your workflow and pass it to the workitem.
    Good luck,
       Florin

  • Object key mapping in KSSK table

    Hi All,
    We are facing an issue wherein SAP BW Job is failing as it is not able to pull the data for Hierachy from SAP.
    When we checked the details it seems that there is an error entry in table KSSK.
    However- the table has class type 026 and object key value.
    We are not able to figure it based on the object key that what is error entry.
    I need info to trace back how to find out the error entry based on Object key from table KSSK.

    We had found out the entry which was erroneous and removed the entry.
    Find out the object key and connection between KLAH and KSSK table and they we deleted the erroneous entry from KSSK table. We spoke to SAP in this regards and the entry was created due to reclassification by user for one article.
    The entry was deleted from Table using SE16n.

  • How to get object key before load data into form?

    I need to get object key (e.g. ItemCode in Item Master Data From ,docEntry in A/R Invoice From) to calculate and do something  before data is loaded into this form .
    I try to use SAPbouiCOM.BusinessObjectInfo.objectKey as in this code.
    Private Sub oApp_FormDataEvent(ByRef pVal As SAPbouiCOM.BusinessObjectInfo, ByRef BubbleEvent As Boolean) Handles oApp.FormDataEvent
           If pVal.FormTypeEx = "672" And pVal.BeforeAction = True And pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_DATA_LOAD Then
                   oApp.MessageBox(pVal.ObjectKey)
           End If
    End Sub
    But this fields doesn't valid under this condition (form DI help file).
    - The property returns an empty value in the before notification of the Load action (et_FORM_DATA_LOAD) triggered by a Find operation.
    How can I get this value(key)?

    Janos
    I can't do a calculation after data is loaded because what I'm going to do is that if the opening entry match my condition , the system will not let that user see that entry (bubbleEvent = False).
    I think when formDataEvent is triggered B1 know which entry are going to load because before this event is triggered we did one of following ways
    1. choose from "choose from list windows"
    2. enter docEntry or itemCode or cardCode  and then press Find Button
    3. press "next/previous record button"
    4. press linked button (orange arrow)
    Choice 3 and 4 can be done by retrieve data from BusinessObjectInfo.objectKey (I've tested and it return entry key that is going to open correctly).
    but 1 and 2 can't (it return empty as I mention before).
    thanks
    Edited by: daron tancharoen on Aug 5, 2008 2:34 PM

  • Creation of new Personalization object keys

    Hi All,
    Is it possible to create new personalization object key for a role for eg: in SRM we have personalization objects keys BBP_SPEND_LIMIT and BBP_APPROVAL_LIMIT already defined by SAP. In case we need to define the same kind of spend limits for users in MM. Can we define new personalization objects keys ? If yes let me know what are the steps
    I am aware of the transaction PERSREG, but not sure of its uses.
    Regards,
    SC

    Hi,
    PERSREG is the right one for defining the pers.key.
    I think the problem will be, if and how your new key shall be handled by the applications coding....
    Maybe MM offers some exits or whatever to verify own personalizaiton keys?
    b.rgds, Bernhard

  • Event finds no receiver even though object key is OK

    Hello,
    can’t see what goes wrong here. I have a work item waiting for an event. I trigger the event for with the matching object key, but the event finds no receiver, and nothing happens.
    To elaborate,
    the asynchronous ‘Document review’ task has terminating events REJECT etc. from my ABAP (business) class ZCL_PROL. On the terminating events tab:
    _WI_OBJECT_ID  CL ABAP Class  ZCL_PROL   REJECTED
    I trigger the event using cl_swf_evt_event=>raise and from SWEL I see that the event has been created correctly, for the right object type and object key.
    On the other hand, from SWEINST I see that the ‘Document review’ work item is registered for the event. Table entry
    CL ABAP Class ZCL_PROL   REJECTED   WORKITEM  10000000000392    000000045550
    The class ZCL_PROL and the object key 10000000000392 in SWEINST are identical to what I see in SWEL.
    The method FIND_BY_LPOR must be fine, as the wf has proceeded to this point. And no issues to be seen in SWEQADM.
    Now, what goes wrong? Why doesn’t my work item react to the event?
    Message was edited by: Arto Pihlaja

    Anjan, Prakash, thanks for your lightning fast replies!
    I actually found the issue myself.
    I had
    cl_swf_evt_event=>raise(
         im_objcateg        = cl_swf_evt_event=>MC_OBJCATEG_BC
         im_objtype         = mv_objtype
         im_event           = gc_rejected
         im_objkey          = mv_instid
         im_event_container = mr_event_container
    Once I changed the object category to MC_OBJCATEG_CL, it started working. Clearly I had misunderstood the meaning of 'Business Class'. I changed back to regular CL, and it's fine.
    Once again, thanks for your activity!

  • How to create new object key in BDS?

    Hello,
    I need to create custom class in BDS (OT type) and object key for it.
    In this forum (and in the whole Internet) I found information only about custom class. However there's nothing about object key.
    How could I create new object key in BDS class?
    Great thanx in advance!

    Hi Max,
    you can create BOR object in business object repository, Transaction SWO1, SWO2, search documentaion for BOR obkect.
    Regards,
    Clemens

Maybe you are looking for

  • How to install Adobe CC with elevated admin rights?

    I am trying to install the trail version of Illustrator CC, but the install script comes back with the message "Installation Failed" Administrator priviedges are required to install. Please Install later." I can install programs on my computer, but i

  • Upload iTunes To iPod - Please help

    My daughter's iPod already has about 50 songs on it. When I plug it in to the cpu with iTunes open, I get a message prompt that I will have to erase all the songs currently stored on her iPod in order to "sync" with my iTunes library. Is there a work

  • How to unzip the 5 discs

    Hi all, I am student, so I'am a biggner. I am fun of linux and this period I have many things to learn about oracle db. When i have listened about OEL 3 day ago, I downloaded the 5 discs. But when i try to unzip them , some problems occur with some f

  • Business Components Client Methods

    I have a question regarding BC4J and client-callable custom methods. There are certain custom methods (ie to retrieve xml for that object and parse it with a stylesheet), that I've written for my BC4J Viewobjects that all ViewObjects in my project wi

  • How can i download activex control on my nokia e72

    i want to download activex control for my nokia e72 to view my ip address pls recomend me how to download it