‎2010 Aug 26 5:48 PM
We are using RFC_READ_TABLE to retrieve data. Is there a chance to remotely call something similar for a count?
Sometimes we would need a quick estimation of the result's size before retrieving it. As with count this should be as fast / lightweight as possible.
Any ideas?
Regards TJ
‎2010 Aug 26 5:51 PM
‎2010 Aug 26 5:51 PM
‎2010 Aug 26 5:57 PM
You can use the RFM 'RFC_GET_TABLE_ENTRIES'. You get the number of records via the param: NUMBER_OF_ENTRIES
BR,
Suhas
‎2010 Aug 26 6:37 PM
Thanks for your quick response. As I see it, both approaches
- EM_GET_NUMBER_OF_ENTRIES
- RFC_GET_TABLE_ENTRIES
provide the overall count only, and there is no chance to provide a selection criteria as with RFC_READ_TABLE.
So I cannot use it, since I need to provide a "WHERE CLAUSE". I should have been a more specific on this.
I appreciate your help.
Regards
‎2010 Aug 26 6:56 PM
well in this case is better to make a new FM where you pass parameters for the where clause and you can make a select count to retrieve the number of rows in the selection
‎2010 Aug 26 7:24 PM
Hi ,
You can use this FM TABLE_ENTRIES_GET_VIA_RFC where you can pass the table name and the where clause in SEL_TAB internal table of this FM.
Hope this will help.
Regards,
Debaraj
Edited by: Debaraj Sahoo on Aug 26, 2010 11:55 PM
‎2010 Aug 27 11:48 AM
Thanks again for your support.
At JMG:
Writing own code is not possible in my particular case, since we focus on the remote program and do not want to "touch" the SAP system. Thanks anyway.
At DS:
TABLE_ENTRIES_GET_VIA_RFC seems to be very much the same as RFC_READ_TABLE. However, I still do not get how to call it just to get the count. It returns the full data table, not just the count. So I do have the same overhead as with RFC_READ_TABLE. It takes some time to transfer the data via RFC
Motivation:
I just want to predict how many data I will get for a certain query before I transfer it REMOTELY(!).
‎2010 Aug 27 11:57 AM
After a little search in SE90 I found CATT_GET_TABLE_ENTRIES, maybe this comes close.
Thomas
‎2010 Aug 27 12:02 PM
In the code for CATT_GET_TABLE_ENTRIES, i see:
SELECT COUNT(*) FROM (table) INTO x
WHERE (itab).
IF sy-subrc = 0.
anzahl = sy-dbcnt.
ELSE.
anzahl = 0.
ENDIF.The OP could have created a simple custom RFC utilizing the SELECT statements instead of searching for standard "unreleased" FMs
BR,
Suhas
‎2010 Aug 27 12:15 PM
Well, he doesn't want to touch the system, and c'mon, are you never using unreleased FMs? I'm doing fine since 1993
Thomas
‎2010 Aug 27 12:23 PM
>
> c'mon, are you never using unreleased FMs? I'm doing fine since 1993
ROFL ....
‎2010 Aug 29 4:58 PM
Thanks guys for supporting me:
@TZ; CATT_GET_TABLE_ENTRIES is a prospect, but it is not available in my WebAS 7.0 / nor in my WebAS 7.01. As of [this thread|; it even has a select condition. However, obviously it's beyond the scope of a standard WebAs 7.
@Susha: We simply cannot install something in the backend. The company I am working with is in .net business and does not want to have somebody to install a FM or something similar. I am completely aware this is simple to write, on the other hand I also get their point.
‎2010 Oct 20 7:10 AM
On a slightly different note, do you think a quick Table Analyzer run (Tcode TAANA) would help you? True that you are not using your tool to check the number of entries, but it gets the work done. You'll have to run this in the system from which you are pulling data.
Regards,
Jinesh