cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Get individual primary key values from CDHDR table

Noor534
Explorer
0 Kudos
301

Dear all

In CDHDR table, there is a TABKEY column. That column stores the primary key columns concatenated value.

For example, for BSEG, it is something like this -

508123477777777702024666

I realised the pattern falls under this category -

MANDT(3 digits)||BUKRS(4 digits)||BELNR(10 digits)||GJAHR(4 digits)||BUZEI(3 digits)

Now, I like to get the individual column values from the concatenated value. I read in few blogs that there could be a mapping table that helps us to have this logic at scale for several other tables as well like MARA.

Appreciate if you can share with me the SQL query that could translate this mapping at scale for 1000s of SAP tables.

Please note I have replicated from SAP ERP CDPOS & CDHDR tables into Databricks. So, I have to get this logic (SQL query to get primary key columns names in a particular order, then get the individual values from the concatenated TABKEY value based on their positions & length) implemented within Databricks only...

Appreciate any support in this matter 

Br,

Noor.

Accepted Solutions (0)

Answers (0)