08-24-2017 1:17 PM
Hi,
I have a problem in a query with the statment FOR ALL ENTRIES.
The internal table PT_POSITIONS has some entries which were sorted by MATNR previously. The problem is that I don't get the same entries using for all entries than using a range with the MATNRs that I have in the internal table, so the problem is with the FOR ALL ENTRIES statment.
Any idea?
Thanks for your time!
08-24-2017 1:29 PM
Well For All Entries will drop duplicate rows before returning results. For more help you will have to share what you have in PT_POSITIONS and the range table.
08-24-2017 1:29 PM
Well For All Entries will drop duplicate rows before returning results. For more help you will have to share what you have in PT_POSITIONS and the range table.
08-24-2017 4:00 PM
Hello,
As Che suggest, try something like this :
TYPES : BEGIN OF tt_matnr,
matnr TYPE PT_POSITIONS-MATNR,
END OF tt_matnr.
DATA t_matnr TYPE HASHED TABLE OF tt_matnr WITH UNIQUE DEFAULT KEY. " Unique key will do the trick
DATA wl_matnr LIKE LINE OF t_matnr.
FIELD-SYMBOLS <positions> LIKE LINE OF pt_positions.
CLEAR t_matnr.
LOOP AT pt_positions ASSIGNING <positions> .
wl_matnr-matnr = <positions>-matnr.
INSERT wl_matnr INTO TABLE t_matnr.
ENDLOOP.
CHECK t_matnr is not initial.
SELECT [...] FOR ALL ENTRIES IN t_matnr
WHERE matnr = t_matnr-matnr
[...].
Best regards
Bertrand