cancel
Showing results for 
Search instead for 
Did you mean: 

GOS and FileUpload UiElement

former_member497277
Participant
0 Kudos

Hi!:

I'm trying to upload attached documents from pc of the final user via GOS (generic object service) to content server in a Solution manager machine

I've been using FileUpload Uielement in WDA.

I've seen some threads about this and I've found the CL_GOS_SRV_ATTACHMENT_CREATE class.

Is it possible saving documents via GOS using this class ?

In this case, could someonepass me some example? And if isn't possible...How I could I do it?

Thanks in advance...

Ana

Accepted Solutions (0)

Answers (2)

Answers (2)

Pramanan
Active Participant
0 Kudos

Hello,

Yes it is possible to upload the documents using GOS class.

To upload the file first we have to form a key.Using that key we can upload the file and get the content back from the file.

lv_zfile_name is the file.This is from the context of fileupload UI element.

lv_zdata is the data in the file.This is also from context of file upload UI element.

ms_lporb is the attribute of type sibfloporb.

concateneat emp_no val into wd_this->ms_lporb-instid .

< this is the key, nothing but concatenate value of employee number and automatic increment value to have the unique key>

wd_this->ms_lporb-typeid = 'ZBUS2089'.

wd_this->ms_lporb-catid = 'BO'.

call method cl_fitv_gos=>save

exporting

iv_name = lv_zfile_name

  • im_content =

iv_content_hex = lv_zdata

is_lporb = wd_this->ms_lporb

iv_objtp = 'EXT'

receiving

rt_messages = lt_message .

This will update the file with key for example employee number 101 and autogeneratied number 20, therefore the file key is 10120.

To get the link, to access the file use

call method cl_fitv_gos=>get_links

exporting

is_lporb = wd_this->ms_lporb

importing

et_items = lt_atta

et_messages = lt_messages.

Similarly we can get the content using

CALL METHOD cl_fitv_gos=>get_content

EXPORTING

iv_atta_id = lv_atta_id

iv_objtp = stru_attachments-objtp

IMPORTING

ev_content = lv_data

ev_content_hex = lv_xdata.

Former Member
0 Kudos

Hi Ana,

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

I have implemented code given in this link and it works great.

Let me know if you get stuck .

Regards,

PRiya