Hi All,
I'm building custom Gateway objects for EH&S Incident related BOPF and am trying to figure out how to trigger the action to download an attachment and get the contents of the file to stream back. While I can test this in the test tool and see the content being returned from the Action in the Attachment BO, I'm unclear how to get a hold of this content when using the service manager API's.
Current non-working code looks like this:
data(o_attachment_node) = o_root_node->get_subnode_by_key( if_ehhss_inc_c=>sc_association-root-att_document ). if o_attachment_node->has_more_rows( ) = abap_true. o_attachment ?= o_attachment_node->get_next_row( ). append INITIAL LINE TO it_key ASSIGNING FIELD-SYMBOL(<s_key>). <s_key>-key = o_attachment->key. o_service_mngr->execute_action( exporting iv_act_key = if_ehhss_inc_c=>sc_action-att_document-download_document " Action it_key = it_key " Key Table ). o_attachment ?= o_attachment_node->get_row( 1 ). “ Attempting to refresh the data but this doesn’t help. s_stream-value = o_attachment->content. “ Content is still empty after action, though in action debug, it is definitely retrieved.
Can anyone:
a) Tell me how to get a hold of this precious content? and
b) If possible, explain the relationship of the action to the reading of the node (get_row) - if any, and how you would even know what the result is from this action since in the configuration for this action, it just shows the class which handles the functionality without any export parameters. e.g. How do you know how to get the result of o_attachment from the execute_action based on the definition.
Thanks,
Matt