cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC adapter / Skip mapping of tables

Former Member
0 Kudos

Hi,

i have created following scenario within mapping of 10 tables:

SAP => PI => JDBC adapter => Oracle DB

It could be that not all tables were filled from the source.

So how can i manage it to skip the mapping if several tables empty?

(because in this case the xml-format for the posting in the DB do not have any entry)

Regards,

Lutz

Accepted Solutions (0)

Answers (3)

Answers (3)

arkesh_sharma
Active Participant
0 Kudos

You can implement it either using If-Then-Else statements where you can check if the value coming from the target is empty or not. If its not empty then pass the desired value otherwise skip it.

The other solution is, You create a UDF and use that function as a check before passing values from source to target.

I hope that helps.

Thanks,

Arkesh

Former Member
0 Kudos

>>i have created following scenario within mapping of 10 tables:

I believe you have created 10 Statement nodes in your mapping.

If you dont need to populate all 10 tables, just dont fill the corresponding Statement nodes in the mapping. That is create only 7(depending on the source) Statement nodes in your mapping.

Thanks

Jai

Former Member
0 Kudos

Jaishankar:

Correct - i have created 10 statements.

Your suggestion is to check if the node is empty. Can i use for that the <if> function in graphically mapping?

And: Which node do you mean? The STATEMENT (highest) node?

former_member200962
Active Contributor
0 Kudos
SOurce -->
                   -->equalS -->Not --> If (then -->Source) --> Target
Constant(keep-Blank)-->

Above logic checks if the source is blank....

Keeping the min occurence of the target node as 0 will help.

Edited by: abhishek salvi on Apr 30, 2010 2:17 PM

Former Member
0 Kudos

>>Your suggestion is to check if the node is empty. Can i use for that the <if> function in graphically mapping?

You can use exists function.

>>And: Which node do you mean? The STATEMENT (highest) node?

You should be having 10 Statement nodes in your mapping. May be if you can give the sample xml created from mapping, I could guide you better.

former_member200962
Active Contributor
0 Kudos
You can use exists function

even an empty instance of the source node will cause the [Exists function|http://help.sap.com/saphelp_nwpi71/helpdata/EN/db/83f7b88528424c9113b15d5e0fb516/content.htm] to give output as true......we cannot use it to check if the node has or does not have data inside it.

Former Member
0 Kudos

Hi,

thanks all for your support.

For better understanding here the mapping:

source structure:

MSG1

tab1

item1

field11

field12

tab2

item2

field21

field22

...

target structure:

MSG1

statement1

record1

action

table

access1

field11

field12

statement2

record2

action

table

access2

field21

field22

...

mapping:

MSG1 => MSG1

tab1 => statement1

item1 => access1

field11 => field11

...

tab2 => statement2

item2 => access2

...

At which node i have to use the graphically mapping with the if-then-else function, so

that the target table will skip?

Do i have to use the if-the-else mapping at each node or only at one (highest) node?

Thx,

Lutz

Former Member
0 Kudos

I tested it with graphically mapping and if-then function to map the node of statement,

but the result is that nothing will mapped. I guess the mapping didn't execute while the highest node is empty

although the table of this statement is filled.

How can i check if an incoming table is filled?

former_member200962
Active Contributor
0 Kudos

Is your requirement to stop the processing if there is no data in source structure? If yes, then you have to implement a check in Receiver Determination.

Regards,

Abhishek.

Former Member
0 Kudos

No, not to stop the processing if tables empty. The whole message have to process if several tables empty.