on 01-17-2014 6:37 AM
Dear all,
I want to add attachment to the GOS service (like the original invoice document which was created). I have only found the function "ARCHIVOBJECT_CREATE_SYNCHRON" to add the content to archive. But I don't have a local file to get the path of the file with it. I have the content of the Attachment already at runtime in the programm and don't want to write a local file and then attach it with this function.
Has anyone an Idea how to add the attachment without having a local file?
many thanks.
All the outgoing document like scripts, smartforms and adobe forms can be archived as PDF to during run time by customization(refer archivelink documentation for this or else let me know if you need any info on this)
I had take "SGOSATTR" to SM30 to see what is the class that responsible for attaching and displaying the documents and found
TC -> SE24 class CL_GOS_SRV_ATTACHMENT_LIST contains Modify these two methods accordingly
Now I copied them to CL_GOS_SRV_ATTACHMENT_CREATE to ZCL_GOS_SRV_ATTACHMENT_CREATE to modify "EXECUTE"
method with below code.
ZCL_GOS_SRV_ATTACHMENT_CREATE(EXECUTE method)
DATA: ls_doc type bapi_doc_draw2,
ls_return type bapiret2.
DATA: lf_doctype Type bapi_doc_draw2-documenttype,
lf_docnumber Type bapi_doc_draw2-documentnumber,
lf_docpart Type bapi_doc_draw2-documenttype,
lf_docversion Type bapi_doc_draw2-documenttype.
DATA: lt_files Type table of bapi_doc_files2 ,
lt_drat Type table of bapi_doc_drat ,
lt_drad Type table of bapi_doc_drad ,
ls_files Type bapi_doc_files2,
ls_drat Type bapi_doc_drat,
ls_drad Type bapi_doc_drad.
*
ls_doc-documenttype = 'YBO'.
ls_doc-documentversion = '00'.
ls_doc-documentpart = '000'.
ls_doc-statusextern = 'IA'.
ls_doc-laboratory = '002'.
REFRESH lt_files.
CLEAR lt_files.
*
ls_files-sourcedatacarrier = '%COMPUTERN'.
ls_files-storagecategory = 'DMS_C1_ST'.
ls_files-docfile = 'C:\Users\Administrator\Documents\ChristofSpörk\TESTING_of_ ChristofSpörk_request.doc'..
ls_files-wsapplication = 'DOC'.
APPEND ls_files to lt_files.
CLEAR lt_drat.
REFRESH lt_drat.
ls_drat-language = 'EN'.
ls_drat-description = 'TESTING_of_ MARK_TRAVIS_request'.
APPEND ls_drat to lt_drat.
*
CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
EXPORTING
documentdata = ls_doc
IMPORTING
return = ls_return
TABLES
documentdescriptions = lt_drat
documentfiles = lt_files.
*
IF ls_return-type CA 'EA'.
ROLLBACK WORK.
WRITE : ls_return-message.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = '9'.
DATA: doknr TYPE doknr.
GET PARAMETER ID 'CV1' FIELD doknr.
CALL TRANSACTION 'CV02N' AND SKIP FIRST SCREEN.
ENDIF.
This way the documents can be attached to store in DMS.
Please Close the thread if this reply is helpful to you. It helps others to know the right answer.
BOL
Kolusu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.