Запуск события с передачей данных в контейнер
Пример инициации события с одновременным заполнением данных в контейнере:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
TYPES: ty_t_objkeys TYPE SORTED TABLE OF sibfboriid WITH NON-UNIQUE KEY table_line. CONSTANTS: lc_obj_type TYPE swr_struct-object_typ VALUE 'ZMYBUS2089', lc_error_event TYPE swr_struct-event VALUE 'ZZCONFIRMAFTERERROR', lc_error_element TYPE swfdname VALUE 'IV_WF_TEXTS', lc_rec_type TYPE swfrevtlog-rectype VALUE 'WS91000072'. DATA: lt_container TYPE swrtcont, lv_key TYPE swr_struct-object_key, lt_errors TYPE soli_tab, lv_dummy TYPE string, lv_stream TYPE xstring, ls_wihdr TYPE swr_wihdr. TRY. DATA(lo_cnt) = cl_swf_cnt_factory=>create_event_container( EXPORTING im_objcateg = swfco_objtype_bor im_objtype = lc_obj_type im_event = lc_error_event ). lo_cnt->element_set( EXPORTING name = lc_error_element value = lt_errors ). CATCH cx_root. CONTINUE. ENDTRY. cl_swf_ifs_conversion_base=>to_ifs_xml( EXPORTING source_container = lo_cnt import_param = abap_true export_param = abap_true local_elements = abap_true IMPORTING ifs_xml_stream = lv_stream ). CALL FUNCTION 'SAP_WAPI_CREATE_EVENT' EXPORTING object_type = lc_obj_type object_key = lv_key event = lc_error_event commit_work = abap_true ifs_xml_container = lv_stream. |