Skip to Content

ABAP Proxy to JDBC : UPDATE_INSERT issue.

Dear Friends

I am inserting one ekpo records to MS SQL server. my structure and records are below.

<?xml version="1.0" encoding="UTF-8" ?> 
- <ns0:MT_EKPO_RECEIVE xmlns:ns0="http://gspcgas.net/asset_rfid">
- <StatementName>
               - <dbTableName action="UPDATE_INSERT">
                  <table>EKPO</table> 
- <access>
           <EBELN>4500000687</EBELN> 
           <EBELP>00010</EBELP> 
          <MATNR>000000000100000012</MATNR> 
          <MENGE>1.000</MENGE> 
          <MEINS>EA</MEINS> 
          <WERKS>1000</WERKS> 
          <LGORT /> 
          <AEDAT>2011-12-12</AEDAT> 
          <BUKRS>1000</BUKRS> 
          <ANLN1>010023000315</ANLN1> 
          <PSTYP>0</PSTYP> 
          <KNTTP>A</KNTTP> 
          <LOEKZ /> <-- during insertion I am not updating this field ( this is for item deletion) 
  </access>
  - <Key1>
          <EBELN>4500000687</EBELN> 
          <EBELP>00010</EBELP> 
  </Key1>
  </dbTableName>
  </StatementName>
  </ns0:MT_EKPO_RECEIVE>

this works absolutly fine and record inserted in the MS SQL server.

problem occurs when in second run my user is changing the fields means he deletes the item from the PO, but it is not reflecting in the data base. only I can see previously created entery not the changed one. I have below payload in RWB for the receiver communication channel.

<?xml version="1.0" encoding="UTF-8" ?> 
- <ns0:MT_EKPO_RECEIVE xmlns:ns0="http://gspcgas.net/asset_rfid">
- <StatementName>
               - <dbTableName action="UPDATE_INSERT">
                  <table>EKPO</table> 
- <access>
           <EBELN>4500000687</EBELN> 
           <EBELP>00010</EBELP> 
          <MATNR>000000000100000012</MATNR> 
          <MENGE>1.000</MENGE> 
          <MEINS>EA</MEINS> 
          <WERKS>1000</WERKS> 
          <LGORT /> 
          <AEDAT>2011-12-12</AEDAT> 
          <BUKRS>1000</BUKRS> 
          <ANLN1>010023000315</ANLN1> 
          <PSTYP>0</PSTYP> 
          <KNTTP>A</KNTTP> 
          <LOEKZ>L</LOEKZ> <---- I receive the value here when user has deleted the item in the PO. 
  </access>
  - <Key1>
          <EBELN>4500000687</EBELN> 
          <EBELP>00010</EBELP> 
  </Key1>
  </dbTableName>
  </StatementName>
  </ns0:MT_EKPO_RECEIVE>

Please help me to understand why the changed values are not reflecting in my MSSQL server from PI. and tell me what should i do to correct it. I have no error message in RWB for the receiver communication channel. please reply me. your any reply will be highly appreciated. Please reply me

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 12, 2011 at 03:28 PM

    Hi Naim,

    Use a stored procedure on sql side and execute it from PI . It is easier to handle update and insert transactions. I can provide you the structure if you want.

    Regards,

    Teresa

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 13, 2011 at 12:21 AM

    Delete is handled differently when compared to an Update_Insert.

    an Update_insert statement is like a modify command. it either inserts an entry or changes it, but does not delete it. You need to specify the keys in the Update_insert XML-SQL.

    In case you have a scenario for delete along with update/insert, please do the following

    1. Let the source system determine an action, and pass it to PI

    2. Based on the action code, implement 2 split mappings using enhanced interface determination ( rule based interface determination).

    3. Implement 2 seperate maps for Delete and Update, and call them based on the action code rule from the interface determinaton.

    Hope this helps.

    Regards,

    Abhishek

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.