cancel
Showing results for 
Search instead for 
Did you mean: 

SRM SQL Query to get Contract Number for a Purchase Order

Former Member
0 Kudos

I need to write a SQL query to be able to extract the Contract Number for a Purchase Order number. I know the main tables are BBP_PD*, CRMD_ORDERADM_H & I, but I am unable to get a query working.

Any help appreciated.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Contract number is maintained via the item details so it would be:

CRMD_ORDERADM_H-OBJECT_ID -> get GUID

With CRMD_ORDERADM_H-GUID as CRMD-ORDERADM_I-HEADER get GUID

With CRMD_ORDERADM_I-GUID as BBP_PDIGP-GUID get CTR_HDR_NUMBER.

A very useful transaction is BBP_PD in SRM it will give you all the involved tables for the document you want

Regards,

Robin