* WI_CONTEXT Instance Attribute Private Type Ref To IF_WAPI_WORKITEM_CONTEXT
* PROCESS_STATUS Instance Attribute Private Type STRING
DATA: l_s_wihead TYPE swr_wihdr,
l_wa_itab TYPE zwffi_mon,
l_swfdname TYPE swfdname VALUE 'V_FIPP'.
DATA: l_bukrs TYPE bkpf-bukrs,
l_belnr TYPE bkpf-belnr,
l_gjahr TYPE bkpf-gjahr.
DATA: l_tmp TYPE REF TO if_swf_ifs_parameter_container.
DATA: l_zwf_cl_fi TYPE swotobjid.
DATA: l_process_id TYPE swwwihead,
l_wi_id TYPE sww_wiid.
CALL METHOD wi_context->get_wf_container "ok
RECEIVING
re_container = l_tmp.
CALL METHOD l_tmp->get
EXPORTING
name = l_swfdname
IMPORTING
value = l_zwf_cl_fi.
l_bukrs = l_zwf_cl_fi-objkey+0(4).
l_belnr = l_zwf_cl_fi-objkey+4(10).
l_gjahr = l_zwf_cl_fi-objkey+14(4).
**Get work item ID
CALL METHOD wi_context->get_workitem_id
RECEIVING
re_workitem = l_wi_id.
IF sy-subrc = 0.
UPDATE zwffi_mon SET zzwf_id = l_wi_id
WHERE bukrs = l_bukrs
AND belnr = l_belnr
AND gjahr = l_gjahr.
ENDIF.
No comments:
Post a Comment