Skip to Content

SAP PO - Dynamic SQL query for JDBC adapter

Hello All,

Currently i am working on SAP PO 7.5 version (single stack) implementation project.

Where business have below mentioned requirement.


Currently they are using concept of 'DBCon' and 'DBLink' of ABAP to get info at runtime from third party database. Here User feeds data in SAP Form, where near textbox there is one button which provide data at runtime to user by fetching data from third party database.

Button Screenshot for example:

Now they need to migrate this scenario to SAP PO system.

Scenario :

1) For example user needs data of 'company site', than company site info will be passed as request from SAP PI using (proxy/rfc) to third party database (JDBC), and as a response message 'company site address' will be passed to ECC system. This scenario will be synchrounous.


1) Here user can pass 'A*' value than PI system should give All site info which starts with 'A'.

2) Here user can pass no value than PI system should give all site info from database.


1) For first problem, sql query at runtime will be like as below:

Select Sitemapaddr from Table where sitemap like 'A*'

2) For second problem, I need to read whole table data for sitemap, so query like below:

Select Sitemapaddr from Table.

So at runtime how i can manage this scenario?

Can you please help me as i am new to JDBC scenario.


Karan Kholakiya

4.jpg (11.0 kB)
Add comment
10|10000 characters needed characters exceeded

1 Answer

  • Best Answer
    Posted on Oct 14, 2016 at 07:36 AM

    Hi Karan!

    In your case you can use "SQL_QUERY" action for receiver JDBC message format:


    <anyName action=” SQL_QUERY” | “SQL_DML”>

    <access>SQL-String with optional placeholder(s)</access>





    </anyName >


    In <access> tag you put your dynamic SQL query, which can be sent within your request message.

    If you want to use any additional parameters for your query, you put it in your query as placeholders and set values for it in <placeholder> tags:


    <TestQuery action=”SQL_QUERY”>

    <access>Select * from Table1 where ID = $pl_ID$</access>




    </TestQuery >


    Regards, Evgeniy.

    Add comment
    10|10000 characters needed characters exceeded

    • Karan,

      The connectivity issue are system ack and i seriously doubt if this can be passed to the source or not , but as this is sync i guess the message remains in system error in ECC system in sxmb_moni(i hope it is proxy) and check if the ECC can read that error message.

      Try this workaround:

      1.Stop the reciever channel .

      2.Trigger a message from ECC and check the status/message in sxmb_moni.

      And ask abaper is they can read that error message.