10-28-2012 2:23 PM
Hi,
I'm facing a problem when i'm going to create report from selection screen.
purpose of the report is ti show customer information.
so im getting data from
kna1
knb1
knvv
and
knvp(to get the data of sales employee - partner function)
----- particular customer must be available on kna1,knb1 and knvv but he may not available on knvp.-----
In the selection screen below fields are available.
customer number,customer name,sales employee
------
so in my programming logic i have used inner join to join kna1,knb1 and knvv.. Then based on that using for all entries logic im getting sales employee data..
then using read table a append sales employee data to customer..
But my problem is...
if in the selection screen we have mention only one rep(0001) no any other data..
even there is only a one customer for that sales employee..im getting all the customer in to programme run-time memory so how to avoid this?
thank..
10-30-2012 4:35 PM
Hi Pathum,
When you are using the for all entries, You should use the Check statement of for all entries table.
Example : You are using innerjoin the kna1 and knb1 and knvv and assigned in to one table i_kunnr(Example)
then you are doing for all entries of i_kunnr to knvp.
Before doing the for all entries, you would check the i_kunnr is initial or not.
If i_kunnr is not initial.
select * from knvv
into table i_knvv
for all entries in i_kunnr
where kunnr eq i_kunnr-kunnr
if sy-subrc is initial
sort i_knvv by kunnr.
endif.
endif.
If you are not maintain any check which i have mentioned as above bold check statement then total transparent table (knvv) records will fetch in to the application server.
I hope, it is clear to u.
Thanks,
Sekhar