Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Duplicate entries in Database View

Former Member
0 Kudos

Hi ,

I created view to get Sales Order BOM Material, PO Number , Vendor Name and Status of Sales Order based on Sales Order Number. I'm able to retrieve the Values but duplicate entries are coming in View.

How to avoid duplicates ?

Thanks,

anjani.

7 REPLIES 7

former_member188685
Active Contributor
0 Kudos

are they really duplicates, did you check it.

did you check select conditions.

check them properly..

vijay

Message was edited by: Vijay Babu Dudla

Former Member
0 Kudos

Hi Anajani,

Please check whether you are using proper keys in the

Table/ Join conditions. Provide the complete key then

you wont get duplicate values.

Thanks&Regards,

Siri.

madan_ullasa
Contributor
0 Kudos

Hi,

Im not sure if u vill get duplicates after creating a view. anyways if u r using this view in ur program, and u get duplicates , use " DELETE ADJACENT DUPLICATES "...

I was also getting duplicates when i used " inner join" in select statement. And database views are created using inner joins...

regrds,

Madan...

Former Member
0 Kudos

Hi Anjani,

You should be careful when creating views.

There are proper conditions to create a view. If you have

identified those conditions then you can create a view.

If the view is created with proper keys there will not be

any duplicate values. This link may help you in how to specify the conditions.

http://help.sap.com/saphelp_erp2004/helpdata/en/cf/21ec5d446011d189700000e8322d00/frameset.htm

Hope it helps you.

Regards,

Maheswaran.B

Former Member
0 Kudos

Please give us the tables you used in the view and your selection condition. Please explain what 'Sales Order BOM Material' means. Are you going to BOM tables directly? Then I am afraid, duplication is quite possible. A BOM in MAST for a material plant combination can have multiple alternates and also can remain in the table if there are multiple BOMs with different validity periods. I don't think you can simply create a view and eliminate the duplicates. You have to do it programatically.

Srinivas

0 Kudos

Hi Srinivas ,

New search help should display following info for both fields.

Sales order Number , SO High level item number,SO high level material,SO Completion date,Warranty date(SO completion date + 12),Po document number,Po line item,Po line item description,Vendor number,Vendor name .

Based on the Sales Order Number i need to get all the information. BOM material is Hilgh level material in Sales Order . Only BOM materials should be displayed . to get the above fields i gave following Joins and Selection Conditions in View.

Table/Join Conditions :

VBAP-VBELN = EBKN-VBELN

VBAP-VBELN = VBAK-VBELN

EBKN-BANFN = EBAN-BANFN

EBAN-EBELN = EKKO-EBELN

JCDS-STAT = TJ02T-ISTAT

LFA1-LIFNR = EKKO-LIFNR

Selection Conditions :

VBAP-UEPOS NE '000010' AND

TJ02T-SPRAS EQ 'E' AND

JCDS-STAT EQ 'I0045' OR

JCDS-STAT EQ 'I0002'

Based on these i'm able to select correct entries . but getting duplicate entries.

Thanks,

anjani.