Skip to Content
0
Former Member
Mar 11, 2009 at 03:37 AM

Select Statment Error (SQL)

22 Views

Dear Friends,

  LOOP AT IT_ZSD012_001 INTO WA_ZSD012_001.
    SELECT  A~MATNR A~LABST A~UMLME A~INSME A~EINME A~SPEME A~RETME B~MTART
      APPENDING TABLE IT_INVENTORY
      FROM  MARD AS A
      INNER JOIN MARA AS B ON B~MATNR EQ A~MATNR
      WHERE A~MATNR = '1.1.1'
      and   A~WERKS EQ  WA_ZSD012_001-PARAM_1
      AND   A~LGORT EQ  WA_ZSD012_001-VALUE
      AND   A~LABST GT 0
      OR    ( A~UMLME GT 0
      OR    A~INSME GT 0
      OR    A~EINME GT 0
      OR    A~SPEME GT 0
      OR    A~RETME GT 0 )
      AND   B~MTART IN ('ZFG1' , 'ZFG4' , 'ZR12' ).
  ENDLOOP.

this is my code (select statement)

but this is not working, when i execute this so many materials came to the itab it should come only "1.1.1"

my requirement is i want to get data from MARD agaist WERKS, LGORT and also MARA-MTART in that groups.

its came with zero inventory, i want to avid them how can i do this.

hope you can understand what i an said?

Thanks in advanced