SO_DOCUMENT_INSERT_API1(suggested a while ago by Jocelyn Dart )

Dart, Jocelyn jocelyn.dart at sap.com
Wed Feb 11 19:14:15 EST 2004


Hi Monica,
You need to create a task and method to instantiate a SOFM object reference from
the folder number, document id, etc.  E.g. you could add a method to a delegated subtype of SOFM.
 
Then you can pass it to the "attachments" element of the selfitem.sendtaskdescription step.
Regards,
Jocelyn
 
-----Original Message-----
From: SAP Workflow [mailto:Owner-SAP-WUG at MITVMA.MIT.EDU] On Behalf Of M Doe
Sent: Thursday,12 February 2004 6:08 AM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Re: SO_DOCUMENT_INSERT_API1(suggested a while ago by Jocelyn Dart)
 
 
Hello all,
 
The mystery is solved- the reason I was not seeing the folder and the
documents with the workflow is because the task was background and the
workflow user then becomes  wf-batch and therefore the folder was created in
the wf-batch's inbox instead of mine.
 
When I was running the pgm - I was the user and I could see the folder in my
inbox.  Even though in my code, I enter the user name as myself - but for
some reason it takes wf-batch as the user when the code is part of the
workflow.
 
Now I need to move on to the next step.  Let me explain why I am doing all
this- I need to send an object as an attachment with the
selfitem-sendtaskdescription method.  I looked at the archives to find the
answer and some time ago Jocelyn Dart had suggested that you can insert the
document in the folder using the function module "SO_DOCUMENT_INSERT_API"
and then return the resulting document id as a SOFM object and pass it to
the sendtaskdescription step.
 
I am able to put the document in the folder as object in my outbox or inbox
but how do I return the resulting document id as a SOFM object.   In my code
I am importing the document_info into doc_info.  I am then getting the
doc_id out of doc_info.  But my question is how do I make this a SOFM OBJECT
and when I pass it to the sendtaskdescription step do I do the binding with
the attachment element.
 
CALL FUNCTION 'SO_DOCUMENT_INSERT_API1'
-------
IMPORTING
document_info = doc_info
----
-----
DOC_ID = DOC_INFO-DOC_ID.
 
 
Any help would be appreciated.  If you are reading this Jocelyn - then
please explain the final step.  You had suggested this solution in 2002 so
it is going back a while.
 
Thanks.
 
 
Regards,
Monica
 
 
 
>From: Sergey Breslavets <sergey.breslavets at epstechnology.com>
>Reply-To: SAP Workflow Users' Group <SAP-WUG at MITVMA.MIT.EDU>
>To: SAP-WUG at MITVMA.MIT.EDU
>Subject: Re: SO_DOCUMENT_INSERT_API1
>Date: Tue, 10 Feb 2004 11:11:30 -0600
>
>Monica, i came accross the issue with SO documents before - in my case the
>problem was with using the wrong folder (wf-batch tried to create document
>in my private folder) - I think i have switched it to using shared folders
>and it worked. Unfortunately, i don't have immediate SAP access to check
>that... do security trace when executing your workflow, if there's access
>control problems you'll see it. Also double check parameters for the FM to
>make sure you use correct folders.
>
>god luck,
>Sergey
>
>
>-----Original Message-----
>From: M Doe [mailto:monica_sap at hotmail.com]
>Sent: Tuesday, February 10, 2004 10:32 AM
>To: SAP-WUG at MITVMA.MIT.EDU
>Subject: Re: SO_DOCUMENT_INSERT_API1
>
>
>Hi Stephan,
>
>I tried putting the "commit work" statement in my pgm.  It did not make a
>difference.
>
>The pgm works and creates a folder in my outbox with the document as it was
>doing before.  But the workflow even though it says completed does not
>create a folder in the outbox.  I am using the same pgm behind the method
>in
>the workflow.
>
>If the workflow did not create the folder- how do I debug it to find out
>what went wrong?
>
>Regards,
>Monica
>
>
>
>
> >From: "Becker, Stephan" <stephan_becker.ext at siemens.com>
> >Reply-To: SAP Workflow Users' Group <SAP-WUG at MITVMA.MIT.EDU>
> >To: SAP-WUG at MITVMA.MIT.EDU
> >Subject: Re: SO_DOCUMENT_INSERT_API1
> >Date: Tue, 10 Feb 2004 16:05:45 +0100
> >
> >Seems you're lacking a commit work.
> >Stephan
> >
> >-----Mensaje original-----
> >De: M Doe [mailto:monica_sap at hotmail.com]
> >Enviado el: 10 February 2004 15:59
> >Para: SAP-WUG at MITVMA.MIT.EDU
> >Asunto: Re: SO_DOCUMENT_INSERT_API1
> >
> >Hi Sergey,
> >
> >Thanks for your response.  I checked the authorization for wf-batch.  It
> >has
> >SAP_ALL and SAP_NEW in the proflie.
> >
> >What could be wrong here?
> >
> >Regards,
> >Monica
> >
> >
> >
> >
> > >From: Sergey Breslavets <sergey.breslavets at epstechnology.com>
> > >Reply-To: SAP Workflow Users' Group <SAP-WUG at MITVMA.MIT.EDU>
> > >To: SAP-WUG at MITVMA.MIT.EDU
> > >Subject: Re: SO_DOCUMENT_INSERT_API1
> > >Date: Mon, 9 Feb 2004 15:48:27 -0600
> > >
> > >check authorization for wf-batch
> > >
> > >-----Original Message-----
> > >From: M Doe [mailto:monica_sap at hotmail.com]
> > >Sent: Monday, February 09, 2004 3:40 PM
> > >To: SAP-WUG at MITVMA.MIT.EDU
> > >Subject: SO_DOCUMENT_INSERT_API1
> > >
> > >
> > >Hello all,
> > >
> > >I am trying to insert a document in a user's outbox using the function
> > >module "SO_DOCUMENT_INSERT_API1" .  I created a subtype to SOFM and
> >coded
> > >this method.  This  works fine( I see the document in the user's
>outbox)
> > >when I execute the method from swo1 but when I use this method in a
>task
> > >nothing happens.
> > >
> > >I also wrote a pgm with the same code and executed the pgm and it works
> >but
> > >the same code does not work when it is used in the workflow.
> > >
> > >Can someone explain why?  I just don't understand what could be wrong.
> >The
> > >underlying code works so why does it not do anything when I have a task
> > >that
> > >uses this method.
> > >
> > >Thanks.
> > >Monica
> > >
> > >_________________________________________________________________
> > >Let the advanced features & services of MSN Internet Software maximize
> >your
> > >online time. http://click.atdmt.com/AVE/go/onm00200363ave/direct/01/
> >
> >_________________________________________________________________
> >Let the advanced features & services of MSN Internet Software maximize
>your
> >online time. http://click.atdmt.com/AVE/go/onm00200363ave/direct/01/
>
>_________________________________________________________________
>Click here for a FREE online computer virus scan from McAfee.
>http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
 
_________________________________________________________________
Keep up with high-tech trends here at "Hook'd on Technology."
http://special.msn.com/msnbc/hookedontech.armx
 


More information about the SAP-WUG mailing list