Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Issue in for all entries

former_member477101
Participant
0 Kudos

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.

1 ACCEPTED SOLUTION

VenkatRamesh_V
Active Contributor
0 Kudos

Hi Prakash,

Include ZEILE in select query for "Mseg" and Check.

Regards,

Venkat.

9 REPLIES 9

VenkatRamesh_V
Active Contributor
0 Kudos

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.

0 Kudos

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.

former_member477101
Participant
0 Kudos

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.

Former Member
0 Kudos

Hi Prakash,

for all entries will delete duplicate lines by comparing the fields which you select.

Please check if it occurs..

Thanks,

Sam

former_member202771
Contributor
0 Kudos

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

venuarun
Active Participant
0 Kudos

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

VenkatRamesh_V
Active Contributor
0 Kudos

Hi Prakash,

Include ZEILE in select query for "Mseg" and Check.

Regards,

Venkat.

former_member212124
Active Participant
0 Kudos

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

Former Member
0 Kudos

Hi,

Sort your internal table before using for all entries.

Regards,

Ananda Reddy