Попробовал сделать через GOS. Выглядит примерно так:
Code:
REPORT ztn082_set_1 .
* Include for BO macros
INCLUDE : <cntn01>.
TABLES: ztn_eshop_mkey.
PARAMETERS:
p_msgtyp LIKE sofm-doctp DEFAULT 'PDF' NO-DISPLAY,
p_docty LIKE borident-objtype DEFAULT 'MESSAGE' NO-DISPLAY,
* p_reltyp LIKE breltyp-reltype DEFAULT 'ATTA' NO-DISPLAY,
p_fname LIKE rlgrap-filename.
DATA: lv_message_key LIKE sofmk.
DATA: lo_message TYPE swc_object.
DATA: lt_doc_content TYPE STANDARD TABLE OF soli-line
WITH HEADER LINE.
* File Name - for upload.
DATA: p_file TYPE string.
*----------------------------------------------------------------------*
at selection-screen ON VALUE-REQUEST FOr p_fname.
perform get_filename changing p_fname.
* Create an initial instance of BO 'MESSAGE' - to call the
* instance-independent method 'Create'.
swc_create_object lo_message 'MESSAGE' lv_message_key.
* define container to pass the parameter values to the method call
* in next step.
swc_container lt_message_container.
* Refresh to get the reference of create 'MESSAGE' object for attachment
swc_refresh_object lo_message.
swc_call_method lo_message 'CREATE' lt_message_container.
* Get Key of new object
swc_get_object_key lo_message lv_message_key.
Ключ lv_message_key сохраняею в таблице, после его вызываю
и вытаскиваю документ...
Code:
DATA: document_id LIKE sofolenti1-doc_id.
document_id = lv_message_key.
DATA: doc_data LIKE sofolenti1.
CALL FUNCTION 'SO_DOCUMENT_READ_API1'
EXPORTING
document_id = document_id
filter = 'X'
IMPORTING
document_data = doc_data
TABLES
object_header = lt_header
object_content = lt_content
EXCEPTIONS
document_id_not_exist = 1
operation_no_authorization = 2
x_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.