GOS Toolbar
GOS Toolbar
GOS Toolbar
Transactions:
OAC0 - Content Reporsitory
OACT - Content Categories - Define Link to content Reporsity
SOFFDB - Storage for SAPoffice (database)
SOOD - Header
URL45000000000032
SOC3 - Contents
SOC3-SRTFD = SOOD-OBJTP + SOOD-OBJYR + SOOD-OBJNO
-----------------------------------------------------------------------------------
--------
-----------------------------------------------------------------------------------
--------
Example-1 - To create URL
DATA:
l_filename TYPE string,
l_filefullname TYPE string,
l_mime_type TYPE string,
l_size TYPE i,
l_offset TYPE i,
l_offset_old TYPE i,
l_temp_len TYPE i,
l_objname TYPE string,
l_obj_type TYPE so_obj_tp,
l_hex_null TYPE x LENGTH 1 VALUE '20',
l_document_title TYPE so_text255,
l_file_ext TYPE string,
wl_doc_change-obj_name = l_objname.
wl_doc_change-obj_descr = l_objname.
wl_doc_change-obj_langu = sy-langu.
wl_doc_change-sensitivty = 'F'.
wl_doc_change-doc_size = l_size.
l_offset = 0.
WHILE l_offset <= l_size.
l_offset_old = l_offset.
l_offset = l_offset + 255.
IF l_offset > l_size.
l_temp_len = xstrlen( iv_content_hex+l_offset_old ).
CLEAR wl_xdata-line WITH l_hex_null IN BYTE MODE.
wl_xdata-line = iv_content_hex+l_offset_old(l_temp_len).
ELSE.
wl_xdata-line = iv_content_hex+l_offset_old(255).
ENDIF.
APPEND wl_xdata TO tl_xdata.
ENDWHILE.
l_object_hd_change-objnam = wl_doc_change-obj_name.
l_object_hd_change-objdes = wl_doc_change-obj_descr.
l_object_hd_change-objsns = wl_doc_change-sensitivty.
l_object_hd_change-objla = wl_doc_change-obj_langu.
l_object_hd_change-objlen = wl_doc_change-doc_size.
l_object_hd_change-file_ext = l_file_ext.
*
* prepare header
DATA tl_obj_header TYPE STANDARD TABLE OF solisti1.
DATA wl_header TYPE solisti1.
CONCATENATE '&SO_FILENAME=' l_filename INTO wl_header.
APPEND wl_header TO tl_obj_header.
CLEAR wl_header.
wl_header = '&SO_FORMAT=BIN'.
APPEND wl_header TO tl_obj_header.
ELSE.
* for note
l_size = strlen( iv_content ).
l_objname = iv_name.
wl_doc_change-obj_descr = l_objname.
wl_doc_change-sensitivty = 'O'.
wl_doc_change-obj_langu = sy-langu.
IF iv_objtp = gc_type_note.
* it's a note
l_retype = 'NOTE'.
l_obj_type = 'RAW'.
l_object_hd_change-file_ext = 'TXT'.
ELSE.
* it's url (not note)
l_retype = 'URL'.
l_obj_type = 'URL'.
IF l_objname IS INITIAL.
SPLIT iv_content AT '/' INTO TABLE tl_urltab.
DESCRIBE TABLE tl_urltab LINES l_tab_size.
READ TABLE tl_urltab INDEX l_tab_size INTO wl_doc_change-obj_descr.
ENDIF.
wl_doc_change-doc_size = l_size.
l_object_hd_change-objdes = wl_doc_change-obj_descr.
l_object_hd_change-objsns = wl_doc_change-sensitivty.
l_object_hd_change-objla = wl_doc_change-obj_langu.
l_object_hd_change-objlen = wl_doc_change-doc_size.
ENDIF.
* save object
CALL FUNCTION 'SO_OBJECT_INSERT'
EXPORTING
folder_id = l_folder_id
* OBJECT_FL_CHANGE = OBJECT_FL_CHANGE
object_hd_change = l_object_hd_change
object_type = l_obj_type
* ORIGINATOR_ID = OWNER_ID
* OWNER = USER-USRNAM
IMPORTING
* OBJECT_FL_DISPLAY = OBJECT_FL_DISPLAY
* OBJECT_HD_DISPLAY = OBJECT_HD_DISPLAY
object_id = wl_object_id
TABLES
objcont = tl_data
objhead = tl_obj_header
* OBJPARA = OBJECT_PARA
* OBJPARB = OBJECT_PARB
EXCEPTIONS
component_not_available = 01
folder_not_exist = 06
folder_no_authorization = 05
object_type_not_exist = 17
operation_no_authorization = 21
parameter_error = 23
OTHERS = 1000.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 INTO ls_message-message.
ls_message-type = sy-msgty.
ls_message-id = sy-msgid.
ls_message-number = sy-msgno.
ls_message-message_v1 = sy-msgv1.
ls_message-message_v2 = sy-msgv2.
ls_message-message_v3 = sy-msgv3.
ls_message-message_v4 = sy-msgv4.
APPEND ls_message TO rt_messages.
RETURN.
ENDIF.
* create relation
DATA l_obj_rolea TYPE borident.
DATA l_obj_roleb TYPE borident.
l_obj_rolea-objkey = is_lporb-instid.
l_obj_rolea-objtype = is_lporb-typeid.
l_obj_rolea-logsys = is_lporb-catid.
l_object_id_fol = l_folder_id.
l_object_id = wl_object_id.
CONCATENATE l_object_id_fol l_object_id INTO l_obj_roleb-objkey RESPECTING
BLANKS.
l_obj_roleb-objtype = 'MESSAGE'.
CLEAR l_obj_roleb-logsys.