Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

GOS - Upload file in Background

Former Member
0 Kudos

Hello friends,

Is ther anyone aware of this in GOS. When we click the GOS on the screen a small menu opens and asks for Attachment---> Create Attachment.

Once we click this the File window opens , and we are specifying the file name after that it becomes an attachment.

Now My requirement is I want to attach file in the background mode means , I dont want manually the file to be specified in the screen.

Is it possible to attach list of files in the backgroung mode. Means I will give the file path in the program and it should attach automatically in the GOS. I dont want to attach manually by clicking Create Attachment ---> then giving the file name in the popup window.

Also, What is the technical design of this GOS. What happens when we specify the file name. Does it gets converted to a binary stream and stored in a table. If then can any one please help me in knowing the table.

If some one can provide me a solution , then it is of great help.

Thanks in advance.

Regards

siwia

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi ,

Thanks for your help. I am succesfully able to attch the file. I am able to see the file in the attachment list. But when i click it it is not directly opening the file. Rather it is opening a file window asking Save as and i have to download local for this. Is it possible to open it from the list itself directly.

Thanks

siew

7 REPLIES 7

ian_maxwell2
Active Participant
0 Kudos

You'll need to write a batch program to upload the file.

If you look through the code that GOS uses to do this you'll get an idea of how to do it. Take a look at class "CL_GOS_DOCUMENT_SERVICE" method "CREATE_ATTACHMENT", this method is executed when you manually attach a document. You'll have to do things a bit differently becuase the document you will be attaching will have to come from either the application server file system or a database table since it is running in the background it can't take anything from the workstation.

The method goes through the following high-level steps:

1) SO_FOLDER_ROOT_ID_GET - Gets SAPOffice folder information

2) SO_DOCUMENTS_MANAGER - Does an import of the documents (Assumes the workstation is the srouce I think)

3) BINARY_RELATION_CREATE - Creates the relationship between the imported document and the buisness object

I think (IT has been a while since I've played with this) that you might need to use function SO_DOCUMENT_INSERT which takes a binary steam of data which you can upload from application server or from a cluster table on the DB.

The main funciton groups and modules that you will need to investigate/use are:

Function group SOC3 - SAPoffice: Function - folder (int. DB)

INCLUDE LSOC3U01. "SO_FOL_DB_EXIT

INCLUDE LSOC3U02. "SO_FOLDER_HIERARCHY_READ

INCLUDE LSOC3U03. "SO_WASTE_BASKET_CLEAR

INCLUDE LSOC3U04. "SO_FOLDER_ROOT_ID_GET

INCLUDE LSOC3U05. "SO_FOLDER_LIST_READ

INCLUDE LSOC3U06. "SO_FOLDER_PATH_READ

INCLUDE LSOC3U07. "SO_WASTE_BASKET_CLEAR_IN_VB

INCLUDE LSOC3U08. "SO_FOLDER_SUBSCRIBED_READ

INCLUDE LSOC3U09. "SO_FOLDER_COUNTER_SET

INCLUDE LSOC3U10. "SO_FOL_CHECK_HEADER

INCLUDE LSOC3U11. "SO_SOFIND_UPDATE

INCLUDE LSOC3U12. "SO_FOLDER_SORT_READ

INCLUDE LSOC3U13. "SO_FOLDER_SORT_MODIFY

Function Group SO32 - SAPoffice: DocManager and DocRepManager

INCLUDE LSO32U01. "SO_DOCUMENTS_MANAGER

INCLUDE LSO32U02. "SO_DOCUMENT_REPOSITORY_MANAGER

Function Group BREL - Object relationship binary links

INCLUDE LBRELU01. "BINARY_RELATION_CREATE

INCLUDE LBRELU02. "BINARY_RELATION_DELETE

INCLUDE LBRELU04. "BIN_REL_CREATE

INCLUDE LBRELU05. "BIN_REL_ATTRIB_ADD

INCLUDE LBRELU06. "BIN_REL_DELETE

INCLUDE LBRELU08. "BIN_RELS_OF_ROLE_GET

INCLUDE LBRELU03. "BIN_REL_ATTRIB_DEL

INCLUDE LBRELU07. "BIN_REL_OF_ROLES_GET

INCLUDE LBRELU09. "BINARY_RELATION_CREATE_REMOTE

INCLUDE LBRELU10. "BINARY_RELATION_DELETE_REMOTE

INCLUDE LBRELU11. "BINARY_RELATION_CREATE_COMMIT

INCLUDE LBRELU12. "BINARY_RELATION_DELETE_COMMIT

INCLUDE LBRELU13. "BIN_RELS_OF_ROLE_IN_RANGE_GET

INCLUDE LBRELU14. "BIN_REL_ATTRIB_MOD

INCLUDE LBRELU15. "BREL_INIT_BUFFER

Function Group: SOA1

INCLUDE LSOA1U01. "SO_OBJECT_INSERT

INCLUDE LSOA1U02. "SO_OBJECT_UPDATE

INCLUDE LSOA1U03. "SO_OBJECT_READ

INCLUDE LSOA1U04. "SO_OBJECT_EXIST

INCLUDE LSOA1U05. "SO_OBJECT_DELETE

INCLUDE LSOA1U06. "SO_OBJECT_MOVE

INCLUDE LSOA1U07. "SO_OBJECT_LINK

INCLUDE LSOA1U08. "SO_OBJECT_DELETE_ALL

INCLUDE LSOA1U10. "SO_OBJECT_REMOVE

INCLUDE LSOA1U12. "SO_OBJECT_ARRAY_DELETE

INCLUDE LSOA1U09. "SO_NOTE_READ

INCLUDE LSOA1U13. "SO_NOTE_UPDATE

INCLUDE LSOA1U11. "SO_DOCUMENT_INSERT

INCLUDE LSOA1U14. "SO_DOCUMENT_UPDATE

INCLUDE LSOA1U15. "SO_OBJECT_HEADER_UPDATE

INCLUDE LSOA1U16. "SO_OBJECT_DELETE_IN_VB

INCLUDE LSOA1U17. "SO_DLI_DELETE_IN_VB

INCLUDE LSOA1U18. "SO_OBJECT_UPDATE_IN_VB

Also do a search in SE37 for any function modules starting with "SO_Document*"

~Ian

Former Member
0 Kudos

Hi ,

Thanks for your help. I am succesfully able to attch the file. I am able to see the file in the attachment list. But when i click it it is not directly opening the file. Rather it is opening a file window asking Save as and i have to download local for this. Is it possible to open it from the list itself directly.

Thanks

siew

0 Kudos

Double check your settings in transaction OAG1. These setting control how some of the stuff works for viewer applications launching.

~Ian

0 Kudos

Hi,

Could you please post the sample code as how you achieved attaching the file in background.

It would be of great help to me as well as many others.

Thanks in advance,

Vinoth

0 Kudos

Hi:

I am looking to do the same...

Upload the file in Background...

Can you tell me how you achieved it?

Your help is greatly appreciated.

Thanks.

-Gautam.

0 Kudos

Check this out , this is the soln to your problem .

/people/rammanohar.tiwari/blog/2005/10/10/generic-object-services-gos--in-background

0 Kudos

Hi,

I am not able to open the link you have provided. Please give the code you have done to upload file in background

Thanks

Arun