Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to get element container?

alonso_valenzue
Participant
0 Likes
844

I'm trying to get the element container 'ReqReq'.

The code is:

*Begin code

DATA: v_reqreq TYPE swf_object.

CALL FUNCTION 'SWW_WI_CONTAINER_READ'

EXPORTING

wi_id = p_wi_id

IMPORTING

wi_container_handle = v_wi_container_handle_task

EXCEPTIONS

container_does_not_exist = 1

read_failed = 2

OTHERS = 3.

swf_get_element v_wi_container_handle_task 'ReqReq' v_reqreq.

swf_get_property v_reqreq 'RequirementRequest' v_sc_number.

*End code

But the bolded sentence is not working correctly, the sy-subrc is set 1. Debugging the sentence appear a type conflict:

* *

The element 'ReqReq' at container is declared as BO Object type BOR BUS2121. How can I get the element container? In which moment should I indicate that the object type is BUS2121? Is correct to declare the variable 'v_reqreq' as type 'swf_object'?

Obviously, the 'RequirementRequest' property is neither get correctly since the 'ReqReq' element is not get.

2 REPLIES 2
Read only

franois_henrotte
Active Contributor
0 Likes
668

call SWW_WI_CONT_READ_SINGLE_OBJECT in order to get object key then call SWW_WI_READ_CONTAINERS_OF_OBJ to read attributes of object

Read only

pokrakam
Active Contributor
0 Likes
668

Hello,

Use function module SAP_WAPI_READ_CONTAINER, it will return a simple name-value pair table.

You will have more luck with this type of question in the workflow forum. although this one is called ABAP Objects, it refers more to ABAP objects in the class sense rather than BOR objects.

Cheers,

Mike