Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Possible to execute complex query in ExecuteSQL method in DI Server??

Hi All,

Is it Possible to execute complex query in ExecuteSQL Method in DI Server?

Regards,

G.Suresh

Former Member
replied

Hello Guru,

It is possible. Mostly if it can be done in DI, it will also can be done in DI Server except metadata operaiton, transation management etc.

I try the following complex query (join, nexted):

The SOAP Request

<?xml version="1.0" encoding="UTF-16"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
 <env:Header>
  <SessionID>4FFCFAA3-5493-456A-BC89-410B35AF096C</SessionID>
 </env:Header>
 <env:Body>
  <dis:ExecuteSQL xmlns:dis="http://www.sap.com/SBO/DIS">
   <DoQuery>SELECT OCRD.CardCode, OCRD.CardName, OCPR.Name FROM OCRD JOIN OCPR ON OCRD.CardCode = OCPR.CardCode WHERE OCRD.CardCode IN 
(SELECT DISTINCT ORDN.CardCode FROM ORDN)</DoQuery>
  </dis:ExecuteSQL>
 </env:Body>
</env:Envelope>

The SOAP Response:

<?xml version="1.0"?><env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Body><ExecuteSQLResponse xmlns="http://www.sap.com/SBO/DIS">
<BOM><BO><AdmInfo><Object>oRecordset</Object></AdmInfo><OCRD><row><CardCode>C002</CardCode><CardName>SAP</CardName>
<Name>2</Name></row><row><CardCode>C002</CardCode><CardName>SAP</CardName><Name>l</Name></row><row><CardCode>C002</CardCode>
<CardName>SAP</CardName><Name>Z</Name></row></OCRD></BO></BOM></ExecuteSQLResponse></env:Body></env:Envelope>

I think you can easily parse the result...

Kind Regards

-Yatseas

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question