2014 Jul 30 2:29 AM
Hi,
i face a strange situation ,during the process of an report i pass my data from ekpo to mseg as below. it is such a simple statment.
if p_werks is NOT INITIAL .
SELECT EBELN
ebelp
LOEKZ
MATNR
BUKRS
WERKS
MATKL netwr from ekpo INTO TABLE tb_ekpo_po
WHERE matnr = p_matnr and werks = p_werks and loekz ne 'L'.
if tb_ekpo_po is not initial.
SELECT mblnr mjahr bwart matnr werks lgort shkzg dmbtr menge ebeln ebelp from mseg INTO TABLE tb_mseg_po
FOR ALL ENTRIES IN tb_ekpo_po2
WHERE matnr = tb_ekpo_po2-matnr
and bwart = '281'
and werks = p_werks.
endif .
endif.
but the records i am getting in tb_mseg_po debug as not same as in database(mseg table),the internal is not fethching few records .
for ex:i have given same inputs as given in report.
but while in debug of same given inputs in report i get only 44 records, where i might be wrong, i have checked in all aspects , i have no clue.
if i dont use for all entries i am getting all 47 records as per database table ,is the prob with for all entries?
Thanks in advance.
2014 Jul 30 5:20 AM
Hi Prakash,
Include ZEILE in select query for "Mseg" and Check.
Regards,
Venkat.
2014 Jul 30 2:49 AM
Hi Praksah Rao,
try to add key fields in where conditions, if not create secondary Index .
Or
Add Po number and Po Item in mseg Select query and check,
Regards,
Venkat.
2014 Jul 30 3:00 AM
Hi venkataramesh,
MSEG table doesnt consists of ebeln ebelp fields as 281 movment type is of Goods issue , it's not done against purchase order.
2014 Jul 30 2:58 AM
Hi,
i have taken internal table as everytime it's type table of ,tt is not fetching few records which has doc no and amount field common in mseg table.
Thanks in Advance.
2014 Jul 30 3:51 AM
Hi Prakash,
for all entries will delete duplicate lines by comparing the fields which you select.
Please check if it occurs..
Thanks,
Sam
2014 Jul 30 4:00 AM
Hi Prakash,
Do select * instead of,
SELECT mblnr mjahr bwart matnr werks lgort shkzg dmbtr menge ebeln ebelp from mseg INTOTABLE tb_mseg_po.
This should give 47 entries.
Out of these 47, four will be having same mblnr mjahr bwart matnr werks lgort shkzg dmbtr menge ebeln.
so only one entry is being displayed instead of four.
Thanks,
Anil
2024 May 07 3:29 PM
I experienced exactly that! Thanks for pointing this out, I thought i was doing wrong somehow. Cost me about 4 hours analysing/debugging 😞
2014 Jul 30 5:19 AM
Hi,
Pre-requisites for FOR ALL ENTRIES
a) Make sure that the First ITAB is not initial
b)We should specify all the key fields in Second ITAB.
If your are not specifying all the keys in the second ITAB ,the for all enteries will delete all adjacent duplicates.That's why you are not getting all records
Regards
Arun VS
2014 Jul 30 5:20 AM
Hi Prakash,
Include ZEILE in select query for "Mseg" and Check.
Regards,
Venkat.
2014 Jul 30 5:55 AM
Hi Prakash,
I think there is some mistake in writing your query.
In above snippet of code it is clear that you are checking initial condition for table 'tb_ekpo_po'
but you are using 'for all entries' of different table 'tb_ekpo_po2' and trying to fetch data in 'tb_ekpo_po'.
Please correct that and then check.
Thanks,
vidyasagar
2014 Jul 30 6:38 AM
Hi,
Sort your internal table before using for all entries.
Regards,
Ananda Reddy