Hi Experts,
Below is the query ... here as per selection criteria there will be 2 rows but the query is selecting 6 rows from table mska.
The reason I think is that i have not put all the primary keys of that table in where condition....is it the case?
I am also giving ss of the table data in image below.
regards,
SELECT
a~werks,
a~lgort,
a~matnr,
a~charg,
* a~ersda,
a~kalab,
a~kains,
a~kaspe,
a~sobkz,
a~vbeln,
a~posnr,
b~maktx,
c~meins,
c~mtart,
c~matkl,
concat( a~matnr, a~charg ) AS merge
FROM mska AS a
INNER JOIN mara AS c ON a~matnr = c~matnr
INNER JOIN makt AS b ON a~matnr = b~matnr
INNER JOIN mch1 as p on a~charg = p~charg
WHERE
( a~lgort = @p_store AND a~werks = @p_plant ) AND
a~matnr IN @s_matnr AND
p~licha IN @v_batch AND
a~charg in @s_batch AND
( a~kalab > 0 OR a~kains > 0 OR a~kaspe > 0 )
INTO TABLE @DATA(it_mska2).