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.

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.

Problems/Issues:

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.

Concerns:

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.

Regards,

Karan Kholakiya

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

  • Follow
  • Get RSS Feed

1 Answer

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

    Hi Karan!

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

    <StatementName6>

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

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

    <key>

    <placeholder1>value1</placeholder1>

    <placeholder2>value2<placeholder2>

    </key>

    </anyName >

    </StatementName6>

    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:

    <StatementSelect>

    <TestQuery action=”SQL_QUERY”>

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

    <key>

    <pl_ID>00023</pl_ID>

    </key>

    </TestQuery >

    </StatementSelect>

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

    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.

      Br,

      Manoj