Application Development and Automation 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: 
Read only

ALV OOps report- getting data from two tables and adding issue

Former Member
0 Likes
1,253

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
957

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.

7 REPLIES 7
Read only

Former Member
0 Likes
957

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

Read only

0 Likes
957

HI,

This is LIS generated tables (custom defined tables)

like S006/S002

Thanks

Read only

0 Likes
957

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.

Read only

Former Member
0 Likes
958

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.

Read only

0 Likes
957

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

Read only

0 Likes
957

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.

Read only

0 Likes
957

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