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: 

select unique records from the table

Former Member
0 Kudos

Hi,

Again question

In the table BSIS there is in field ZOUNR populated with the same value a few times.

I would like to select unique records. and check them in the another table.

The result of the select centence below is, that I get multiple lines for one record. How to enter the select sentence just for unique records?

SELECT * FROM BSIS INTO LW_BSIS

WHERE ( HKONT IN HKONT ) AND

( AUGBL IN AUGBL ).

IF SY-SUBRC = 0.

MOVE-CORRESPONDING lw_bsis TO INT.

ENDIF.

SELECT * FROM EKPO INTO LW_EKPO

WHERE ( EBELN EQ LW_BSIS-ZUONR+0(10) ) AND

( EBELP EQ LW_BSIS-zuonr+10(5) ).

IF SY-SUBRC = 0.

MOVE-CORRESPONDING LW_EKPO TO INT.

ENDIF.

ENDSELECT.

ENDSELECT.

7 REPLIES 7

former_member189059
Active Contributor
0 Kudos

SELECT <b>DISTINCT</b> * FROM BSIS...

former_member386202
Active Contributor
0 Kudos

Hi,

Use select DISTINCT

Regards,

Prashant

Former Member
0 Kudos

Hi Saso,

Instead of using

SELECT * FROM BSIS INTO LW_BSIS

WHERE ( HKONT IN HKONT ) AND

( AUGBL IN AUGBL ).

SELECT DISTINCT * FROM BSIS INTO LW_BSIS

WHERE ( HKONT IN HKONT ) AND

( AUGBL IN AUGBL ).

If it is helpfull pls reward pts.

Regards

Srimanta

varma_narayana
Active Contributor
0 Kudos

Hi...

SELECT <OTHER FIELDS FROM BSIS> DISTINCT(ZOUNR) FROM BSIS

WHERE <CONDITION>.

<b>reward if Helpful.</b>

Former Member
0 Kudos

I found the solution, your replys desn't work.

This is a solution for this.

SORT INT by ZUONR.

DELETE ADJACENT DUPLICATES from int COMPARING ZUONR.

Former Member
0 Kudos

I found the solution, your replys desn't work.

This is a solution for this.

SORT INT by ZUONR.

DELETE ADJACENT DUPLICATES from int COMPARING ZUONR.

Former Member
0 Kudos

I found the solution, your replys desn't work.

This is a solution for this.

SORT INT by ZUONR.

DELETE ADJACENT DUPLICATES from int COMPARING ZUONR.