Skip to Content
Former Member
Jul 21, 2009 at 04:03 AM

SRM 7.0 BADI Define Agents--> How to use type /sapsrm/t_wf_area_entity


Hi Experts,

I'm using SRM 7.0. When implementing BADI /SAPSRM/BADI_DET_AG (Define the agents of procsess controlled workflow), I created the sub-class of interface /SAPSRM/IF_WF_AREA to develop my won logic in method GET_RESPONSIBLE_APPROVERS.

I want use the data in workflow container, seems the method GET_AREA_ENTITY_IDS of /SAPSRM/IF_WF_AREA can provide a pointer which type is /sapsrm/t_wf_area_entity and point workflow area.

My question is how to use this pointer (or how to use the type /sapsrm/t_wf_area_entity )? Many thanks.

PS. I found some example code delivered by sap, but i want know the full structure which /sapsrm/t_wf_area_entity point. Below code for your reference:


METHOD /sapsrm/if_wf_area~get_responsible_approvers.

DATA lt_area_entity_id TYPE /sapsrm/t_wf_area_entity_id.

DATA lr_area_entity_id TYPE REF TO /sapsrm/wf_area_entity_id.

DATA ls_actor_id TYPE swhactor.

DATA lt_approver TYPE /sapsrm/t_wf_approver.

FIELD-SYMBOLS: <ls_agent_id> TYPE /sapsrm/s_wf_approver.

lt_area_entity_id = me->/sapsrm/if_wf_area~get_area_entity_ids( ).

LOOP AT lt_area_entity_id REFERENCE INTO lr_area_entity_id.

ASSIGN lr_area_entity_id->* TO <ls_agent_id> CASTING.


ls_actor_id-otype = <ls_agent_id>-approver_ot.

ls_actor_id-objid = <ls_agent_id>-approver_id.

lt_approver = /sapsrm/cl_wf_config_user=>get_manager_list( ls_actor_id ).

APPEND LINES OF lt_approver TO rt_approver.

CATCH /sapsrm/cx_wf_error /sapsrm/cx_wf_abort.