‎2010 Sep 16 3:51 PM
Dear all,
I am using product hierarchy filed in my selection screen.
i.e; S_PRODH FOR LIPS-PRODH obligatory,
here i am facing one problem, whenever user enter the value in S_PRODH-low. (LIPS have two values for this same value).
But in select quiery it is fetching data only one record.
my select quires is
SELECT VBELN
MATNR
MATKL
PRODH
LFIMG
ARKTX
VTWEG
MVGR5
SERAIL
FROM LIPS
INTO TABLE IT_LIPS
FOR ALL ENTRIES IN IT_LIKP
WHERE VBELN = IT_LIKP-VBELN
AND MATKL IN S_MATKL
AND PRODH IN S_PRODH "
AND MATNR IN S_MATNR
AND VTWEG IN S_VTWEG
AND MVGR5 IN S_MVGR5
AND SERAIL EQ P_SERAIL.
plz help me..
Regards
margani
‎2010 Sep 16 3:58 PM
Pretty basic. When using FOR ALL ENTRIES, if the combination of the fields used in the select query is duplicated, only one record is fetched. Make sure you make the combination of fields unique to fetch all records. In your case add POSNR in the select query.
PS: Please use a meaningful subject line in future.
Vikranth
‎2010 Sep 16 3:58 PM
Pretty basic. When using FOR ALL ENTRIES, if the combination of the fields used in the select query is duplicated, only one record is fetched. Make sure you make the combination of fields unique to fetch all records. In your case add POSNR in the select query.
PS: Please use a meaningful subject line in future.
Vikranth
‎2010 Sep 16 3:59 PM
‎2010 Sep 16 4:14 PM
Hello,
The 'For all entries' type of search in the query work like select singe in the data base level search. Because of the very same reason, you may have to use all primary keys as part of the search in order to retrieve records accurately.
In your case, it's VBELN & POSNR. I've seen this very problem in the past and this is the only solution, if you would like to use 'For all entries' type search.
Hope this helps <removed by moderator>.
Best Regards,
Gopakumar
Sr.SAP Tech.Lead
Edited by: Thomas Zloch on Sep 16, 2010 5:32 PM - please do not ask for ...