Ansicht
Dokumentation
ABENABAP_SQL_PARAMETERS - ABAP SQL PARAMETERS
Addresses (Business Address Services) RFUMSV00 - Advance Return for Tax on Sales/PurchasesThis documentation is copyright by SAP AG.
- SQL Parameter Passing sql_para
... ( pname1 = act1, pname2 = act2, ... ) ...
Effect
Specifies actual parameters act1, act2, ... for input parameters pname1, pname2, ... of a CDS entity in a parenthesized comma-separated list. Parameters can be passed to non-abstract CDS entities in the following positions in statements:
- After a CDS entity as the data source of the FROM clause of a query.
- After the CDS associations of a path expression in the data source of the FROM clause and in the specified columns of a query.
If a CDS entity has input parameters as the data source data_source of a query or target of a CDS association specified in a path expression, a matching actual parameter must be passed to each input parameter as follows:
- If an input parameter does not have an annotation @Environment.systemField, an explicit actual parameter must be specified.
- If an input parameter has an annotation @Environment.systemField with one of the predefined values #SYSTEM_..., an explicit actual parameter does not need to be specified. If no actual parameter is specified, passes the nominal value of the system field assigned using the annotation implicitly. Here, only the date and time are taken from the system fields sy-datum and sy-uzeit and the language and user name are taken from secure sources.
- If an input parameter has an annotation @Environment.systemField with the predefined value #CLIENT, an explicit actual parameter must not be specified. Instead, passes the ID of the current client or a client specified using USING CLIENT implicitly.
Literals, host variables, or host expressions can be specified as actual parameters. The name of a host variable must be prefixed with the escape character @. The data type of the parameter must be convertible to the built-in data type in the ABAP Dictionary. The built-in data type is specified by the typing of the parameter. The content of the actual parameter must match the data type of the input parameter in accordance with the rules for a lossless assignment. Only typed literals are passed directly without conversion.
In the following cases, the parentheses ( ) after the name of a CDS entity can be empty or omitted:
- The function is a CDS table function without input parameters.
- The view is a CDS view with input parameters that are all filled implicitly using the annotation @Environment.systemField.
Parentheses cannot be specified in CDS views without input parameters or in any dictionary objects.
Notes
- There are currently no optional input parameters for CDS entities and no real replacement values for input parameters. The annotation @Environment.systemField bypasses this gap for some environment values by providing the caller with the non-optional parameters implicitly.
- Currently, a path expression in a specified column in a query cannot contain any CDS associations for entities with input parameters.
- When parameters are passed to an entity with parameters, the syntax check is performed in strict mode from 7.40 SP08. If a host expression is specified as an actual parameter, the syntax check is performed in strict mode from Release . If a path expression is also used, or a parameter is passed in a path expression, the syntax check is performed in strict mode from Release .
Example
Passing of a time zone to the input parameter tz of the CDS view demo_cds_assoc_sairport_tz.
SELECT, CDS View with Input Parameters
RFUMSV00 - Advance Return for Tax on Sales/Purchases BAL_S_LOG - Application Log: Log header data
This documentation is copyright by SAP AG.
Length: 7397 Date: 20240424 Time: 070518 sap01-206 ( 89 ms )