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

how many rows

Former Member
0 Likes
729

hi experts

i want to do query on table vbak and what i want to know is only if i get in result more than one row

thanks

Amit

6 REPLIES 6
Read only

Former Member
0 Likes
664

select from vbak and fill the internal table as t_vbak.

DATA: N TYPE I.

DESCRIBE TABLE t_vbak LINES N.

N will get the number of rows selected.

hope this helps

Cheers

Kothand

Read only

Former Member
0 Likes
664

check with sy-dbcnt .. how many rows are selected

Read only

former_member195383
Active Contributor
0 Likes
664

fectch the entries into an internal table and then use..

DESCRIBE TABLE ITAB LINES wf_lines.

WF_LINES WILL CONTAIN THE NUMBER OF ROWS THAT THE TABLE IS HAVING...

WF_LINES IS INTEGER VARIABLE..

Read only

Former Member
0 Likes
664

hi,

Get the data in an internal table say itab_vbak.

now use the Describe statement to chek how many records has been selected.

data : w_lines type i.

Describe table itab_vbak line w_lines.

Hope this helps!!

Regards,

Lalit

Read only

bpawanchand
Active Contributor
0 Likes
664

hi

Well you ccan check a condition by using System field SY-DBCNT because in this field it will have how many database rows are executed succesfully.

If SY-DBCNT >1

ENDIF.

I hope this helps you

Regards

Pavan

Read only

former_member761936
Active Participant
0 Likes
664

Hi Amit,

Your Question is not clear.

Do you want to Nmber of records you got(OR) How to get more than one record.

If you want to know number of records you got you can use

DESCRIBE Statement on Internal table.

(OR)

You wnat to get more than one row , you can select all records into Internal table, Like

Select *

from VBAK

INTO TABLE t_vbak

Here t_vbak is of structure VBAK.