cancel
Showing results for 
Search instead for 
Did you mean: 

SQLScript: Read DDIC tables

martin_lehmann4
Active Participant
0 Kudos

Hello Experts,

we use table UDFs for our calculation views and I would like to know how to read from BW DDIC tables within these scripts. I see them only in the schema of BW system e.g. "SAPD50" so that I can read the hierarchy table of info object 0COMP_CODE with "SAPD50"."/BI0/HCOMP_CODE". But I can't transport the script this way, because "SAPD50" changes its name to "SAPT50" in the test and "SAPP50" in the prod system.

Is it possible to create an own schema for table /BI0/HCOMP_CODE or is there another system schema where I can access these kind of tables?

Best regards
Martin Lehmann

Accepted Solutions (1)

Accepted Solutions (1)

pfefferf
Active Contributor
0 Kudos

In case you are working with XS Classic you can define a Default Schema in the function header. This default schema is then used in case you use an object in the function body without a schema. This default schema must be an authoring schema to which a physical schema is mapped. With that the authoring schema stays constant, but is mapped to different physical schemas on your systems. Documentation: Map Authoring Schema to the Physical Schema

In case you are using XS Advanced you can use a synonym pointing to your table. Depending on the deployment target the synonym configuration must be provided, at deployment point of time, pointing to schema in which the object is available. If you are directly specify the schema name within the synonym configuration or if you are using a logical schema (pointing to the schema) within the synonym configuration is your decision.

martin_lehmann4
Active Participant
0 Kudos

Hi Florian,

thanks for the info - we are still on XS Classic ... and have already a synonym called "ABAP" for Schema "SAPD50" in table M_SCHEMA_MAPPING. But when I refer to this Schema via SQLScript I get the error message

Dependent object not found:SqlScript; ABAP.BI0/HCOMP_CODE: symbol not found

Might this be an authorisation problem to be solved by a role assignment to Schema "ABAP"?

pfefferf
Active Contributor
0 Kudos

You used the authoring schema in the body? That is not possible. As described the authoring schema needs to be set as default schema and in the body of the procedure the objects do not need to have the schema information.

martin_lehmann4
Active Participant
0 Kudos
DEFAULT SCHEMA ABAP

in the function header was it, thanks again!

Answers (0)