cancel
Showing results for 
Search instead for 
Did you mean: 

How to upload document to Solar01 "background" through FM or Class

0 Kudos

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?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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

0 Kudos

I believe this method is only applicable to front end processing, not background. Correct me if I'm wrong.

Anyway, thanks for your replied.

Edited by: Ching Hong Chong on Dec 21, 2011 3:06 AM

Former Member
0 Kudos

yes, you are right. Sorry i did not read you wanted it on background.

Kind regards

Jon