on 03-27-2008 8:06 PM
Hello,
I'm migrating BOR tasks to ABAP OO (some compatibility issue arose) using a task with a class/method. The method is static like the BOR method was instance independent.
Inside my method I need to retrieve the workitem ID. In BOR method I used the macro swc_get_element to retrieve the workitem object and then the workitem ID. How do I do the same thing in a class method?
I tried using the IF_SWF_IFS_PARAMETER_CONTAINER but it is only usable in instance methods. Does the method need to be instance based?
Thanks.
Hello,
Simple trick using automatic method binding: create an import parameter _WORKITEM (the name is important) type SIBFLPORB, and it will automagically populate it at runtime with the workitem object. Since the ID is the key, you can just read _WORKITEM-INSTID and save yourself the trouble of instantiating the BOR object.
Cheers,
Mike
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
You can add the parameter as input parameter of the method. And then bind the id from the Wf : &_WORKITEM.WORKITEMID& to your parameter.
Hope it will help you.
Olivier
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If I bind the parameter from the WF to the task I will get the WF ID, not the workitem ID.
I tried to use the method binding to send the task ID to the method, but tha doesn't seem to work. The PFTC transaction is always asking I want to copy parameters to container, and the binding disappear a lot. The functionality seems to be bugged.
Anyway I can get the workitem ID from the workflow ID, I'll do that.
Hello,
Curious, I'm able to bind the task id (&_WORKITEM.WORKITEMID) to a method in the task builder.
Perhaps try to acces to the task via SWDD instead of directly going to PFTC.
Or try to put the value manually. If you have a look at SWI2_FREQ, at an item level, the field &_WORKITEM.WORKITEMID has the workitem id and not the workflow id.
Olivier
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.