Hi Experts,
Here I am attaching the ss of selection screen... Now if I don,t give value in material type and material group ..Then it need not to be filtered but if entered value then it should be filtered.
But My query is working when I am giving a specific material type in selection screen... when i only give plant and storage location only two mandatory fields ... the query should take all material type and material group.
how can i do that?
I am also giving the query....
SELECT
a~werks,
a~lgort,
a~matnr,
a~charg,
* a~ersda,
a~clabs,
a~cinsm,
a~cspem,
b~maktx,
c~meins,
c~mtart,
c~matkl,
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
( lgort = @p_store AND 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 ) AND
c~mtart = @mattype AND
c~matkl IN @matgrp
INTO TABLE @DATA(it_mchb5).
