2008 Jan 17 6:15 PM
Hi All,
We are developing a portal and for one usecase i am using RFC_READ_TABLE for retreiving data from tables, but as each table has different number of records..it would be easier if there is way to give me the COUNT of records in each table.. is there a standard rfc for this purpose? or DI I NEED TO do some changes (CUSTOM WRAPPER)to RFC_READ_TABLE.
the purpose is it will help in PAGING, if i know how many records are there it will be helpful.
thanks in advance
2008 Jan 17 6:20 PM
Hi
Try to use Describe table tablename lines l_lines u get the number of lines..
regards,
chaithanya K
2008 Jan 17 6:20 PM
Hi
Try to use Describe table tablename lines l_lines u get the number of lines..
regards,
chaithanya K
2008 Jan 17 6:23 PM
can u eloborate pls. i am not an Abaper so please bear with me, ideally i am looking for either a FM or an RFC. else if i need to make any changes to any existing FM/RFC please let me know which one and what changes are to be made.
thanks again.
2008 Jan 17 6:32 PM
Hi Hruser...
In the RFC or FM if you have the data in the internal tables
suppose take RFC_READ_TABLE will have the following internal tables it_tab1, it_tab2, it_tab3.
if this internal tables have 10, 20, 30 records.
then u can write the Describe statement
describe table it_tab1 lines l_lines. " the value of l_lines = 10.
Hope you understood,.
Thanks
chaithanya K
2008 Jan 17 9:09 PM
I dunno how far its useful, but with this way you can get the count with out retrieving data into internal table..
>DATA: l_count TYPE i.
>SELECT COUNT(*) AS l_count
> INTO l_count
> FROM mara.
>WRITE l_count.
award points if helpful.
2008 Jan 17 9:16 PM
You can use the Function Module DB6_DIAG_COUNT_TABLE_ENTRIES .
Be aware that DB6_DIAG_COUNT_TABLE_ENTRIES counts the entries in all clients, i.e. it is not a client dependent count. It is a count at the physical data level, and does not take into consideration any client fields.
So you might find it weird in DEV Environment where you will have multiple clients.
But you shud be OK in QAS and PRODUCTION.
Hope this helps.
Vinodh Balakrishnan