cancel
Showing results for 
Search instead for 
Did you mean: 

'Insert' and 'Delete' on tables using message mapping.

Former Member
0 Kudos

Hi Experts,

I would like to know how 'Insert' and 'Delete' operation can be performed on a table using Message Mapping. Where do we have to write the query and How should be the target structure to include 'action' and 'table' attributes?

Regards,

Vishal

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

We can select the data from DATABASE for Lookup purpose in Msg mapping but can not be used stmnts like INSERT, DELETE;

In mapping program u can manupulate data after reading the original data ;

If u want normal structure of tgt using any SQL stmnt then it is like below one:

Stmnt name > ACTION > DB TABLE NAME > ACCESS > KEY ( WHERE COND).

welcome.

Deva

Former Member
0 Kudos

After creating the Insert structure as suggested in the link,I was unable to confirm if the data is inserted as it showed 0 rows selected.

former_member187339
Active Contributor
0 Kudos

Hi,

As mentioned by Raj an advanced UDF will only help. You can't use jdbclookup here

Regards

Suraj

former_member200962
Active Contributor
0 Kudos

Did you check this help section : http://help.sap.com/saphelp_nwpi71/helpdata/EN/2e/96fd3f2d14e869e10000000a155106/content.htm

Format is mentioned in there....map your action node accordingly to have a Insert, Update, Delete

Regards,

Abhishek.

Former Member
0 Kudos

Thanks.. That link was pretty useful..

Former Member
0 Kudos

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

<ns0:InsertTable xmlns:ns0="urn:abc:xyz:1.0">

<Insert>

<TableName Action="INSERT">

<Table></Table>

<access>

<ID></ID>

<DATE></DATE>

<FLAG>N</FLAG>

</access>

</TableName>

</Insert>

</ns0:InsertTable>

is the structure that I created for Insert statement. It doesn't throw any error in moni. But I am unable to see the data inserted in the table. Any modifications to be made in the structure?

Thanks,

Vishal

former_member187339
Active Contributor
0 Kudos

Hi Vishal,


<?xml version="1.0" encoding="UTF-8"?>
<ns0:InsertTable xmlns:ns0="urn:abc:xyz:1.0">
<Insert>
<TableName Action="INSERT">
<Table></Table>
<access>
<ID></ID>
<DATE></DATE>
<FLAG>N</FLAG>
</access>
</TableName>
</Insert>
</ns0:InsertTable>

Have you used this structure for insertion in message mapping? Or is it used in receiver DB side?

Regards

Suraj

former_member200962
Active Contributor
0 Kudos

I think the structure you are using is not having all the required nodes (like STATEMENT) have a look at this blog...it also deals with INSERT in DB scenario:

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

Regards,

Abhishek.

Former Member
0 Kudos

Yes.. I should give StatementName instead of Insert.. I am sending date in the following format:

d/m/yyyy h:mm:ss AM/PM. But I am getting "java.sql.SQLException: ORA-01843: not a valid month" exception. Please suggest..

Thanks,

Vishal

former_member200962
Active Contributor
0 Kudos

Cross-check the Date format that your DB is expecting...may be it is expecting DD/MMM/YYYY HH:MM:SS

Former Member
0 Kudos

I tried all possible combinations.. Still it throws 'not a valid month' error..

former_member200962
Active Contributor
0 Kudos

Did you contact the person maintaining the table/ DB and confirm from him what is the Date-Time format that is expected by the Table/ DB, if not then do contact him/ her.

Regards,

Abhishek.

Former Member
rajasekhar_reddy14
Active Contributor
0 Kudos

Hi,

Yes you can,but you need to write advaced user defined function to conenct to data base and using statemnt object you can execute query.

cheers,

raj