cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger Message workitem and Transaction open

madhu_vadlamani
Active Contributor
0 Kudos

Hi All,

I am working on workflow ws20001004 and  everything working fine.Now the one issues if i open the work item window for option approve,reject and keep in inbox parallel MIR7 in change mode .I am not getting any error message like window is open in change mode . Is this option possible.

Regards,

Madhu.

Accepted Solutions (0)

Answers (1)

Answers (1)

I042439
Employee
Employee
0 Kudos

Hi Madhu

The standard workflow WS20001004 sends a decision item via task TS20000881 to the user.

This does not checks for locks because it is a generic decision based on standard BO DECISION, method PROCESS which is used system wide for Approve/Reject.

if we look at the standard workflow, after rejection it sends a workitem for EDIT, which will obviously check for locks as you will go in edit mode.

If the user approvers, it will go for release in background - the step would call method PreliminarySetApproved of BO BUS2081 which does pass  back exceptions. The step will go in error and will have to be picked up by the workflow admin in case it is locked

If you need a functionality like what you have mentioned, you will have to make a custom task of your own which checks for the lock first and then displays the decision option.

Regards,

Modak

madhu_vadlamani
Active Contributor
0 Kudos

Hi Modak,

Thanks for your reply. Can you give some more information how can i proceed to create a new task.

Regards,

Madhu.

I042439
Employee
Employee
0 Kudos

Now I am not sure if this will work....you have to try it........

Another approach is to force an EDIT instead of DISPLAY (which happens currently)

Copy the workflow WS20001004 into a custom workflow, activate the event linkage and then just change the following in the workflow definition:

By forcing the method EDIT instead of Display, will make the system go for EDIT transaction mapped in BUS2081.EDIT method (which is MIR4 going by the description). I would assume that that the system should throw a lock error.

Regards,

Modak

I042439
Employee
Employee
0 Kudos

to copy

go to PFTC -> give WS20001004 and Copy. Then go to triggering events tab and activate linkage.

Then go to workflow builder and navigate to the highlighted step

Message was edited by: Modak Gupta  ......................... if this works, remember to deactivate the standard workflow event linkage else there will be two instances...one from your custom WF and one from your original workflow

madhu_vadlamani
Active Contributor
0 Kudos

Hi Modak,

Thanks. The same way i am using the method to display the invoice via mir4 when he click on the workflow item.As you said may be i need to create a new version for this workflow and use method edit and see .

madhu_vadlamani
Active Contributor
0 Kudos

Hi Modak,

I can not go with this method edit object in item.Is there any other option like because in mir7 when i can click service for object -> workflows -> workflw objects. I can see the log here. Is there any option to show this as message ?

Regards,

Madhu.

I042439
Employee
Employee
0 Kudos

Hi Madhu

Why do you think that Services For Object will be affected if we use EDIT method of the same BO instead of the Display Method?

GOS Workflow List looks for the associated BO (which remains same in the proposed case) and then searches for the workitems associated with that BO. It does not searches with the workflow number WSxxxxxxxx. So if you keep everything same and just change to EDIT method in your custom workflow, it will not affect the GOS services for object for workflow lists.

Regards,

Modak

madhu_vadlamani
Active Contributor
0 Kudos

Hi Modak,

Thanks for reply. Do now want to give to change option to user.Is there any option like to trigger message when click on item in inbox. Please give some ideas.

Regards,

Madhu.

I042439
Employee
Employee
0 Kudos

Hi Madhu

You may have to do some coding then.

Create a method which checks for a loc and place it before the DISPLAY method.

You have various options.

  • Create a copy of the standard workflow
  • Create a class and instantiate it in your custom workflow
  • Create a method to check for lock and give an error
  • Call that method as a Method BEFORE execution

Or

  • Create a subtype of BUS2081, say ZBUS2081
  • Maintain a delegation between the two
  • Create a method in ZBUS2081 to check for lock and issue error
  • Create a copy of the standard workflow
  • Call that method in Method BEFORE execution of the step (referencing via BUS2081 instance)

Or

  • Create and delegate a subtype
  • Create a new method by copying  DISPLAY method
  • Add the code to check for lock before Displaying MIR7 - issue error if locked
  • Create a copy of the standard workflow
  • Use that Method instead of DISPLAY
  • NOTE: DO NOT Re-define DISPLAY method as it can affect other places where it is used.

Or

  • Create a Program exit interfacing IF_SWF_IFS_WORKITEM_EXIT or IF_SWF_IFS_DECISION_EXIT
  • Code EVENT_RAISED for event SWRCO_EVENT_BEFORE_CREATION
  • Read the Workitem container to get the BO Key
  • Check for lock and issue error
  • Create a copy of the standard workflow
  • Plug that Program exit in your decision task
  • This is not advisable as this may disrupt the workitem LUW

Regards,

Modak

madhu_vadlamani
Active Contributor
0 Kudos

Hi Modak,

Thanks. Right no i am using delegation of BUS2081. Using this method i am getting cost center and the respective user . I will create another method and use, can you give some idea like ho to check the lock object.

Regards,

Madhu.

I042439
Employee
Employee
0 Kudos

Hi Madhu

hope you know ABAP.....now I feel that you are being lazy   ... Just joking buddy!

In your (instance dependent) method, get the BELNR and GJAHR using

LV_BELNR = object-key+0(10).

LV_GJAHR = object-key+10(4).

then call FM ENQUEUE_E_RBKP to lock using this key.

If you get an exception , issue error that it is locked by someone else

(maybe try to see what is in SY-MSGID, SY-MSGTYPE, etc. to see if system provides the user name in the default error message variables and you can use it)

If there is No Exceptions, remember to Unlock first using DEQUEUE_E_RBKP and then move to DISPLAY

regards,

Modak

I042439
Employee
Employee
0 Kudos

NOTE - I am a little worried that issuing type 'E' message may result in workitem going in an error.....not too sure. If it does, try issuing type I message.

madhu_vadlamani
Active Contributor
0 Kudos

Hi Modak,

Thanks. Aware of this functions but i thought you may have good idea as an Expert in workflow. I will check and see my luck.

Regards,

Madhu.

madhu_vadlamani
Active Contributor
0 Kudos

Hi,

Thanks. I am not using message just triggering a mail depends on status.

Regards,

Madhu.

I042439
Employee
Employee
0 Kudos

Hi Madhu

so, is the issue resolved or you still need our assistance?

regards,

Modak

madhu_vadlamani
Active Contributor
0 Kudos

Hi Modak,

It is done. Thanks.

Regards,

Madhu.

former_member185167
Active Contributor
0 Kudos

Please mark the thread as Answered.