Skip to Content
0
Former Member
Mar 11, 2010 at 06:54 AM

Why do Duplicate Entries appear in DBase View

48 Views

Hello,

Foremost of all, i did a search in SDN on this problem, and i could find only 1 post which too remains unresolved.

So kindly do excuse me and provide helpful replies 😊

Issue:-

I've created a Database View (CRM) with 4 base tables and have considered all the key fields in join condition.

When i execute the View i get duplicate and unexpected entries as result.

Just to test if my Join Condition was OK, i made a test program and simulated the same case there and it works fine in my test code, i.e. it gives the correct result (no duplicate/unexpected entries).

I'll paste the DBase View Join statements here :-

TABLES:-

CRMD_ORDERADM_H

CRMD_LINK

CRMD_SALES

CRM_JEST

JOIN CONDITIONS

CRMD_ORDERADM_H-CLIENT = CRMD_LINK-CLIENT

CRMD_ORDERADM_H-GUID = CRMD_LINK-GUID_HI

CRMD_SALES-CLIENT = CRMD_LINK-CLIENT

CRMD_SALES-GUID = CRMD_LINK-GUID_SET

CRMD_ORDERADM_H-CLIENT = CRM_JEST-MANDT

CRMD_ORDERADM_H-GUID = CRM_JEST-OBJNR

VIEW FIELDS

CRMD_SALES-PO_NUMBER_SOLD

CRM_JEST-STAT

SELECTION CONDITIONS

CRMD_LINK-OBJTYPE_HI = '05' AND CRMD_LINK-OBJTYPE_SET = '11' AND CRM_JEST-INACT = ' '.

VIEW OUTPUT

cccc E00017

cccc E00017

cccc I0014

cccc I0014

cccc I0003

Now the Test Code

SELECT a~po_number_sold  b~stat
INTO TABLE test
FROM crmd_orderadm_h AS c INNER JOIN crmd_link AS d
ON c~client = d~client AND c~guid = d~guid_hi
INNER JOIN crmd_sales AS a
ON  d~client = a~client
AND d~guid_set = a~guid
INNER JOIN crm_jest AS b
ON c~client = b~mandt AND c~guid = b~objnr
WHERE a~po_number_sold = extref AND
  d~objtype_hi = '05' AND d~objtype_set = '11' AND b~inact = ' '.

CODE OUTPUT

cccc E00017

cccc I0014

BR

Dedeepya