Purpose Read an SAP table via "rfc_read_table" SAP provides the standard function module "rfc_read_table" as a general interface for database access via RFC. This function is less powerful and flexible than "/guixt/dbselect": it does not support table joins, ordering of the result table, input/output format conversions, or CDS views. But in a situation where /guixt/dbselect cannot be installed in a SAP system the use of "rfc_read_table" might be helpful. |
Solution
Example
GuiXT Script // Tab "Logon Data" ? if Q[Page=Logon Data] // read last logon data via RFC // Field list for rfc_read_table Set V[fieldname] "TRDAT" CopyText fromString="fieldname" toText="fields" Set V[fieldname] "LTIME" CopyText fromString="fieldname" toText="fields" -appendLine // condition, take user name from screen Set text[options] "BNAME = '&F[SUID_ST_BNAME-BNAME]'" // Read table USR02 clear text[data] call "RFC_READ_TABLE" _ in.QUERY_TABLE="USR02" _ table.OPTIONS="options" _ table.FIELDS="fields" _ table.DATA="data" // result into GuiXT variable, format is YYMMDDDDHHMMSS Set V[data] "&text[data]"
// format
date and time Box (22,1) (25,79) "Last logon" InputField (23,2) "Date" (23,20) size=10 name="logondate" -readOnly InputField (24,2) "Time" (24,20) size=5 name="logontime" -readOnly endif |
Components |