‎2014 Jun 18 10:46 AM
Hey Gurus,
I would like to make a select from a multiple tables to check if there is any reference to my data. I would like to do it with some elegancy, but I don't know how.
Is in abap sql possible to do it only with the select statement?
Or I was also think about a solution that I should fill some data structure with all of the tables which I want to select from and then just loop that data structure and do the select seperately from all of the tables. I just need to check if it founds some results, so no need to store it. If this solution would be fine what data structure should I use?
Or can tell me what would be the best for this?
My code for select from one table, which I want to make for multiple tables:
SELECT SINGLE id_kniznice FROM zbr_t_autori INTO wa_id
WHERE id_kniznice EQ ls_extract-zview-id_kniznice.
IF sy-dbcnt > 0.
MESSAGE i000(zbr_msgc_lib).
ls_extract-flags-vim_mark = '*'.
MODIFY extract FROM ls_extract.
ENDIF.
Thank you for any posts.
Regards,
Robert
‎2014 Jun 18 12:36 PM
If you want a dynamic selection, look with F1 at this syntax : SELECT count(*) FROM (dbtab_syntax) WHERE (cond_syntax).
Regards,
Raymond
‎2014 Jun 18 11:02 AM
hi Robert,
Have you tried using FOR ALL ENTRIES. You can fetch the next table records based on success of previous table.
Regards,
DN.
‎2014 Jun 18 11:05 AM
‎2014 Jun 18 12:26 PM
‎2014 Jun 18 12:42 PM
Thank you for the valuable information I did not want to use join 'cause I didn't wanted to write down 10x JOIN in the code. But probably I explained myself wrongly, what I really wanted is what Stefan Seeburger posts. But thank you anyway, It's a useful information for the future.
‎2014 Jun 18 11:36 AM
‎2014 Jun 18 11:59 AM
‎2014 Jun 18 12:36 PM
If you want a dynamic selection, look with F1 at this syntax : SELECT count(*) FROM (dbtab_syntax) WHERE (cond_syntax).
Regards,
Raymond
‎2014 Jun 18 12:43 PM
Thank to you all of you. The solution was that dynamic selection with (dbtab_syntax)