Hi All,
I have couple of offline forms for incident and near-miss recording, based on standard EHHSS_INCIDENT business object.
I am calling attach_file_to_bo_folder method of class to attach uploaded offline form file to BO node:
lo_attachment_node = lo_root_node->get_subnode_by_key( iv_assoc_key = if_ehhss_inc_c=>sc_association-root-att_document
iv_edit_mode = /bobf/if_conf_c=>sc_edit_exclusive ).
cl_ehhss_aif_inc_helper=>attach_file_to_bo_folder(
EXPORTING
io_attachment_node = lo_attachment_node
iv_att_folder_id = if_ehhss_inc_c=>sc_association-root-att_document_rev_for_key
iv_key_ref = lr_s_root->key
iv_node_key_ref = if_ehhss_inc_c=>sc_node-root
is_form = is_form
iv_filename = iv_filename
iv_file_content = iv_filecontent
io_service_manager = lo_service_manager
iv_document_action = if_ehhss_inc_c=>sc_action-att_document-upload_document_in_bg
iv_save_data = iv_save_data
IMPORTING
ev_attach_rejected = lv_rejected
ev_conf_key = lv_attachment_reference ).
However, the method cannot insert the attachment row into the lo_attachment_node node above and ends up raising cx_ehhss_aif_comn_exception for certain plants. It works for all others.
How come the method functionality be affected by form content? I can see that it uses file content when creating the file attributes structure for the attachment folder but the problem occurs even before when it tries to insert data into attachment node within this method.
Why it fails to work in certain cases whereas the values of parameters passed into this method are similar in all cases?
Please help.