cancel
Showing results for 
Search instead for 
Did you mean: 

Placeholder in Receiver JDBC synchronous scenario

Former Member
0 Kudos

Dear Experts,

I have a synchronous scenario of ABAP Proxy to JDBC. The Database stores all Customer Information.Proxy sends request to fetch data from Database and expects response with all the details of information which will multiple records.

The request input field will contain primary key Customer id number . The request will have to fetch all the customer id which may start either from A***** or B***** or C***** or any string . For example if I enter A% , then all the customer name which starts from A will be sent as response.

I referred to the link

http://help.sap.com/saphelp_srm40/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.html

and was looking at the Attributes section with Compare Operation.


1.In the Oracle Request structure, where can I place the compareOperation=LIKE along with the Customer Id under the root "Key".


2.In the Mapping  , where should I put the placeholder % in the Constant function ?

Please correct me..

Regards

Rebecca

Accepted Solutions (1)

Accepted Solutions (1)

iaki_vila
Active Contributor
0 Kudos

Hi Rebecca,

First of all, a placeholder is a variable taken from the PI memory generated in other step and you can set the variable between $ sign.

You can try to do the "Like" like the Oracle documentation says (SQL Escape Sequences for JDBC😞

SELECT col1 FROM table1 WHERE col1 LIKE '*%%' {escape '*'}

Regards.

Former Member
0 Kudos

Dear Inaki ,


I tried various combination for the input value of the key field but the response message is generated with no payload.


Below is my Request and Response Message Content from Message Monitoring of NWA.



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

- <ns0:MT_ECCJDBC_JDBCReq xmlns:ns0="urn:cust:details">

- <STATEMENT>

- <TABLENAME ACTION="SELECT">

   <TABLE>CUSTDETAILS</TABLE>

- <ACCESS>

   <DEVID />

   <MACHINE />

   <CUSTNAME />

   <CUSTID />

  </ACCESS>

- <KEY>

  <CUSTNAME compareOperation="LIKE">A%</CUSTNAME>

</KEY>

  </TABLENAME>

  </STATEMENT>

  </ns0:MT_ECCJDBC_JDBCReq>


==============================RESPONSE==============================

 

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


- <ns0:MT_ECCJDBC_ECCResp xmlns:ns0="urn:cust:details">

- <RESPONSE>

- <ROW>

<DEVID />

<MACHINE />

<CUSTNAME />

<CUSTID />

</ROW>

  </RESPONSE>

  </ns0:MT_ECCJDBC_ECCResp>

Note :

1.When queried in SQL plus , I can find 4 records which starts from A.

2.In the input parameter for Key , I tried with A*, A*%% but all the time I get response with no data.

3. Please dont confuse the with MT of ECC as I have maintained correct naming convention of JDBC response with "_response".

Regards

Rebecca

Former Member
0 Kudos

Hi Rebecca.

If you use the optional <table> element, the specified value is used as the database table name.

Do not change the name of the tag.

<table><dbTableName>

Regards.

Answers (1)

Answers (1)

iaki_vila
Active Contributor
0 Kudos

Hi Rebecca,

After to try Luis tip you could use a SQL_QUERY format.

Regards.