cancel
Showing results for 
Search instead for 
Did you mean: 

Read Object Instance

Former Member
0 Kudos

Hi,

We created a workflow having a container element that points to a class(which implements the interface IF_WORKFLOW). All our data are stored as instance attributes of that class. All this data is populated in the constructor of the class. So once the workflow is triggered, we managed to create an instance of this container element(class) and successfully populated the instance attributes.

As an approval step, we tried calling a Web Dynpro ABAP UI, so we did all required configuration(SWFVISU + UWL Configuration) ensuring that the required screen appears at UWL.

We managed to pass on the Workitem number into the "DEFAULT" method of the web dynpro's window. Now, we are stuck with a challenge in extracting the class instance from work item number. I did refer couple of blogs pointing to the interface - IF_SWF_IFS_PARAMETER_CONTAINER which could possibly cater my requirement. But I am trying to understand how to actually link the work item number to this interface so that it picks up the container information of our workitem.

Does any one have any clue ?

Regards

Raja Sekhar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

If you have the workitem number then there is no problem to get the workitem details. Please use the follwing FMs.

For container elements............

SAP_WAPI_READ_CONTAINER

SWW_WI_CONTAINER_READ

For container attribute...........

SAP_WAPI_GET_HEADER

Thanks and regards,

SNJY

Former Member
0 Kudos

Thanks Sanjay,

Your suggestion helped. We used the FM-SWW_WI_CONTAINER_READ to get the WI_CONTAINER_HANDLE instance and called this instance's method - IF_SWF_IFS_PARAMETER_CONTAINER~get_value_ref to extract the object reference as shown below.

  • Based on Workitem ID, retrieve the workflow container

CALL FUNCTION 'SWW_WI_CONTAINER_READ'

EXPORTING

WI_ID = lv_workflow_id

IMPORTING

WI_CONTAINER_HANDLE = lo_cont_handle

TABLES

WI_CONTAINER = LT_CONT.

if lo_cont_handle is BOUND.

TRY.

call method lo_cont_handle->IF_SWF_IFS_PARAMETER_CONTAINER~get_value_ref

EXPORTING

NAME = 'INSTANCE'

IMPORTING

VALUE_REF = lv_data.

CATCH cx_swf_cnt_elem_type_conflict.

CATCH cx_swf_cnt_unit_type_conflict.

CATCH cx_swf_cnt_elem_not_found.

CATCH cx_swf_cnt_container.

ENDTRY.

endif.

Thanks once again SNJY.

Regards

Raja Sekhar

former_member185167
Active Contributor
0 Kudos

Hello,

You didn't follow the suggestion. Please use SAP_WAPI functions when possible.

regards

Rick Bakker

hanabi technology

Former Member
0 Kudos

Hi Rick,

Thanks for the suggestion. I am pretty much aware of this suggestion too. I was wondering if you know any SAP_WAPI* FM that caters my requirement. Or at least can you please let me know if we can achieve this using Object Oriented approach. I am fine eitherways.

Appreciate your response.

Regards

Raja Sekhar

former_member185167
Active Contributor
0 Kudos

Doesn't SAP_WAPI_READ_CONTAINER work in this case?

Answers (0)