Skip to Content
0
Former Member
Dec 10, 2014 at 12:16 AM

Problem with JOIN, repat data

56 Views

Hello,

I have query below:

SELECT a~j_3gblart "Clase documento
          b~j_3gbelnri  "Número de documento PBE
          b~j_3gposnri " Número de posición PBE
          b~j_3guposnr "Subposición
          b~erdat      "Creado el:
          b~ernam      "Creado por
          b~pernr      "Nº personal
          b~j_3gemppsp "Elemento PEP
          b~j_3gemppro "Nº proyecto
          b~j_3gempkos  "Cemtro de coste
          b~j_3gbelsta  "Stat.doc.interno
          b~j_3gbelste  "Stat.doc.externo
          b~j_3gempfae  "Destinatario
          b~j_3glvart     "Clase Actividad
          b~matnr       "Material
          b~j_3gdatlab  "Fe.prest.actividad
          b~j_3gmenge   "Cantidad
          b~j_3gmeins   "Unidad de medida
          c~name1
          c~name2
          d~eqart  " Categoria del Equipo
          d~vbeln  " Documento Venta
          d~posnr  "Posicion
          d~netwr  "Valor Neto
          d~waerk  "Moneda
          e~vbeln AS vbeln2 "vbeln de la VBRP
       FROM j_3gbelk AS a

     INNER JOIN j_3gbelp AS b
     ON a~mandt EQ b~mandt
     AND a~j_3gbelnri  EQ b~j_3gbelnri
     INNER JOIN vbap AS d ON d~j_3gbelnri EQ b~j_3gbelnri
     LEFT JOIN vbrp AS e ON d~vbeln EQ e~aubel
     INNER JOIN kna1 AS c ON c~kunnr = b~j_3gempfae
     INTO CORRESPONDING FIELDS OF TABLE it_alv
     WHERE b~j_3gbelnri IN p_etm
     AND   b~j_3guposnr IS NOT NULL
     AND   j_3gdatlab IN p_factiv
     AND   j_3gblart IN p_cdoc
     AND   b~equnr IN p_equipo
     AND   b~pernr IN p_person
     AND   b~j_3gempfae IN p_desti
     AND   eqart IN p_catequ.

When I run my ALV report with this document: J_3GBELNRI = 2000003987 and I get repeat data:

If I go to the table, I get only 12 rows, this is the correct result, and I want to have this result in my ALV Report, Could anyone can help me?

Attachments

data_repeat.PNG (180.1 kB)
data no repeat.PNG (63.0 kB)