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

newuser plz help

Former Member
0 Likes
838

Hi guys,

anybody suggest me a better & effective way of checking a database table whether data exist in it or not?

ur help appericiated...

raja

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
821

In a program you can do something like

SELECT COUNT( * ) INTO v_count FROM dbatab.

In SE16, simply press the button 'Number Of Entries'.

Srinivas

Hi guys,

anybody suggest me a better & effective way of checking a database table whether data exist in it or not?

ur help appericiated...

raja

8 REPLIES 8
Read only

Former Member
0 Likes
821

Use transaction SE16.

Read only

athavanraja
Active Contributor
0 Likes
821

thru program? what is the method you are currently using?

Regards

Raja

Read only

Former Member
0 Likes
822

In a program you can do something like

SELECT COUNT( * ) INTO v_count FROM dbatab.

In SE16, simply press the button 'Number Of Entries'.

Srinivas

Read only

0 Likes
821

Looks like you have another post with the same question and marked it as answered. Can you please close this one too?

Srinivas

Read only

Former Member
0 Likes
821

hi,

try with this

data : l_matnr like matnr.

select single matnr into l_matnr from mara.

if sy-subrc is initial

records exist

endif.

Read only

0 Likes
821

If these answers helped you, could you please reward and close the post?

Read only

0 Likes
821

Hi Raja,

So many people took their time and effort to understand your problem and try to give a solution. Don't you think, you should do more than just giving two points and closing the thread?

Regards

Raja

Read only

0 Likes
821

I would do.

data : l_mandt type mandt.

select single mandt

from db_tab

where db_field = user_val.

if sy-subrc eq 0.

"record has been found

else.

" record does not exists

endif.