cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC receiver SQL_DML UPDATE statement response structure

SujitSK
Explorer
0 Kudos

Hi,

I have created an interface with to SELECT and UPDATE the data from SQL server.

SELECT statement is working correctly but UPDATE statement is failing.

I wanted to know whether UPDATE call should be Synchronous or Asynchronous?

I am using UPDATE as synchronous call as follows.. Please check and let me know if something is missing..

Request:

<?xml version="1.0" encoding="UTF-8"?>

<ns0:MT_745_UPDATE_OUT xmlns:ns0="urn:bechtel.com:IF_I_745_SUCCTOSAP_UPDATE:ED">

   <root>

      <update action="SQL_DML">

         <access>UPDATE TOP(10) TW_PM set PROCESS = &apos;X&apos; WHERE FormStatus = &apos;Completed&apos;</access>

      </update>

   </root>

</ns0:MT_745_UPDATE_OUT>

Response : (I am expecting in following format)

<?xml version="1.0" encoding="UTF-8"?>

<ns0:MT_745_UPDATE_response xmlns:ns0="urn:bechtel.com:IF_I_745_SUCCTOSAP_UPDATE:ED">

   <root_response>

      <update_count>10</update_count>

   </root_response>

</ns0:MT_745_UPDATE_response>

Sujit S K.

Accepted Solutions (0)

Answers (1)

Answers (1)

nabendu_sen
Active Contributor
0 Kudos

Hi Sujit,

If your Request MT is "MT_745_UPDATE_OUT", your Response MT would be "MT_745_UPDATE_OUT_response". Not "MT_745_UPDATE_response".

Former Member
0 Kudos

Hi Sujit,

As above said , your response message type name should be "MT_745_UPDATE_OUT_response". not "MT_745_UPDATE_response" .

Please follow the documentation in the below link as reference while creating d/b structure.

http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm

Regards

Venkat

SujitSK
Explorer
0 Kudos

Thanks for the response Venkat.

My message type is "MT_745_UPDATE and response type is "MT_745_UPDATE_response" .

that was typo in original post.

My question is what should be structure of response message. structure which you have mentioned is correct for SELECT statement. But what about UPDATE statement?

UPDATE statement won't return rows, right?

I was assuming that it will return the count but it won't as count is empty when I get response. 

So should I call UPDATE statement as Asynchronous call? OR How should I know whether statement was executed successfully or not?

Sujit S K.

nabendu_sen
Active Contributor
0 Kudos

Hi Sujit,

If you dont need the information that how many Records are updated and send back to sender, you can go for Asynchronous communication. Otherwise, for Synchronous the structure should be like:

1.MT_745_UPDATE_response

2.    Statement_response

3.           update_count

"The response document described below can only be evaluated by the Integration Server if the call is synchronous because the content of the response document is not accessible if the call is asynchronous. The response is put in a separate element<StatementName_response> for each statement element."

See the section for Update:

http://help.sap.com/saphelp_nw04/helpdata/en/4d/8c103e05df2e4b95cbcc68fed61705/frameset.htm


Former Member
0 Kudos

Hi Sujit,

As above said it is up to your requirement whether you want to use the response or not

Update Response structure looks as below:

<ReqMessageType_response>

< StatementName1_response>

<update_count>count</update_count>

</ StatementName1_response>

</ ReqMessageType_response>

If no records are updated in the table then it will return the count as 0.

Similarly if you are performing delete operation.For knowing no of records that were deleted ;Use the below .

<delete_count>count</delete_count>

<insert_count>count</insert_count>

For select/Stored procedures:

<column1>value11</column1>

<column2>value12</column2>

Regards

Venkat

SujitSK
Explorer
0 Kudos

I am not sure whether you received the points or not. Please let me know.

Sujit S K