on 12-01-2011 4:34 PM
I tried do some searches through the forum and can't find related post related upload document to Solution manager in background mode.
Found a thread() recommend standard class CL_SA_DOC_FACTORY=>UPLOAD_DOC to upload document, however this class can only be executed in foreground mode.
I will copy all the documents into app server and write a abap program to read the app server's file and upload to solar01. Still struggling for the part 2: write abap program.
Appreciate if someone can provide some inputs for this or did something similar before?
Hi Ching,
Here are the methods and the FM you need to call in order.
CALL METHOD CL_SA_DOC_FACTORY=>UPLOAD_DOC
EXPORTING
I_DOC_TITLE = 'XXXXXXXXXXXXX'
I_DOC_TECH_NAME = 'XX'
I_DOC_TYPE = 'AD'
* I_DOC_STATUS = 'COPY_EDITING'
I_FOLDER_TECH_NAME = 'ZJON'
I_FOLDER_RESPONSIBLE = SY-UNAME
I_FOLDER_GROUP = 'ZJON'
IP_FILEPATH = l_filetable_s
RECEIVING
E_IOBJECT = lo_new_document
EXCEPTIONS
CANCELLED = 1
FOLDER_ERROR = 2
ERROR = 3
others = 4.
CALL METHOD LO_NEW_DOCUMENT->SAVE
RECEIVING
E_LOIO = lv_loio
EXCEPTIONS
CANCELLED = 1
ERROR = 2
others = 3.
IF SY-SUBRC <> 0.
ENDIF.
once u have the lv_loio
CALL FUNCTION 'INFO_OBJECT_PROPERTIES_GET'
EXPORTING
INFO_OBJECT = lv_loio
* SUPPRESS_AUTHORITY_CHECK = 'X'
* INTERNAL_REPRESENTATION =
* RETURN_STR_DESCR = ' '
* IMPORTING
* ERROR_MSG =
TABLES
REQUESTED_PROPERTIES = r_prop
PROPERTIES = prop
* CONTEXT =
.
READ TABLE prop INTO ls_property
WITH KEY name = 'IWB_SOLAR_DOCUTYPE'.
IF sy-subrc EQ 0.
lv_note_type = ls_property-value.
ELSE.
lv_note_type = 'AD'.
ENDIF.
*
*
CONCATENATE lv_loio-class ' ' lv_loio-objid INTO lv_objectkey SEPARATED BY space.
**
CONSTANTS sappl_c_tabtype_custdocu type sappl_tabtype_type value 'CUSTDOCU'.
CALL FUNCTION 'NOTE_OBJECT_SAVE'
EXPORTING
* id = 'E100346536B4E0F19AFD000C29BB263E'
id = handle_id
application = 'SO'
filtertree = project_filter
note_id = lv_loio-objid
note_type = lv_note_type
objectkey = lv_objectkey
save_location = ''.
* sequence = '0000000021'.
I hope it helps you
Kind regards
Jon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
75 | |
10 | |
10 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.