cancel
Showing results for 
Search instead for 
Did you mean: 

update table ( Receiver JDBC)

Former Member
0 Kudos

Hi,

I want to update the table jai_tab2 and set thee values for Emp_Id,Emp_name,Department,Status with the values 1001, jaishankar, xi, 1234 resp.. Earlier the values were 1000, jai, xi, 1. I have designed the data type like

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

<STATMENTNAME>

<TEST action="update">

<TABLE>jai_tab2</TABLE>

<access>

<Emp_Id>1001</Emp_Id>

<Emp_Name>jaishankar</Emp_Name>

<Department>xi</Department>

<Status>1234</Status>

</access>

<key>

<Emp_Id>1000</Emp_Id>

</key>

</TEST>

</STATMENTNAME>

But I am getting a mapping exception for this. I have checked the mapping with inbound payload, mapping seems to be fine. What am I missing in this scenario?

Thanks & Regards,

Jai Shankar.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Jai,

Try with "UPDATE" in the action attribute instead of "update".

sekhar

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Jai,

After u arrange the Datatype..

Your xml should be like...

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

<STATMENTNAME>

<jai_tab2>

<TEST action="update">

<access>

<Emp_Id>1001</Emp_Id>

<Emp_Name>jaishankar</Emp_Name>

<Department>xi</Department>

<Status>1234</Status>

</access>

<key>

<Emp_Id>1000</Emp_Id>

</key>

</TEST>

</STATMENTNAME>

regards

Mahesh

Former Member
0 Kudos

Hi Jai,

Just try this out:

Instead of TEST tag, name it as ur table name(with exact case).

Remove the table tag.

Leave other things as they are.

Check it out and let me know if this works

Regards

Neetu

Former Member
0 Kudos

Hi All,

Thanks. The problem was I dint have previlage to update the table. I tried updating the table from SQL Querry analyser and it dint work. I l have to contact my database admin for this.

Neetu thanks for that alternative approach. My table name is jai_tab2, can you tell me how my data type must look like(XML format)

Thanks & Regards,

Jai Shankar.

Former Member
0 Kudos

Hi jai,

There are two formats for this datatype:

Format 1:

Statement...........Element...........Occurence-1

....jai_tab2........Element(sub)......Occurence-1

....action..........Attribute.........Required

....access..........Element...........Occurence-1

......Emp_Id........Element(sub)......Occurence-1

......Emp_Name......Element(sub)......Occurence-1

......Department....Element(sub)......Occurence-1

......Status........Element(sub)......Occurence-1

....key.............Element...........Occurence-1

....Emp_Id..........Element(sub)......Occurence-1

Format 2:

Statement...........Element...........Occurence-1

....Test............Element(sub)......Occurence-1

....action..........Attribute.........Required

....table...........Element...........Occurence-1

....access..........Element...........Occurence-1

......Emp_Id........Element(sub)......Occurence-1

......Emp_Name......Element(sub)......Occurence-1

......Department....Element(sub)......Occurence-1

......Status........Element(sub)......Occurence-1

....key.............Element...........Occurence-1

....Emp_Id..........Element(sub)......Occurence-1

In the second format the table tag should contain the exact name of the table with proper case.

Regards

Neetu

Message was edited by: neetu gupta

Former Member
0 Kudos

Hi All,

Thanks a lot for that.

Thanks & Regards,

Jai Shankar.

sridharreddy_kondam
Active Contributor
0 Kudos

Hi Jai,

Did u map the Target top node to the source structure..

try by doing it.. may be the problem..

Add trace and debug in the message mapping..

Goto sxmb_moni copy the payload xml and paste it under test tab and set the trace to get the exacy position where its failing, may be you will get some light

Check thoroughly whether u have mapped source and target fileds correctly....

Regards,

Sridhar

Message was edited by: sridhar reddy kondam

Message was edited by: sridhar reddy kondam

Former Member
0 Kudos

Sridhar,

Emp_Id is not a primary key. Also I tried updating other fields, no success. I have checked the message mapping by testing it with the inbound pay load, it doesnt give me any error. It seems to be fine.

Thanks & Regards,

Jai Shankar.

Former Member
0 Kudos

HI,

1)Check whether Emp_Id is primarykey, in that case you may not be able to update the key field value.

2)Stop both the adapters for a minute and clear all the queues. Then restart the adapters.

/people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30 - File to JDBCS

/people/alessandro.berta/blog/2005/10/04/save-time-with-generalized-jdbc-datatypes - JDBC DATATYPES

regards

Mahesh.M

Former Member
0 Kudos

Hi Sekahar,

I tried with "UPDATE". Still I am getting the error.

The error msg I get in SXMB_MONI is

During the application mapping

com/sap/xi/tf/_MM_SND_ a

com.sap.aii.utilxi.misc.api.BaseRuntimeException

was thrown: RuntimeException in Message-Mapping

transformatio~

Also there is no primary key set in the table.

Thanks & Regards,

Jai Shankar.