cancel
Showing results for 
Search instead for 
Did you mean: 

jdbc adapter

Former Member
0 Kudos

hi all

jdbc adapter

my scenario is ECC---XI-- -


third party(DB)

The sender initiates a synchronous call to XI and the Response Details (role) are fetched from DB and sent back to ECC.

now i have configured the scenario on the XI ,but don't kown how to program on the ecc .

can anybody give some advices or supply some codes to me .

thank you .

Edited by: ALANWANG on May 13, 2009 7:30 AM

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

hi all

thanks a lot for your reply .

i have done the program .

when test , run sxmb_moni , sender message has been successful ,but response message failed

- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">

<SAP:Category>XIAdapterFramework</SAP:Category>

<SAP:Code area="MESSAGE">GENERAL</SAP:Code>

<SAP:P1 />

<SAP:P2 />

<SAP:P3 />

<SAP:P4 />

<SAP:AdditionalText>com.sap.aii.af.ra.ms.api.DeliveryException</SAP:AdditionalText>

<SAP:ApplicationFaultMessage namespace="" />

<SAP:Stack />

<SAP:Retry>M</SAP:Retry>

</SAP:Error>

following is my code in ecc :

REPORT ZTEST.

DATA : l_send_req TYPE REF TO ZCO_MI_FY_OUT .

DATA : ls_output TYPE zmt_fy_out.

DATA : ls_input TYPE zmt_return .

DATA l_system_message(100) TYPE c .

DATA : l_s_e TYPE REF TO cx_ai_system_fault .

TRY.

create OBJECT l_send_req .

CATCH cx_ai_system_fault .

ENDTRY.

ls_output-mt_fy_out-statement-sql-access = 'select name from bb ' .

ls_output-mt_fy_out-statement-sql-action = 'SQL_QUERY'.

TRY .

CALL METHOD l_send_req->MI_FY_OUT

EXPORTING

output = ls_output

IMPORTING

input = ls_input .

CATCH cx_ai_system_fault INTO l_s_e.

CALL METHOD l_s_e->get_text

RECEIVING

result = l_system_message .

WRITE :l_system_message .

ENDTRY.

can anybody help me ?

former_member181955
Contributor
0 Kudos

Hi

Please check the following things.

1.Please make sure proper jdbc driver installed.

2.As it is syncronous scenario please check the response message type of Database.

For Example:

If your request message type of Database is "MT_db_Req" (Message type).

Then Your Response message type shoulb be like this.

<MT_db_Req_response>

---<StatementName_response>

-


<row>

So please make sure that you have respone message type(database) as mentioned above.

Thanks

Prasad Nemalikanti

Former Member
0 Kudos

hi Prasad

thanks for your reply .

yes ,the two things are both all right .

jdbc driver is installed .

And my response message type is following :

<MT_RETURN>

---<STATEMENT>

---<ROW>

<NAME>

former_member181955
Contributor
0 Kudos

Hi ALANWANG

Will you please give me your request message type of target(Dataabase).

Also please check the response message in SXMB_MONI ,you can find the problem.

Thanks

Prasad Nemalikanti

Former Member
0 Kudos

HI Prasad

following is my request message :

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

- <ns1:MT_FY_OUT xmlns:ns1="http://test/test">

- <STATEMENT>

- <SQL>

<ACCESS>select name from bb</ACCESS>

<ACTION>SQL_QUERY</ACTION>

</SQL>

</STATEMENT>

</ns1:MT_FY_OUT>

former_member200962
Active Contributor
0 Kudos
And my response message type is following :
<MT_RETURN> 
---<STATEMENT>
---<ROW>
<NAME>

This is not the correct response structure

whenever you get a response from DB.....DB attaches a _response to the request MT name..

So if your request MT is

<MT_JDBCRequest>

xyz

</MT_JDBCRequest>

Then in XI you should have your response MT as

<MT_JDBCRequest-response>

xyz

</MT_JDBCRequest_response>

If this is not followed then you are bound to get an error

former_member200962
Active Contributor
0 Kudos

>

> HI Prasad

>

> following is my request message :

>

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

> - <ns1:MT_FY_OUT xmlns:ns1="http://test/test">

> - <STATEMENT>

> - <SQL>

> <ACCESS>select name from bb</ACCESS>

> <ACTION>SQL_QUERY</ACTION>

> </SQL>

> </STATEMENT>

> </ns1:MT_FY_OUT>

