cancel
Showing results for 
Search instead for 
Did you mean: 

Read Workflow container

Former Member
0 Kudos

Hi,

I am using SAP_WAPI_READ_CONTAINER to read the container. In the container i have a structure and the result of this function module gives the list of container elements, but the structure as structure names and not as field names.

EX: 'Personal' structure of type P0002, gives output with element name P0002 and not with the field names of P0002.

Is there any way to get output like that?

Thanks,

Sri

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You must find your structure in SIMPLE_CONTAINER you have to put code to get data ..

Example :

CALL FUNCTION 'SAP_WAPI_READ_CONTAINER'

EXPORTING

WORKITEM_ID = L_WI_ID

TABLES

SIMPLE_CONTAINER = LT_CONTAINER

EXCEPTIONS

OTHERS = 1.

READ TABLE LT_CONTAINER WITH KEY ELEMENT = '_WI_OBJECT_ID'.

IF SY-SUBRC EQ 0.

MOVE LT_CONTAINER-VALUE TO LS_POR.

SELECT SINGLE * FROM SWXFORMABS

WHERE FORMNUMBER = LS_POR-OBJKEY.

IF SY-SUBRC EQ 0.

SWXFORMABS-PROCSTATE = L_INPUT.

IF SY-SUBRC EQ 0.

EXPORT L_PREPROCESSED TO MEMORY ID 'PREPROC'.

L_OKAY = 'X'.

ENDIF.

ENDIF.

ENDIF

Regards,

Gurprit Bhatia

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

You can read workflow container by using Interface if_swf_ifs_parameter_container Method Get.

Regards,

pokrakam
Active Contributor
0 Kudos

SIMPLE_CONTAINER will only give you the container element names, however the XML version returned in IFS_XML_CONTAINER contains individual elements of nested structures.

If you are not familiar with working with XML, you may have a little learning curve ahead of you. CL_XML_DOCUMENT_BASE will be your most useful tool.