It is surprisingly difficult to get under the covers of the object classes driving object services. I am developing an application that collects signatures scrawled on a tablet PC using a Flex control embedded in a web dynpro. Once collected, a signed document will be attached to the underlying SAP object and accessible through object services.
As a first step, I wanted to upload a document and attach it using a custom program. Here is the source code of my solution.
REPORT zzzzzzzz.
PARAMETERS:
p_kunnr TYPE kunnr.
DATA:
ls_object_identity TYPE borident,
lo_gos TYPE REF TO cl_gos_document_service.
ls_object_identity-objkey = p_kunnr. "e.g. '0000954410'.
ls_object_identity-objtype = 'KNA1'.
CREATE OBJECT lo_gos.
CALL METHOD lo_gos->create_attachment
EXPORTING
is_object = ls_object_identity
IMPORTING
ep_attachment = ls_object_identity-objkey.
COMMIT WORK.
In the next post, I will show how to load binary data from a table as an attached file object.
5 comments:
Hi,
Instead of using the CREATE_ATTACHMENT method, is there anyway to manually code and pump in the attachment address path?
This would enable us to use this logic for any web service as the above method restricts.
This means that I do not want to use the pop up that allows users to browse and select the file they want to upload.
Instead, we hardcode the attachment file address path.
Is this do-able?
Exactly what I need to do CleanOcean. Any answer Peter?
Please let me know if you get a solution for this one
Please let me know if you find any way of doin this.....
Post a Comment