cancel
Showing results for 
Search instead for 
Did you mean: 

How to create reciver JDBC structure with key fields..?

Former Member
0 Kudos

Hi All,

I have DB table like below with promary key & FK relations . Please create the key field structure. I have read help.sap docs but did not get that col1,col2.vol1,val2....etc words .

I need sample structure please help hear is the table

for above table i have created structure like below

Hear is the problem am facing, now i was confused to create key filed tag i don't know how to create plz help..?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

I need to know below two points according my DB table mentioned above :

1. Should i create all PK,FK1,FK2 fields in key filed segment ?

2. Is it mandatory to keep the key fields both in access segment & key segment .?

Please help me on this

Vin

former_member191435
Contributor
0 Kudos

Hi SIngh,

As mentioned Hareesh,,

If your query is insert then there is no need to mention the Key field segment...

If it is update_insert please maintain PK field in both segments...

Thanks,

Sreenivas

former_member184720
Active Contributor
0 Kudos

1. Should i create all PK,FK1,FK2 fields in key filed segment ?

If your PK,FK1 and FK2 are also part of unique index then yes you have to mention them all.

2. Is it mandatory to keep the key fields both in access segment & key segment .?

Yes.

Former Member
0 Kudos

If your PK,FK1 and FK2 are also part of unique index then yes you have to mention them all.

what is " Part of unique index " i dont know please give detail.

Vin

former_member184720
Active Contributor
0 Kudos

What i meant by unique key was a kind of composite primary key where in -

The table maintains a unique combination for the defined fields. You can find it if you open the table structure or check with your DB team.

i.e. In your database table, if PK1,FK1 and FK2 can have only one entry per combination which might not be the case most of the times.

May be you can just add the Primary key PK1 as that still works..

former_member191435
Contributor
0 Kudos

VK,

As mentioned my previous post... Please maitain PK in both segments...

Thanks,

Sreenivas

Answers (1)

Answers (1)

former_member184720
Active Contributor
0 Kudos

Just create another segment with "key" in the same level as "access" and add your key fields under it.

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

http://www.ijunglee.com/entries/sap-pi/idoc-to-jdbc-%E2%80%93-multiple-table-insert-update

If your action is " UPDATE_INSERT" and would like maintain an OR condition between the key fields then you'll have to deinfe separate KEY segment for each key field.

Former Member
0 Kudos

Hi Hareesh,

Should i need to add all PK , FK1,FK2  fields as mentioned in above table..? please find below is it correct ..?

former_member184720
Active Contributor
0 Kudos

HI Vin - What is your action ? Are you inserting or updating? or insert_update?

If it is a plain insert then there is no need to mention the Key segment at all.

If it is update_insert then your strcture should work (i hope the all the three key fields are part of your unique index)


former_member191435
Contributor
0 Kudos

Hi Singh,

Please follow below links..

SAP PI Adapter Series: JDBC Adapter Configuration

IDOC To JDBC – Multiple Table Insert/Update | iJunglee.com

Please let me know if you still face an issue..

Thanks,

Sreenivas

Former Member
0 Kudos

Am using UPDATE_INSERT