46C: Reversing an invoice - creating attachments

Kjetil Kilhavn kjetilk at statoil.com
Thu Oct 10 03:01:22 EDT 2002


In the end I had to program this myself (because I can't use container
operations to fill the parameters for the method). So I called the BAPI in
my own code and it works!
 
Actually it is a SOFM document I am attaching, not a note in the technical
sense - so I had to use ATTA. Although the attachment is a SOFM object it
can be attached with ATTA since MESSAGE (which has to be the object type
for the ATTA relation) is a subtype of SOFM. I simply hardcode a change of
type (bad boy, but it works :-)
--
Kjetil Kilhavn
 
 
 
 
 
 
                    R Tannert
                    <tnn at ornl.gov>              To:     SAP-WUG at MITVMA.MIT.EDU
                    Sent by: SAP                cc:     (bcc: Kjetil Kilhavn)
                    Workflow                    Subject:     Re: 46C: Reversing an invoice - creating attachments
                    <Owner-SAP-WUG at MITVM
                    A.MIT.EDU>
 
 
                    07.10.2002 23:09
                    Please respond to
                    "SAP Workflow Users'
                    Group"
 
 
 
 
 
 
Kjetil,
 
I haven't done this myself, but it appears you can use BOR method
OBJRELSERV.CreateRelation to attach an existing note or other
document to an object such as an invoice.  This method calls function
BAPI_REL_CREATERELATION.  Based on research into ABAP class
CL_GOS_DOCUMENT_SERVICE and the SGOS* functions, I expect you'll pass
the value 'NOTE' in the RELATION field of the OBJECTS parameter,
since you're dealing with a note.  (You would use 'ATTA' to attach a
usual SAPoffice document.)
 
I don't see any standard tasks based on OBJRELSERV.CreateRelation.
 
In case you don't find exactly what you need, you should be able to
build something fairly easily.  The class and functions I mentioned
above should have everything you need.
 
Rob
 
>When a manager refuses to accept an invoice which has been blocked for
>payment (the situation should of course ideally never occur because it
>should be caught before it was posted) the manager creates a note to
>explain why he/she will not accept it. I would like to attach this note to
>the invoice which should be reversed, but I can't find any method neither
>for any of the objects I was hoping could supply such a service (BUS2081,
>BKPF, SOFM).
>
>Is there no such method, i.e. are the object services not available
through
>an API?
>Can't help it, I find that difficult to believe....
>
>After a peek in The Book the class CL_GOS_SRV_ATTACHMENT_CREATE was
>discovered, but of course: Document CL_GOS_SRV_ATTACHMENT_CREATE is not
>available in language EN
>--
>Kjetil Kilhavn
>
>-------------------------------------------------------------------
>The information contained in this message may be CONFIDENTIAL and is
>intended for the addressee only. Any unauthorised use, dissemination of
the
>information or copying of this message is prohibited. If you are not the
>addressee, please notify the sender immediately by return e-mail and
delete
>this message.
>Thank you.
 
 
 
 
 
-------------------------------------------------------------------
The information contained in this message may be CONFIDENTIAL and is
intended for the addressee only. Any unauthorised use, dissemination of the
information or copying of this message is prohibited. If you are not the
addressee, please notify the sender immediately by return e-mail and delete
this message.
Thank you.
 


More information about the SAP-WUG mailing list