Application Development and Automation 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: 
Read only

problem with query SQ01 returning duplicate records

Former Member
0 Likes
5,864

hello abapers

I generated a query with tables CAUFV (which contains custom fields), COVP, CSKU, CAUFVALIAS, AUFM, MAKT.

here below the generated query, which returns duplicate records on some of the records (not all). can someone help?

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,070

Check infoset definition, does the JOIN between tables generate duplicates (as soon as you did not provide the whole primary key) -> if yes you may be required to add some ABP code to infoset to remove duplicate records.

NB: Also some lines may only be false duplicates, there are fields with different values, but you don't display those, so try to pass parameters for those value (e.g. some date, language, etc.) to get only one record.

Regards,
Raymond

hello abapers

I generated a query with tables CAUFV (which contains custom fields), COVP, CSKU, CAUFVALIAS, AUFM, MAKT.

here below the generated query, which returns duplicate records on some of the records (not all). can someone help?

2 REPLIES 2
Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,071

Check infoset definition, does the JOIN between tables generate duplicates (as soon as you did not provide the whole primary key) -> if yes you may be required to add some ABP code to infoset to remove duplicate records.

NB: Also some lines may only be false duplicates, there are fields with different values, but you don't display those, so try to pass parameters for those value (e.g. some date, language, etc.) to get only one record.

Regards,
Raymond

Read only

jogeswararao_kavala
Active Contributor
0 Likes
2,070

Sometimes when it becomes difficult to join 2 tables perfectly then one method to rectify this problem is to identify a field where values are not the same in these repetitive lines. If you find such, for example: you have value E in one line and value B in other of a field say AUFM-SOBKZ, then use the following syntax in the Record Processing section of the Infoset (SQ02 Extras) .

CHECK AUFM-SOBKZ EQ 'E'.


This filters the extra lines. In case you are unable to find such field, then the task becomes difficult. Need for accessing the internal tables of the query by using field symbols. See this discussion .

KJogeswaraRao