Skip to Content

How to chnage work flow initiator

Dear All,

   I have an workflow which triggers on creation/ change of contract agreement tcode - ME31K or ME32K. Work flow is working fine. I am using class local class methods to get approvers etc.

I have created custom container I_LV_INITIATOR inside work flow.

Whenever user is changing the contract through ME32K , value of container I_LV_INITIATOR is filled with

user id of person who has created the contract .

But the requirement is if purchase document category (EKKO-BSTYP) = 'K' then I want this container I_LV_INITIATOR

to be filled with user id of person who has changed the contract not with the one who has created the contract. and If I manually test the work flow from SWUS , value of container I_LV_INITIATOR is filled with user id of person who is manually processing the work flow.

Kindly help or give any suggestion f we could achieve this in enhancement or exits.

Thanks,

Arpita

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Oct 19, 2015 at 07:58 PM

    I queried this with OSS a while back and apparently it's "by design", POs and Contracts will always show the PO creator as initiator for any changes.

    They came close to admitting it was a stupid design, but it's been like this for too long and too many customers have made provision for it so SAP won't change it.

    So the answer as per this thread is to determine who last changed it at the beginning of the WF.

    Regards,

    Mike

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 15, 2015 at 07:04 AM

    HI,

    Can you share binding for container element I_LV_INITIATOR.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Arpita Save

      If you can't check the value of EKPO-BSTYP directly in the workflow then add an attribute to ZBUS2014 that returns the userid of the user who last changed the contract. Make sure you delegate BUS2014 to ZBUS2014 - after that you do not reference ZBUS2014 anywhere (only BUS2014). Then in the workflow just pass that attribute to IV_WF_INITIATOR.

  • Oct 15, 2015 at 03:50 PM

    Hi All,

    I will also add that I am avoiding putting the workflow initiator as agent or as a base to find my agent.

    The reason is simply that if the workflow administrator has for one reason or another to restart the workflow then the workflow initiator will be the administrator and this could lead to error.

    So as a recommandation always calculate (via an expression) the agent and do not take the easy way of using this variable.

    Best regards

    Stephane

    PS: I would be happy if you share your view with me on this subject

    Add comment
    10|10000 characters needed characters exceeded