cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP function to upload document in SOLAR01

Former Member
0 Kudos

Hi all,

I need to upload a document to SOLAR01 through an ABAP.

Any explanation on how to do this would be great.

What I so far found myself is the following. Even though I always get succes code 0 back, I just can't seem to get it working properly:

  CALL METHOD CL_SA_DOC_FACTORY=>UPLOAD_DOC
    EXPORTING
      I_DOC_TITLE              = 'Document name'
      I_DOC_TECH_NAME          = techname
      I_DOC_TYPE               = 'CFG'
*      I_DOC_FORMAT             =
      I_DOC_STATUS             = 'COPY_EDITING'
*    I_DOC_PRIO               =
*    I_DOC_BLUEPRINT_RELEVANT =
*    I_FOLDER_ID              = '66B48C7DFA1FAC4EBBEA2C8F9E8439BA'
    I_FOLDER_TITLE           = 'Training Project Jurjen de Vries'
    I_FOLDER_TECH_NAME       = 'TRN_JDV'
    I_FOLDER_RESPONSIBLE     = SY-UNAME
    I_FOLDER_GROUP           = 'TRN_JDV'
*    I_READ_ONLY              =
*    I_SHOW_TOOLBARS          = SPACE
*    I_CALLING_OBJECT         =
*    I_BUSINESS_OBJECT        = lv_busob
*    IT_TOOLBAR_BUTTONS       =
*    IT_TOOLBAR_MENUES        =
*    IT_IO_ATTR               = LT_IO_ATTR
*    IT_CONTEXT               = it_context
*    I_PARENT_CONTAINER       =
    IP_FILEPATH              = filename
*    I_DOCUMENT               =
    RECEIVING
      E_IOBJECT                = eobj
  EXCEPTIONS
    CANCELLED                = 1
    FOLDER_ERROR             = 2
    ERROR                    = 3
    others                   = 4
          .

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Everybody,

I too need to perform a mass load of documents into solar01.

Has anyone got the complete code to do this?

Ideally take as import a list of file locations and descriptions and importing it into solar01.

Otherwise it will take me days to manually import them.

regards

Tony

Former Member
0 Kudos

Hi All,

Can anyone please provide complete code for mass upload of documents?

Former Member
0 Kudos

Hi everybody..

is there any solution for the mass upload of files in solar01? I also tried to use the above stated method but i gues without having the right object as context this will not work..

Thanks & Regards

Former Member
0 Kudos

Hi,

I am trying to upload a document using a method UPLOAD_NEW_DOCUMEN from the class CL_SOLAR_DOCUMENTS. The document is from my desktop.

though it is not throwing any error, document is not getting uploaded.

i tried to use the method update_new_doc from class CL_SA_TAB_PROJECTDOCU. but it is not working from my program, Can someone explain how to call this method in a program.

appreciate early response.

Thanks,

avis

Former Member
0 Kudos

I am new to SAP solution manager , i would like to know how how to create the business process folder structure and associated Transaction Codes in Solution manager using ABAP program

Former Member
0 Kudos

Solved it!

Simply call pattern eobj->Save.

Hope this one will save others time now

Former Member
0 Kudos

Hi Jurjen,

I seem to have the same problem than you : my program is executed entirely and i have a return code 0 back too but even with the Save method i'm not able to see my documents in solar01. But when i go in si80, i can see it...

Do you know where it comes from ?

Best regards,

Stéphane.

Former Member
0 Kudos

Jurjen,

I am trying to upload documents from my local hard drive to solution manager tabs at the process step level

1.Does CL_SA_DOC_FACTORY=>UPLOAD_DOC upload to a KW folder or a Node in Business process level?

2.how did you get the node is of the business process step level to which you want to upload the doc?

for example you want to upload to the 3rd step of a 2nd business process , how did you get the node id?

Thanks for your time

Devagi

Former Member
0 Kudos

Hi,

CL_SA_DOC_FACTORY=>UPLOAD_DOC uploads a document to a KW folder and it can also link it to a node in SOLAR02.

This should work if you use the import parameter i_business_object as follows:


  DATA ls_bo TYPE sadocbo.

  ls_bo-bo_type = node_type.
  ls_bo-bo_object = node_id.

  CALL METHOD cl_sa_doc_factory=>upload_doc
   EXPORTING
     ...
     i_business_object  = ls_bo
     ...
     RECEIVING
       e_iobject          = lo_new_document
     EXCEPTIONS
      cancelled          = 1
      folder_error       = 2
      error              = 3
      OTHERS             = 4.

You can save the document using:


DATA lv_loio TYPE sdokobject.

CALL METHOD lo_new_document->save
   RECEIVING
      e_loio    = lv_loio
   EXCEPTIONS
      cancelled = 1
      error     = 2
      OTHERS    = 3.

You can read all nodes for your project using function module SASAP_HIERARCHY_READ. Use function module SPROJECT_GET_REAL_OF_PROJ to get the filter for your project:



  CALL FUNCTION 'SPROJECT_GET_REAL_OF_PROJ'
    EXPORTING
      project_id         = lv_project_id
    IMPORTING
      realization_filter = lv_filter.

    CALL FUNCTION 'SASAP_HIERARCHY_READ'
      EXPORTING
        structure_id          = lv_filter
        read_texts            = 'X'
        read_references       = ''
        language              = sy-langu
        include_substructures = 'X'
        text_of_references    = 'X'
      IMPORTING
        message               = ls_message
      TABLES
        list_of_nodes         = lt_nodes_all
        list_of_texts         = lt_texts.

Regards,

Christoph

Former Member
0 Kudos

HI Cristoph,

I have followed all the steps you mention in order to upload the file into a folder of a project.

I used the FM SPROJECT_GET_REAL_OF_PROJ to get the filter associated to the project name and after this i called FM SASAP_HIERARCHY_READ to get all the project structure.

Now i am trying to upload a file into a specific folder ( a step in this case ) so i managed to get the object id from the list_of_nodes that i get in the previous FM ( SASAP_HIERARCHY_READ ) for my project.

when i execute the cl_sa_doc_factory=>upload_doc with this node id and node type i get folder error, i dont know why is this happening, any idea?

Kind Regards

Jon

Former Member
0 Kudos

Hello all,

I'm uploading word documents to SOLAR01 using the methods get_document (to get it from KW), update_new_document and save_data. Eveything is fine and I can find my document in project data.

My problem occurs when exporting the document. Well it's a MS Word one, however when I save it to a local folder the extension does not exist (the extension I find is 10 characters one, don't know how it was added). when I change it manually to '.doc' I can open my document without problem (I concluded that the doc is in a real word format, but only extension is missing).

Any ideas please on how to fix that?

Regards.