Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

problem with select

Hi,

It should return me just one record but it generally returns four records:

What could be the reason?

SELECT CKMLHD~BWKEY CKMLHD~KALNR CKMLHD~MATNR CKMLPP~BDATJ CKMLPP~KALNR
       CKMLPP~LBKUM CKMLPP~MEINS CKMLPP~POPER MARC~MATNR MARC~PRCTR
       MARC~WERKS MBEW~BKLAS MBEW~KALN1 CKMLCR~BDATJ CKMLCR~CURTP
       CKMLCR~KALNR CKMLCR~POPER CKMLCR~SALK3 CKMLCR~WAERS
INTO (CKMLHD-BWKEY , CKMLHD-KALNR , CKMLHD-MATNR , CKMLPP-BDATJ
     , CKMLPP-KALNR , CKMLPP-LBKUM , CKMLPP-MEINS , CKMLPP-POPER
     , MARC-MATNR , MARC-PRCTR , MARC-WERKS , MBEW-BKLAS , MBEW-KALN1
     , CKMLCR-BDATJ , CKMLCR-CURTP , CKMLCR-KALNR , CKMLCR-POPER
     , CKMLCR-SALK3 , CKMLCR-WAERS )
FROM  CKMLHD
       INNER JOIN CKMLPP
       ON CKMLPP~KALNR = CKMLHD~KALNR
       INNER JOIN MARC
       ON MARC~WERKS = CKMLHD~BWKEY
       AND MARC~MATNR = CKMLHD~MATNR
       INNER JOIN MBEW
       ON MBEW~KALN1 = CKMLPP~KALNR 
       INNER JOIN CKMLCR
       ON CKMLCR~BDATJ = CKMLPP~BDATJ
       AND CKMLCR~POPER = CKMLPP~POPER
       AND CKMLCR~KALNR = MBEW~KALN1 
       WHERE CKMLHD~BWKEY IN SP$00002
         AND CKMLHD~MATNR IN SP$00001
         AND CKMLPP~BDATJ IN SP$00003
         AND CKMLPP~LBKUM IN SP$00006
         AND CKMLPP~POPER IN SP$00004
         AND MARC~PRCTR IN SP$00007
         AND MBEW~BKLAS IN SP$00008
         AND CKMLCR~CURTP IN SP$00005.

Thanks.

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question