What's the Simplest way to determine Table's Schema?

DBohner-(db)

Legendary Poster
What\'s the Simplest way to determine Table\'s Schema?

Ok - I'm getting missing a cog or two, again...

Goal - Identify a Table's Schema and pass the value to an external process.

Real Question:
Since a table can be mapped to any schema - what's the shortest process to identifying the mapped schema is, for a given table for a running UBE/APP?

Sorry to annoy y'all

(db)
 
Re: What\'s the Simplest way to determine Table\'s Schema?

Dan,

What about looking up the OCM using the table name, object type and environment. If nothing returned look up the environment, object type and DEFAULT. You may need to throw the system role in there somewhere too.
 
Re: What\'s the Simplest way to determine Table\'s Schema?

Never used this BSFN Daniel but you might look at B95150B - Get Table Data Source Mapping.
Looks like it will tell you the mapped data source for a table in the current environment. From there you can read the Data Source Master (SY900.F98611) which will tell you the Database Server, Schema Name, and Owner.
 
Re: What\'s the Simplest way to determine Table\'s Schema?

Yeah, I was hoping to find a function that 'simply' returned the schema for a defined table...
- you know, pass the table name and get the schema back (testdta, crpdta, proddta....).

In this case, I know the custom table will always be in the 'Business Data', and not OCM'd off to some other galaxy. I'm just going to hard-code, based on environment.

If anyone ever finds a short route, where we don't have to cascade a couple functions and default if not found - please update this thread?

Thanks @Peter / @Larry....

(db)
 
Re: What\'s the Simplest way to determine Table\'s Schema?

Hi Daniel... I've used this process before, and it works well. It's two steps -- invoke the BSFN and then hit F98611. As I understand it, the BSFN will always return a value, and it handles the DEFAULT data source if a specific mapping is not found.
 
Back
Top