Open aspiringguru opened 6 years ago
Hi -
It is really down to the description of the interface for the RFC function, but for RFC_READ_TABLE (best to have a look in transaction SE37) you should find that there is a parameter 'ROWCOUNT' that should enable you to limit the number of records returned. Cheers, Piers.
Where do I look for this? " description of the interface for the RFC function, but for RFC_READ_TABLE (best to have a look in transaction SE37) "
Found this method to limit rows. https://github.com/piersharding/RSAP/blob/master/man/RSAP-package.Rd
con <- RSAPConnect("my-config-file.yml") parms <- list('BYPASS_BUFFER' = 'X', 'MAX_ENTRIES' = 50, 'TABLE_NAME' = 'some-table-name')
res <- RSAPInvoke(con, "RFC_GET_TABLE_ENTRIES", parms) print(res$ENTRIES)
This retrieved 50 rows of data as a dataframe w 50 rows 1 column. not a great format to work with, but shows it is possible to retrieve a controlled number of rows from this table.
oddly: after resetting the session, now the above crashes out on memory error. Error: Problem Invoking RFC (RFC_GET_TABLE_ENTRIES): 3 / TSV_TNEW_PAGE_ALLOC_FAILED / No more memory available to add rows to an internal table. also seeing errors for field BYPASS_BUFFER' not found field 'MAX_ENTRIES' not found.
seems the first arg assigned to parms is now ignored. weird that it worked first time I used it. parms <- list('BYPASS_BUFFER' = 'X', 'MAX_ENTRIES' = 50, 'TABLE_NAME' = 'some-table-name')
tried closing r studio and re-running the above code. cannot replicate the time it worked and retrieved data. can only replicate errors now.
also tried this example for RSAPReadTable. https://github.com/piersharding/RSAP/blob/master/man/RSAPReadTable.Rd
When I try using nrows=100 as an argument in RSAPReadTable I get error "unused argument (nrows=100)"
RSAPReadTable(conn, "some-table-name", nrows=100)
Suspect something needs resetting on my server. As mentioned above, closed my Rstudio session and ran the code again, can only replicate errors.
I don't like appearing to be the lazy guy asking silly questions. But here I am. I did have fun exploring the tests, fast tracking that exploration is why I'm here again.
Was hoping to find how to limit rows selected in the tests. Experiencing a 'no more memory' error.
acp <- RSAPConnect("some_config_details.yml") df<- RSAPReadTable(acp, "some_table", fields = list("col1", "col2", "col3"))
Error: Problem Invoking RFC (RFC_READ_TABLE): 3 / TSV_TNEW_PAGE_ALLOC_FAILED / No more memory available to add rows to an internal table.
does the error message mean too many rows selected?
I can use options to filter some columns by value to limit the number of rows in some tables, limiting rows selected to enable data exploration will help a lot. filtering without a data sample is hard.
[exploring the tests left me realising I am flying blind here. Much as I dislike spoon feeding, I'm lost without a map. I know this is SAP, which is an infinite universe. I need a small sandpit. :) ]