Attachment to Workitem

Susan R. Keohan skeohan at mit.edu
Thu Jun 26 13:00:00 EDT 2003


Hi Jocelyn, Hans,
 
Thank you for the suggestions.  But here is what I learned.  I was able to attach the rejection
reason to the workitem with no problem using the FM SWL_WI_NOTE_CREATE_WITH_TABLE.  The problem came
in the last step, which was the notification back to the initiator.  This step uses the standard
decision task TS00008267.   Here, an overzealous workflow developer (OK, me) explicitly bound the
workflow container object 'Attachments' into the task container object 'Attach_Objects'.  When this
binding was removed, the attachment flowed with the decision task, without creating the erroneous
entries of container object 'Attachment' at the workflow header level.
 
So, the short lesson to be learned here is don't bind unnecessarily (or, don't try to force
something when some finesse (and testing) will do it better).
 
Thanks again,
Sue
 
Hans Brilleman wrote:
> Hi Sue,
>
> another way of doing this is instead of controlling the attchment from
> a method with a function module, is to use a SAP standard task -
> TS20000547.
>  This task will automatically poulate the workflow container with the
> office document without doing any special bindings.
>  All you need to ensure is that the decision making task (where you are
> rejecting the invoice, is syncronous and that the branching does not
> rely on event outcomes, but rather to get the result in the method and
> bind it all the way back to the workflow container. Use this result flag
> to do the branching.
>
> Furthermore you need to ensure that you link the attachment task in the
> workflow just before the step that prompts the capturer (workflow
> initiator) to do the change.
>
> This way works very stable.
>
> Hope this helps.
>
> Hans.
>
>
>>>>skeohan at mit.edu 06/23/03 05:32pm >>>
>>>
> Hi folks,
>
> I know there has been a lot of talk about attachments lately, so please
> excuse me if I go over
> ground that has already been covered.
>
> I am on 4.6c.  I have a custom approval task, that when the user
> rejects the object (Invoice), they
> are made to enter a rejection reason. I capture this text, and in my
> method, I call
> SWL_WI_NOTE_CREATE_WITH_TABLE, passing in the workitem ID and the text.
>  A later step in the
> workflow is to go back to the initiator and allow them to display the
> rejection reason in the
> attachment.
>
> Sounds OK so far ?  Here's the hitch.  Sometimes, and I cannot find a
> logicial reason why, the
> attachment does not come back to the initiator.  It is not in the
> binding to that step.  The
> attachment does exist, I can see it in the container at the
> parent-level workitem, but oddly enough,
> there are TWO container elements called 'attachment' and the first one
> is blank.  So, if you try to
> display the attachment at the parent level workitem, you get the
> message 'No attachments exist'.
>
> Other times the attachment goes along just fine.  The workflow
> initiator gets to see it in their
> workitem preview screen and to double-click on it to read the text.
>
> There is nothing in OSS about this FM having problems.  It is not
> returning any exceptions, as I
> trap for those (also, again, the attachment is in the container for the
> parent workitem).
>
> My user is very discouraged at this point, as am I.  Any assistance
> would be appreciated.
>
> --
> Susan R. Keohan
> SAP Workflow Developer
> MIT Lincoln Laboratory
> 244 Wood Street
> LI-200
> Lexington, MA. 02420
> 781-981-3561
> skeohan at mit.edu
 
 
--
Susan R. Keohan
SAP Workflow Developer
MIT Lincoln Laboratory
244 Wood Street
LI-200
Lexington, MA. 02420
781-981-3561
skeohan at mit.edu
 


More information about the SAP-WUG mailing list