cancel
Showing results for 
Search instead for 
Did you mean: 

Filling workflow-container via SOAP

Former Member
0 Kudos

Hello,

like I wrote in I had been successful in starting my workflow via SOAP-message:


<?xml version="1.0" encoding="UTF-8" ?> 
<SOAP-ENV:Envelope 
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <SOAP-ENV:Body>
        <ns1:SAP_WAPI_START_WORKFLOW xmlns:ns1="urn:sap-com:document:sap:rfc:functions">
            <TASK>WS99900004</TASK> 
            <USER>DANGILERI</USER> 
        </ns1:SAP_WAPI_START_WORKFLOW>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Is it possible to fill a created workflow-container and do someone has a simple example?

Regards

Daniel

Accepted Solutions (1)

Accepted Solutions (1)

martin_nooteboom
Active Contributor
0 Kudos

Hi Daniel,

I never used SOAP, but I expect you should be able to fill the container from the XML message. Did you try to give something like this after the user:

 <CONTAINERELEMENTNAME>VALUE</CONTAINERELEMENTNAME>

The container element should be importing I think.

Regards,

Martin

Former Member
0 Kudos

@ &

Thx for that hint, I will try this today and give feedback

@

This was also my first idea, unfortunately it doesn't work like this


<?xml version="1.0" encoding="UTF-8" ?> 
<SOAP-ENV:Envelope 
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <SOAP-ENV:Body>
        <ns1:SAP_WAPI_START_WORKFLOW xmlns:ns1="urn:sap-com:document:sap:rfc:functions">
            <TASK>WS99900004</TASK> 
            <USER>DANGILERI</USER>
            <IMPORT_CONTAINER>some_value</IMPORT_CONTAINER>
        </ns1:SAP_WAPI_START_WORKFLOW>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

The connection between workflow- and task-container exists and the parameter is marked as import-parameter.

martin_nooteboom
Active Contributor
0 Kudos

Hi Daniel,

Is import_container the name of a container element? If not did you try to give the name of the container element at that place also?

Regards,

Martin

Former Member
0 Kudos

Hi Martin,

import_container is the name of the container element

Regards

Daniel

martin_nooteboom
Active Contributor
0 Kudos

Hi Daniel,

Maybe it is case sensitive, so you need to give the name exactly as it is in the container, sometimes this is necessary.

Otherwise you would need to see if you can do an update of the container after the workflow is started, but for that you will need the workflow-id and an option to call the SAP_WAPI FM's.

Regards,

Martin

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Daniel

I am guessing you are on ECC6. Though I never did this before....FM SAP_WAPI_START_WORKFLOW accepts an XML container via IFS_XML_CONTAINER or as someone suggested you can populate a table and pass it to the FM using INPUT_CONTAINER.

Good Luck

Ravi

Former Member
0 Kudos

@

No, unfortunately it doesn't work

I will try it via IFS_XML_CONTAINER

@

You're right, I'm using ECC6. Is there any information about the structure of the IFS_XML_CONTAINER element, which is expected by SAP?

For example:


<IFS_XML_CONTAINER>
    <IMPORT_CONTAINER>value</IMPORT_CONTAINER>
</IFS_XML_CONTAINER>

creates error message


<type> RABAX_STATE </type> 
<message> An error occurred when receiving a complex parameter. </message> 

Regards

Daniel

Former Member
0 Kudos

Meanwhile I saw in the WSDL that IFS_XML_CONTAINER expects base64-encoded data:


<xsd:element name="IFS_XML_CONTAINER" minOccurs="0" type="xsd:base64Binary"/>

I encoded my XML


<ifs_wf_container>
  <IMPORT_CONTAINER>value</IMPORT_CONTAINER>
</ifs_wf_container>

and got error message:


<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Body>
      <ns1:SAP_WAPI_START_WORKFLOW.Response xmlns:ns1="urn:sap-com:document:sap:rfc:functions">
         <NEW_STATUS>
            <STATUS/>
            <STATUSTEXT/>
         </NEW_STATUS>
         <RETURN_CODE>2</RETURN_CODE>
         <WORKITEM_ID>000000000000</WORKITEM_ID>
         <MESSAGE_LINES>
            <item>
               <MSG_TYPE>E</MSG_TYPE>
               <LINE>Version '' is not supported</LINE>
            </item>
         </MESSAGE_LINES>
         <MESSAGE_STRUCT>
            <item>
               <MSGID>SWF_UTL_0</MSGID>
               <MSGTY>E</MSGTY>
               <MSGNO>203</MSGNO>
               <MSGV1/>
               <MSGV2/>
               <MSGV3/>
               <MSGV4/>
            </item>
         </MESSAGE_STRUCT>
      </ns1:SAP_WAPI_START_WORKFLOW.Response>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

anybody an idea, which version the system means??

Former Member
0 Kudos

I got the expected structure by submitting SAP_WAPI_READ_CONTAINER

It works with base64 encoded string for IFS_XML_CONTAINER


<?xml version="1.0"?>
<ifs_wf_container xmlns:sap="http://www.sap.com/bc/bmt/wfm/WS99900009" version="1.0">
<values>
    <IMPORT_CONTAINER>value</IMPORT_CONTAINER>
</values>
</ifs_wf_container>

Thx to all helper!

Regards

Daniel

Former Member
0 Kudos

Well done, Daniel! Also, thanks for sharing your experience.

Regards

Ravi

Former Member
0 Kudos

If you have the Work item id then u can try this FM

SAP_WAPI_WRITE_CONTAINER

imthiaz_ahmed
Active Contributor
0 Kudos

I don't how you make use of it in SOAP, generally macros are used like SWC_SET_ELEMENT or SWC_SET_TABLE.

Regards, IA