cancel
Showing results for 
Search instead for 
Did you mean: 

inner join with multiple times the same fieldname.

jumpie
Explorer
0 Kudos

hello,

i have a screen in my web dynpro where there are multiple fields that are search parameters. these are not required.

the data that i need to show is from 8 different tables and need to be filtered with the search parameters.

in the list of data that i need are also multiple fields with the same fieldname and from the same table.

the best way to get the data out of the 8 tables is by a inner join, i think?

but how can i do this if i need multiple times the same fieldname and also filter on the searchparameters?

Accepted Solutions (0)

Answers (2)

Answers (2)

amy_king
Active Contributor

Hi Joeri,

You can use field aliases to select database fields having the same name. For example...

SELECT table1~samename as field_1

               table2~samename as field_2

               FROM table1

               JOIN table2 ON table2~key = table1~key

               INTO ...

               WHERE table1~otherfield = p_param1

               AND       table2~thirdfield  = p_param2.

If you use INTO CORRESPONDING FIELDS OF in your INTO clause, the system will expect the target itab or structure to have fields named field_1 and field_2.

Cheers,

Amy

0 Kudos

-> Check with the the what are the fields in Webdynpro View with other tables.U will get results.