‎2010 Jan 05 4:56 PM
Hi ,
The below select query retreives only 6 records for a particular plant from MSEG table but we have 14 records in the table for that plant, this query works fine for all the other materials except for one material , can anyone let me know what may be the reason for this.
IF I_TAB[] IS NOT INITIAL.
SELECT MBLNR
BWART
MATNR
WERKS
DMBTR
LBKUM
SALK3
SHKZG
SMBLN FROM MSEG INTO TABLE IT_MSEG
FOR ALL ENTRIES IN
I_TAB WHERE MATNR EQ I_TAB-MATNR AND
WERKS IN S_WERKS.
ENDIF.
Thanks.
‎2010 Jan 05 7:36 PM
Hi select all the key fiedls while using for all entries this will fetch all the records
add MJAHR , ZEILE fields in the select query. please correct the code below
IF I_TAB[] IS NOT INITIAL.
SELECT MBLNR
MJAHR
ZEILE
BWART
MATNR
WERKS
DMBTR
LBKUM
SALK3
SHKZG
SMBLN FROM MSEG INTO TABLE IT_MSEG
FOR ALL ENTRIES IN
I_TAB WHERE MATNR EQ I_TAB-MATNR AND
WERKS IN S_WERKS.
ENDIF.
If you need further info let me know
Regards
Satish Boguda
‎2010 Jan 05 4:59 PM
‎2010 Jan 05 5:00 PM
Since you are using for all entries in itab, this query will give all unique records. Missing records must be duplicates.
regards,
PB
‎2010 Jan 05 6:08 PM
Hi ,
In the Select you are using the For all entries , What it will do . It will look at the I_TAB table entries i.e material number with plant in the selection screen.I is fetching what ever material presented in the I_TAB based on the plant.
Regards,
Bharani.
‎2010 Jan 05 6:58 PM
Bring in all the three key fields (MBLNR, MJAHR, and ZEILE) in SELECT statement and you will get all the records.
‎2010 Jan 05 7:36 PM
Hi select all the key fiedls while using for all entries this will fetch all the records
add MJAHR , ZEILE fields in the select query. please correct the code below
IF I_TAB[] IS NOT INITIAL.
SELECT MBLNR
MJAHR
ZEILE
BWART
MATNR
WERKS
DMBTR
LBKUM
SALK3
SHKZG
SMBLN FROM MSEG INTO TABLE IT_MSEG
FOR ALL ENTRIES IN
I_TAB WHERE MATNR EQ I_TAB-MATNR AND
WERKS IN S_WERKS.
ENDIF.
If you need further info let me know
Regards
Satish Boguda
‎2010 Jan 05 10:05 PM
Hi Mohana,
The 14 records you are expecting from table MSEG, make sure that each of the materials out of these 14 records are present in your i_tab[].
‎2010 Jan 05 11:12 PM
using for all entries you must select all key fields, otherwise duplicates are eliminated. Then use INTO CORRESPONDING FIELDS and you will not need all key fields in the target area. INTO CORRESPONDING FIELDS is always the better alternative because the DB interface makes sure you have no performance loss.
Regards,
Clemens
‎2010 Jan 06 5:04 AM
Hi,
Ur query is for material and plant in where condition. mey the table has 14 records which has same plant and different materials
go to Mseg table and select the data with material and plant n chk the records
Please try this is Debugging mode
Regards
Azeez