Skip to Content
0
Jun 05, 2022 at 10:27 AM

Query producing Wrong Output

162 Views

Hi experts,

I have written a query but its not producing right output... to be more precise quantity field condition is not checked.

SELECT

a~werks,
a~lgort,
a~matnr,
a~charg,
a~ersda,
a~clabs,
a~cinsm,
a~cspem,
b~maktx,
c~meins,
concat( a~matnr, a~charg ) AS merge
FROM mchb AS a
INNER JOIN makt AS b
ON a~matnr = b~matnr
INNER JOIN mara AS c
ON a~matnr = c~matnr
WHERE a~lgort = @p_store OR
a~werks = @p_plant AND
a~matnr IN @s_matnr AND
a~charg IN @s_batch AND
( a~clabs > 0 OR a~cinsm > 0 OR a~cspem > 0 )
INTO TABLE @DATA(it_mchb).

My selection screen looks like

SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE txt-001.


PARAMETERS : p_plant TYPE t001w-werks MATCHCODE OBJECT zpl ,
p_store TYPE mchb-lgort OBLIGATORY MATCHCODE OBJECT zsl.


SELECT-OPTIONS : s_matnr FOR mara-matnr ,
s_batch FOR mska-charg MATCHCODE OBJECT zbt.


PARAMETERS : r1 AS CHECKBOX.


SELECTION-SCREEN END OF BLOCK b.