Skip to Content

JDBC connection from SAP PI to HANA - Read from a View instead of Table

Hello,

We have a scenario where we need to read data from HANA DB using JDBC connection via PI 7.31 SP12. Though we are able to read the data successfully from a table on HANA db the requirement is to read the data from a view on HANA DB. Is it feasible to read the data from the a view and if yes could you please share the schema for it as well or direct me to the required documentation.

The schema being used to read from the Table:

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

<ns0:MT_KNA1_HANA_Request xmlns:ns0="http://abc.com/hana">

- < Statement >

- < dbTableName action =" SELECT " >

< table > ECCDATA.KNA1 </ table >

- < access >

< MANDT />

< KUNNR />

< LAND1 />

< PSTLZ />

</access>

- < key >

< MANDT > 080 </ MANDT >

< KUNNR > 0000000106 </ KUNNR >

</key>

</dbTableName>

</Statement>

</ns0:MT_KNA1_HANA_Request>

Thanks,

Ashish

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    Apr 06, 2016 at 12:17 AM

    The JDBC adapter converts the xml to a select query.

    So, as with performing a select over a view the table name in the JDBC request xml should be the name of the view.

    Did you try this?

    Regards

    Bhavesh

    Add comment
    10|10000 characters needed characters exceeded

    • Just FYI...the issue was resolved after the following three were fixed.

      1. PI was updated to pass "_SYS_BIC"."ABC_FUSION.TEST_ORDER.ORDER_HISTORY/VBAK_VBAP" instead of just _SYS_BIC.ABC_FUSION.TEST_ORDER.ORDER_HISTORY/VBAK_VBAP i.e "RuntimeSchema"."PackageName/ViewName"
      2. Schema (UserID) did not have access to the view.
      3. Fields 'W_DATE_FROM' and 'W_DATE_TO' were missing in the view.

      Bhavesh thanks for your help.