Skip to Content

Child/Parent Relationship Query

I'm using SAP BO 9.0

I use a query to view the BP Code child/parent relationships here:

SELECT T0.[ItemCode], T0.[CardCode], T0.[Substitute] FROM OSCN T0 WHERE T0.[CardCode] ='ENET-TD'

Result:

# Item No. BP Code BP Catalog Number 1 0061003020-COR ENET-TD CWDM-SFP-1470-ENC Y 2 0061003020-ENC ENET-TD CWDM-SFP-1470-ENC Y 3 0061003021-COR ENET-TD CWDM-SFP-1490-ENC Y 4 0061003021-ENC ENET-TD 0061003021-ENC Y

I need it to include more than one BP Code [CardCode]. The BP Codes [CardCode] I need included are ENET-TD, C000156, C000310, C000312.

I also need it to include all parts that don’t have any BP Codes [CardCode], Item Group, and Description

 

Here is an example of the query needed:

#

Item No.

Item Group

BP Code

BP Catalog Number

BP Code

BP Catalog Number

BP Code

BP Catalog Number

BP Code

BP Catalog Number

Description

1

0061003024-ENC

104

ENET-TD

1234567890-ENC

C000156

XJ4470

C000310

ECM-0061003024-ENC

C000312

ENE-0061--3024-ENC

1000BASE-CWDM SFP 1GE 2G FC 1550nm 80km DOM SMF LC Connector

Thank you in advance for your help.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Oct 30, 2015 at 05:21 PM

    Hi

    Try this

    SELECT T0.[ItemCode], T0.[ItemName], T3.[ItmsGrpNam], T1.[Substitute], T2.[CardCode], T2.[CardName] FROM OITM T0  INNER JOIN OSCN T1 ON T0.[ItemCode] = T1.[ItemCode] INNER JOIN OCRD T2 ON T0.[CardCode] = T2.[CardCode] INNER JOIN OITB T3 ON T0.[ItmsGrpCod] = T3.[ItmsGrpCod] where T2.cardcode in ( 'ENET-TD', 'C000156', 'C000310', 'C000312')

    Add comment
    10|10000 characters needed characters exceeded