‎2013 Feb 22 11:32 AM
Hi All,
We are able to park the document with the FM 'PRELIMINARY_POSTING_FB01'.
Now our requirement is to attach an .HTM(HTML) file to the parked document automatically through program.
Kindly suggest if you have any ideas.
Regards,
Mohammed
‎2015 Mar 03 5:29 PM
Hi Experts,
I resolved this. Here is the code for attaching an .HTML file for a Parked Document.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = l_app_file_name
filetype = c_bin "BIN
IMPORTING
filelength = l_bin_length "TYPE i
TABLES
data_tab = i_bin_data[] "TYPE STANDARD TABLE OF soli
*/-- Object Attachment
x_obj_data-objsns = c_o.
x_obj_data-file_ext = c_htm.
x_obj_data-objpri = c_5.
x_obj_data-objla = sy-langu.
x_obj_data-objdes = l_objdes.
x_obj_data-objlen = l_bin_length.
CALL FUNCTION 'SO_OBJECT_INSERT'
EXPORTING
folder_id = l_fol_id "Use FM SO_FOLDER_ROOT_ID_GET
object_hd_change = x_obj_data
object_type = c_ext " EXT
owner = sy-uname
IMPORTING
object_id = x_object_id
TABLES
objcont = i_bin_data
objhead = i_objhead
EXCEPTIONS
active_user_not_exist = 1
communication_failure = 2
component_not_available = 3
dl_name_exist = 4
folder_not_exist = 5
folder_no_authorization = 6
object_type_not_exist = 7
operation_no_authorization = 8
owner_not_exist = 9
parameter_error = 10
substitute_not_active = 11
substitute_not_defined = 12
system_failure = 13
x_error = 14
OTHERS = 15.
IF sy-subrc = 0 AND x_object-objkey IS NOT INITIAL.
x_note-objtype = 'MESSAGE'.
CONCATENATE l_fol_id x_object_id INTO x_note-objkey.
CALL FUNCTION 'BINARY_RELATION_CREATE_COMMIT'
EXPORTING
obj_rolea = x_object
obj_roleb = x_note
relationtype = 'ATTA'
EXCEPTIONS
OTHERS = 1.
ENDIF.
Regards,
Rafi