Các bước thực hiện:
- Tạo folder ID:
Code: Select all
CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'
EXPORTING
region = 'B'
IMPORTING
folder_id = ls_folder_id
EXCEPTIONS
OTHERS = 1.
Code: Select all
DATA lt_objcont TYPE STANDARD TABLE OF soli.
DATA lt_objcont TYPE STANDARD TABLE OF soli.
CONCATENATE '&KEY&' 'http://google.com' INTO ls_objcont.
APPEND ls_objcont TO lt_objcont.
Code: Select all
ls_obj_data-objsns = 'O'.
ls_obj_data-objla = sy-langu.
ls_obj_data-objdes = 'google.com'.
Code: Select all
CALL FUNCTION 'SO_OBJECT_INSERT'
EXPORTING
folder_id = ls_folder_id
object_type = 'URL'
object_hd_change = l_obj_data
IMPORTING
object_id = l_obj_id
TABLES
objhead = lt_objhead
objcont = lt_objcont
EXCEPTIONS
active_user_not_exist = 35
folder_not_exist = 6
object_type_not_exist = 17
owner_not_exist = 22
parameter_error = 23
OTHERS = 1000.
Code: Select all
ls_document_id-foltp = ls_folder_id-objtp.
ls_document_id-folyr = ls_folder_id-objyr.
ls_document_id-folno = ls_folder_id-objno.
ls_document_id-doctp = ls_obj_id-objtp.
ls_document_id-docyr = ls_obj_id-objyr.
ls_document_id-docno = ls_obj_id-objno.
in example:
objkey is PO number
objtype = BUS2012 is PO type (referent table TOJTB)
Code: Select all
ls_object-objkey = '4500136568'.
ls_object-objtype = 'BUS2012'.
Code: Select all
CLEAR ls_rel_doc.
ls_rel_doc-objkey = ls_document_id.
ls_rel_doc-objtype = 'MESSAGE'.
CALL FUNCTION 'BINARY_RELATION_CREATE'
EXPORTING
obj_rolea = ls_object
obj_roleb = ls_rel_doc
relationtype = 'URL'
EXCEPTIONS
OTHERS = 1.