0 pts.
 Show unique values/records from a single table
LS, In the most simple case: I've got a transparent table (ZCUST) containing Handling Unit-barcodenumbers (field: BCODEL) with related deliverynumber (field: VBELN). Since a delivery can contain multiple HU's, the deliverynumber appears the number of times it has HU's. I now would like to see only the number of times a unique deliverynumber is listed. This is realy simple using MS Access or MS Excel but can someone please help me with the correct ABAP statement to do this? Thanks in advance, Eric

Software/Hardware used:
ASKED: May 25, 2005  4:52 AM
UPDATED: June 1, 2005  3:33 AM

Answer Wiki:
I'm not sure I totally understand your question, but to get the number of unique deliveries you would use something like: SELECT COUNT ( DISTINCT vbeln ) FROM ZCUST INTO v_counter to get the number of records with a specified delivery number you could use something like: SELECT COUNT ( DISTINCT BCODEL ) FROM ZCUST INTO v_counter WHERE vbeln EQ p_vbeln Hopefully one of these is what you are looking for. If not they should at least get you pointed in the right direction.
Last Wiki Answer Submitted:  May 31, 2005  1:41 pm  by  ABAP101   0 pts.
All Answer Wiki Contributors:  ABAP101   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

ABAP101, Thank you for your help! You were spot-on with your code.

Kind regards, Eric

 0 pts.