Skip to Content

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

Select statement

Hi All,

I am reading data from seven tables and here is my select statement but it returns 4 instead. When i take report to QEC it doesn't execute certain material, please help me out.

SELECT maramatnr maraernam maraaenam maramtart maraersda maralaeda

maravpsta marapstat maralvorm marazzltxt marameins maramatkl

marabismt maraextwg maraspart maralabor maramstae maranormt

marawrkst maraekwsl maramprof marastoff marckordb marcwebaz

marckzkri marckautb marcdispr marcdispo marcdismm marcdisls

marcmabst marcminbe marcwerks marcekgrp marcmmsta marcplifz

marcfhori marcsobsl marcmtvfp marcmaabc marcprctr marceprio

marcsernp mardlabst mardlgpbe mardlgort marambrsh mdmaberid

mdmalagpr mdmaplifzx mbewbwtty mbewbklas mbewvprsv mbewverpr

mbewpeinh mbewstprs mbewbwtar maktmaktx s032mbwbest s032wbwbest

FROM mara JOIN mard ON maramatnr = mardmatnr

JOIN marc ON mardmatnr = marcmatnr

JOIN mdma ON maramatnr = mdmamatnr

JOIN mbew ON maramatnr = mbewmatnr

JOIN makt ON maramatnr = maktmatnr

JOIN s032 ON marcwerks = s032werks

INTO CORRESPONDING FIELDS OF TABLE i_tab

WHERE mara~ernam IN s_ernam

AND mara~ersda IN s_ersda

AND mara~aenam IN s_aenam

AND mara~laeda IN s_laeda

AND mara~matnr IN s_matnr

AND marc~werks IN s_werks

AND mard~lgort IN s_lgort

AND mara~mtart IN s_mtart

AND mara~lvorm IN s_lvorm

AND mbew~bklas IN s_bklas

AND mdma~lagpr IN s_lagpr

AND mara~wrkst IN s_wrkst.

SORT i_tab BY matnr.

DELETE ADJACENT DUPLICATES FROM i_tab COMPARING matnr.

Regards,

Fred

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