‎2008 Jul 28 11:38 AM
hi all,
is the following syntax valid.
select * from dbtab for all entries of it_tab.
im running a batch program. i just want to check if my entries in my internal table are present in my dbtab.
so that i dont insert my dbtab for those corresponding entries
i strictly want to avoid looping on the it_tab.
please correct me if wrong also give alternative if any
‎2008 Jul 28 11:44 AM
hi,
You need to give atleast one selection criteria field. Like this,
SELECT * FROM vbap
INTO CORRESPONDING FIELDS OF TABLE t_vbap
FOR ALL ENTRIES IN t_vbak
WHERE vbeln = t_vbak-vbeln.
‎2008 Jul 28 11:40 AM
hiii
no this is not a valid syntax
select * from dbtab for all entries of it_tab.
you should use it like below
select * from dbtab for all entries IN it_tab where field1 = field1-it_itab.
regards
twinkal
‎2008 Jul 28 11:40 AM
Hi,
You should use a where condition for the select which is common to both database and internal table.
By this query you get the data which are common in internal table and database. the remaining data which are in database will not be selected.
is this what u need?
‎2008 Jul 28 11:46 AM
if by that query i get the entries which are common that means i should not append my itab.(using sy-subrc)
else i should .
but how do i seggregate between the entries which are present in dbtab and the entries which are not.
‎2008 Jul 28 11:48 AM
by this select query you get the entries which are there in the internal table only.
‎2008 Jul 28 11:42 AM
hi,
If i have understood your question correctly do this way ..
if not it_tab[] is initial.
select * from dbtab into table it_data for all entries in it_tab
where field1 = it_tab-field1 and
field2 = it_tab-field2.
endif.
Regards,
Santosh
‎2008 Jul 28 11:44 AM
hi,
You need to give atleast one selection criteria field. Like this,
SELECT * FROM vbap
INTO CORRESPONDING FIELDS OF TABLE t_vbap
FOR ALL ENTRIES IN t_vbak
WHERE vbeln = t_vbak-vbeln.
‎2008 Jul 28 11:52 AM