Technical Articles
Run transaction as a web service from sap mii.
Hi All,
recently we have got a business scenario where we need to create some web services with input parameters and according to passed input parameters web service should
give the response using SAP MII.
for eg: Select ITEM from ITEM where STATUS ='[Param.1]’ and SITE = ‘[Param.2]’
for this if we give input parameter status and site then we get respective item.
now output of this query should be in XML.
First we thought of Xacute Query but I will tell you why we haven’t used that.
this scenario is being used by other client Program so we can’t create any UI for this.
so how should we achieve this?
Procedure:
1. first create and sql query with the parameters that you need to pass
2. load sql query into the transaction and assign output in the xml type output parameter then test it with different scenario
for directly running the Transaction as web service prepare a url like :
http://<server>:<port>/XMII/Runner/?Transaction=<TransactionPath>&TrxInputParamName1=<Value>&TrxInputParamName2=<Value>&OutputParameter=Output
and run it into the browser then based on the parameter passed it will fetch record accordingly.
Now if we use Xacute Query and we try to run the query directly from URL then it will be like:
http://<server>:<port>/XMII/Illuminator?QueryTemplate=<XacuteQueryPath>&Param.1=<value>&Param.2=<value>&Content-Type=text/xml
now the problem with Xacute query is that other user would not know that what parameter is as Param.1 and Param.2 when he pass the value in URL so that is why
using xacute Query will not satisfy the requirement.
Hope you enjoyed the article. Thank you for reading. let me know your thoughts in comments section.
Regards,
Ankit