‎2009 Apr 22 3:08 PM
Hi,
This is sales employee performance report.
I need to select all the fields from two tables based on user input ie VKorg, sales employee .
There is one field callled " Net sales"in both the tables.
Based on sales employee number, i need to add that net sales which i get from two tables.
I need to generate single report.
Can you give some inputs reg. the select query.
My idea is select all the data from both tables using join statement.
Thanks
‎2009 Apr 22 3:15 PM
Have different names for that field, Based on employee number of one table read the other table and sum it and populate another table, use this table for ALV display.
‎2009 Apr 22 3:15 PM
hi
can u just provide the table name
i guess VBAK and VBAP
if it is the case
in both table same amount will be there i guess
because one is header and another is item
in case if the table is different
just provide the table
cheers
s.janagar
‎2009 Apr 22 3:16 PM
HI,
This is LIS generated tables (custom defined tables)
like S006/S002
Thanks
‎2009 Apr 22 3:23 PM
Try this:
Select a~net
b~net1
from s006 as a join s007 as b
into table itab
on avkorg = bvkorg
where a~vkorg = inout-vkorg
and (depends)employee = employee.
After this you can collect the net quantity.
‎2009 Apr 22 3:15 PM
Have different names for that field, Based on employee number of one table read the other table and sum it and populate another table, use this table for ALV display.
‎2009 Apr 22 3:22 PM
Hi Vijay Babu Dudla
Both tables..only employee number have different field names.
when ever employee name is same in both field..it has to add netsales.
can you provide some sudo code or some link for that?
Thanks
‎2009 Apr 22 3:24 PM
it is very straight forward, loop one table and read the other table and sum the net value. populate the final table with the total value , other details.
End of your requirement.
‎2009 Apr 22 3:33 PM
Hi,
I have written like this:
select * from S002 as a join S006 as b
into table ME->SS002_RAW[]
where vkorg in me->select_parameters->SO_VKORG[] = vkorg in me->select_parameters->SO_VKORG[]
and ZZSLSEMP01 in me->select_parameters->SO_so_empl[] = ZZSLSEMP02 in me->select_parameters->SO_so_empl[].
when i do like that,
I am getting error
Incorrect structure of FROM clause . . . .
If you give some idea on this
Edited by: Raja on Apr 22, 2009 11:19 AM