Application Development 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: 

internal table doubt??

Former Member
0 Kudos

Hi all,

How to count the records available for specific select-option in the internal table..

e.g: select ebeln bukrs lfa1 from ekpo into table it1 where ebeln in so_ebeln.

loop at it1.

ekpo-ebeln,

ekpo-bukrs,

ekpo-lfa1,

endloop.

In the o/p i want the data and a variable which holds no. of records present...

1 ACCEPTED SOLUTION

former_member181966
Active Contributor
0 Kudos

<b>SY-DBCNT</b> ( DB operations, number of table lines processed) from db tables after every Iteration and for internal table <b>Sy-tabix</b> ..

OR

You can write

DATA: LN TYPE i.

Describe table itab lines LN..

Hope this’ll give you idea!!

<b>P.S award the points.</b>

Good luck

Thanks

Saquib Khan

"Some are wise and some are otherwise"

6 REPLIES 6

Former Member
0 Kudos

Once you get all the records into an internal table, use the following statement.

DATA: v_record_count TYPE i.

DESCRIBE TABLE itab LINES v_record_count.

former_member181966
Active Contributor
0 Kudos

<b>SY-DBCNT</b> ( DB operations, number of table lines processed) from db tables after every Iteration and for internal table <b>Sy-tabix</b> ..

OR

You can write

DATA: LN TYPE i.

Describe table itab lines LN..

Hope this’ll give you idea!!

<b>P.S award the points.</b>

Good luck

Thanks

Saquib Khan

"Some are wise and some are otherwise"

0 Kudos

Hi all,

Can't we give the variable as character(C) because i want to concatenate after it..

because concatenate won't allow integer(i) variable...u know that..

0 Kudos

yes you can give..no issues...

Cheers,

Abdul

Please close the thread if ur question has been answered..

0 Kudos

Hi

Move it to char variable

DATA DBCNT_C(5) TYPE C.

SELECT * FROM ....

MOVE SY-DBCNT TO DBCNT_C.

Max

Former Member
0 Kudos

Hi

After loading the record in the internal table, you read the variable SY-DBCNT, here you can see the number of records you've loaded.

select ebeln bukrs lfa1 from ekpo into table it1 where ebeln in so_ebeln

n_record = sy-dbcnt.

Max