on 04-30-2009 4:36 PM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.