|Function||Reads values from a database table into an object or folder|
exporting condition = mycondition
changing   folder = mycustomers ).
mycondition type string,
myappend type boolean,
mymaxrows type i,
myorderby type string,
myfolder type any,
myrc type boolean.
condition = mycondition
append = myappend
maxrows = mymaxrows
orderby = myorderby
folder = myfolder ).
The parameter "condition" is the only mandatory parameter. It determines which
rows are read from the database, i.e. it results in the where condition of the
select statement. The format is identical to the format of the where condition
of the ABAP Select statement with the following addition:
All expressions @XXXXX within "condition", where XXXXX is the name of a class attribute, are replaced by the respective current attribute value. Example:
s10databaseselect( |LAND1 = @LAND1 | )
If the LAND1 attribute has the value "CA", LAND1 = 'CA' is used as the where
condition. Please note that the apostrophe characters before and after the
value are automatically added here.
s10databaseselect( |LAND1 = @land1 | )
or, since in the ABAP select statement the column names can also be written in lower case,
s10databaseselect( |land1 = @land1 | )
Depending on whether the "folder" parameter is specified or not,
s10databaseselect( ) works differently. If "folder" is specified, a table must
be passed where each row consists of an object reference to a /s10/any object.
In addition, a reference to a database table must be established in the folder
object class by defining a constant "dbtablename". Example:
s10databaseselect( ) reads all rows of the specified database table that
satisfy the condition "condition", and from these the table columns for which
an attribute of the same name exists in the class of the folder objects.
If maxrows=1 the customer with lowest value for the country key and, within
with lowest customer number would be returned here.
If the "folder" parameter is not specified, s10databaseselect() works very
similar to s10databaseread(), except that with s10databaseselect() we can
specify an explicit where condition for access, while with s10databaseread()
the condition is automatically derived from the key fields of the table.