now response should be:

<MT_FY_OUT_response>.......

Edited After This:

Check this blog and have your structure accordingly:

/people/bhavesh.kantilal/blog/2006/07/03/jdbc-receiver-adapter--synchronous-select-150-step-by-step

Edited by: abhishek salvi on May 14, 2009 12:45 PM

former_member181955
Contributor
0 Kudos

Hi

Now your response message type will be as follows

<MT_FY_OUT_response>

<STATEMENT_respose>

<row>

You please check the error message in SXMB_MONI there you can find your response message , accordingly you can change your response message type in IR.

Thanks

Prasad Nemalikanti

Former Member
0 Kudos

hi

i have changed my response message name to

<mt_fy_out_response>

---<statement_response>

-


<row>

-


<name>

but the error still exist

REPORT ZTEST.

DATA : l_send_req TYPE REF TO ZCO_MI_FY_OUT .

DATA : ls_output TYPE zmt_fy_out.

DATA : ls_input TYPE zmt_fy_out_response .

DATA l_system_message(100) TYPE c .

DATA : l_s_e TYPE REF TO cx_ai_system_fault .

TRY.

create OBJECT l_send_req .

CATCH cx_ai_system_fault .

ENDTRY.

ls_output-mt_fy_out-statement-sql-access = 'select name from bb ' .

ls_output-mt_fy_out-statement-sql-action = 'SQL_QUERY'.

TRY .

CALL METHOD l_send_req->MI_FY_OUT

EXPORTING

output = ls_output

IMPORTING

input = ls_input .

CATCH cx_ai_system_fault INTO l_s_e.

CALL METHOD l_s_e->get_text

RECEIVING

result = l_system_message .

WRITE :l_system_message .

ENDTRY.

former_member200962
Active Contributor
0 Kudos
ls_output-mt_fy_out-statement-sql-access = 'select name from bb ' .
ls_output-mt_fy_out-statement-sql-action = 'SQL_QUERY'.

are you executing SQL Query....then extremely sorry for ignoring this.....

Check out response of Rajeev Gupta from the below thread:

this response will solve your error....

Regards,

Abhishek.

Former Member
0 Kudos

hi

i have reviewed the link .

but unfortunately , i didn't get the way .

please help again .

former_member200962
Active Contributor
0 Kudos
following is my request message :

<?xml version="1.0" encoding="UTF-8" ?> 
- <ns1:MT_FY_OUT xmlns:ns1="http://test/test">
- <STATEMENT>
- <SQL>
<ACCESS>select name from bb</ACCESS> 
<ACTION>SQL_QUERY</ACTION> 
</SQL>
</STATEMENT>
</ns1:MT_FY_OUT>

you should have the structure as:

- <ns1:MT_FY_OUT xmlns:ns1="http://test/test">
- <STATEMENT>
- <SQL>
<ACTION>SQL_QUERY</ACTION> --------------------------> *ACTION is not an element it is an Attribute*
<ACCESS>select name from bb</ACCESS> 
</SQL>
</STATEMENT>
</ns1:MT_FY_OUT>

Former Member
0 Kudos

my request mesage has been changed

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

- <ns1:MT_FY_OUT xmlns:ns1="http://test/test">

- <STATEMENT>

- <SQL>

<ACTION>SQL_QUERY</ACTION>

<ACCESS>select name from bb</ACCESS>

</SQL>

</STATEMENT>

</ns1:MT_FY_OUT>

but the error still occured.

Former Member
0 Kudos

Proxy is nice option,for that

you can check the SPROXY tcode in ECC ,there you can see the interfaces which you designed in PI

double click and generate proxy class, that's it .. you can use that class for your cause.

Former Member
0 Kudos

Hi Allan,

your question is "but don't kown how to program on the ecc" ..

As per your scenario's you are sending the DB Responce back to ECC . hence

i think RFC or Proxy you can use as IDOC is out of Question .........!

Regards,

Aziz khan.

Former Member
0 Kudos

Check out this :

/people/ravikumar.allampallam/blog/2005/03/14/abap-proxies-in-xiclient-proxy

Regards,

Sunil.

Former Member
0 Kudos

Hi,

U can use RFC for this...

In which RFC / BAPI will send request to XI and get response from XI.

Regards,

Manisha

former_member200962
Active Contributor
0 Kudos
now i have configured the scenario on the XI ,but don't kown how to program on the ecc .

one way is the creation of proxy....