2023 Oct 30 10:15 AM
Hello,
I was wondering If such case ever happened for others.
So in my Production server, I am using this syntax below, but it cause weird bugs, where there should be 5 lines of data ( where 3 lines have batch A, and 2 lines have batch B ), but somehow, it remove the duplicate row, so my data only consist of 2 row ( 1 line of batch A, 1 line of batch B ), as if there is hidden DISTINCT word.
Based on my debug analysis, all 5 rows are in same TANUM, same NLPLA, and also the VISTM or NISTM has value. When I tried on SE16N, it fetch 5 rows of data correctly.
Might there be some hidden query configuration or report configuration?
DATA : li_group TYPE TABLE OF gt_group.
SELECT a~matnr a~werks a~charg a~meins a~nistm
a~lgnum a~tanum
FROM ltap AS a
INTO CORRESPONDING FIELDS OF TABLE li_group
FOR ALL ENTRIES IN gi_ltak
WHERE a~lgnum = gi_ltak-lgnum AND
a~tanum = gi_ltak-tanum AND
a~nltyp = '200' AND
a~nlpla = p_sammg AND
( ( a~vistm <> 0 ) OR ( a~nistm <> 0 ) ).
But in my newest select query, it show the correct rows too.
SELECT lgnum tanum tapos matnr werks charg meins nistm
FROM ltap
INTO CORRESPONDING FIELDS OF TABLE li_group
FOR ALL ENTRIES IN gi_ltak
WHERE lgnum = gi_ltak-lgnum
AND tanum = gi_ltak-tanum
AND nltyp = '200'
AND nlpla = p_sammg
AND nistm GT 0.
Might it actually caused by the WHERE ( ( vistm <> 0 ) OR ( nistm <> 0 ) ) condition? I felt like the where condition should be true though.
2023 Oct 30 10:30 AM
Basically FOR ALL ENTRIES will remove duplicates entries from the result set.
2023 Oct 30 10:30 AM
Basically FOR ALL ENTRIES will remove duplicates entries from the result set.
2023 Oct 30 11:00 AM
Huh, I never thought it would affect that way, since I don't use the TAPOS field, thats why. thanks anyway.