cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the instance of a phase with GUID?

Former Member
0 Kudos

Hi,

When a TASK completed, I want to send a E-mail to its phase responsable.

I got ET_SUPERIOR_OBJECT table that have the phase GUID by call funtion BAPI_BUS2175_GET_DETAIL within a workflow item. I need read the EMailAddress attribute of a BUS2173, but I do not know how to get phase instance with its GUID.

Thanks.

Arrow Yang.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member201206
Active Contributor
0 Kudos

Hi Arrow,

The mail address of the BUS2173 is the mail address of the deciders, not the responsible, as far as I see the codes (copied in below), please try with the BAPI_BUS2173_GET_DETAIL, which deliver the name of the responsible, then swith to the user-id, and use user-id get the mail address.

Standard codes of the mail-address of RBUS2173:

LV_GUID = OBJECT-KEY-PHASE_GUID.

LV_OBJKEY = LV_GUID.

CALL FUNCTION 'BAPI_BUS2173_GET_DECIDERS'

EXPORTING

GUID = LV_GUID

TABLES

USERS = LT_USERS.

LOOP AT LT_USERS INTO LV_USER.

IF NOT LV_USER IS INITIAL.

CALL FUNCTION 'BAPI_USER_GET_DETAIL'

EXPORTING

USERNAME = LV_USER

TABLES

ADDSMTP = LT_ADDSMTP

RETURN = LT_RETURN

EXCEPTIONS

OTHERS = 01.

Kind regards,

Zhenbo

Former Member
0 Kudos

Dear Zhenbo Wang,

Thank you very much.

But in my ECC 6.0 system, the function BAPI_BUS2173_GET_DECIDERS has a Short text "DO NOT USE!!!"

Best regards,

Liu Qi Wei

Former Member
0 Kudos

Hi Arrow,

You can use standard method: if_dpr_appl_object_mapper->get_application_object_by_guid

Please try the following:

DATA: lr_appl_object_manager TYPE REF TO CL_DPR_APPL_OBJECT_MANAGER,

lv_guid TYPE dpr_tv_guid,

lr_phase TYPE REF TO cl_dpr_phase_o.

lr_appl_object_manager = cl_dpr_appl_object_manager=>get_instance( ).

lv_guid = phase_guid.

TRY.

lr_phase ?= lr_appl_object_manager->mr_mapper->GET_APPLICATION_OBJECT_BY_GUID( IV_GUID = lv_guid ).

CATCH CX_DPR_OBJECT_MAPPING_ERROR.

ENDTRY.