SAP ST TT PARAMETER



Get Example source ABAP code based on a different SAP table
  


• parameter ABAP_ST_ELEMENT

ABAP_ST - tt:parameter, Parameters

ABAP_SYNTAX
< tt:parameter name='...' $[ref-type='...'$]
$[kind='...'$]
$[$[s-val='...'$]$[d-val='...'$]$]$|$[val=' ...'$] />

What does it do?
The statement tt:parameter can be used to declare one or more parameters in an ST program outside of a template. The attribute name is used to define a symbolic name that can be used to access the parameter. This name can have a maximum of 30 characters.
The symbolic name is not case-sensitive and must be unique. The namespace also includes the data roots declared with tt:root and the variables declared with tt:variable.
The parameters can be addressed directly in the context of the main template. In subtemplates, the parameters of the main template are not known.
Parameters are special variables and can be used as such. Parameters are also applied as formal parameters of an ST program (or a subtemplate):
In tt:call (or tt:apply), a current value can be assigned to a parameter with tt:with-parameter.
The addition PARAMETERS of the ABAP statement CALL TRANSFORMATION can be used to assign an ABAP data object to a parameter as an actual parameter.
ref-type can be used to define the formal parameter as a reference variable. The value of ref-type determines the static type of the reference variable. All global ABAP classes and interfaces for an object reference variable are possible, as are data types for a data reference variable. The names of classes and interfaces are specified directly and without namespaces. The names of data types must be specified using an XML namespace that determines the context of the data type, as with tt:type. Class reference variables and interface reference variables are intended primarily for creating objects and calling instance methods. Data reference variables, however, are used for binding appropriately typed interface parameters when ABAP methods are called.
kind can be used to specify the category of formal parameter. Possible values for kind are:
in input parameter - In the call, an input parameter uses the value of the assigned actual parameter. In the return, the actual parame ter does not use the current value of the formal parameter.
out output parameter - In the call, an output parameter does not use the values of the assigned actual parameter. In the return, the actual parameter uses the current value of the formal parameter.
in/out #input/output parameter - In the call, an input/output parameter uses the value of the assigned actual parameter and, in the return, the actual parameter uses the current value of the formal parameter.
If kind is not specified, the formal parameter is by default an input parameter.
The additions s-val and d-val or val can be used to assign a replacement value to each the input parameters, where the values are specified as ABAP values. If no actual parameter is assigned to an input parameter, it is set to the replacement value. s-val only takes effect in serializations, d-val only takes effect in deserializations, and val takes effect in both serializations and deserializations. Replacement values cannot be assigned to output parameters and input/output parameters.

ABAP_EXAMPLE_VX5
This example demonstrates how parameters are passed to a called transformation. The same example is used for subtemplates in the sta tement tt:apply.
The transformation DEMO_ST_PARAMETER1 below has three parameters PARA1, PARA2 , and PARA3.
TRNS DEMO_ST_PARAMETER1
It can be called from the transformation DEMO_ST_PARAMETER2 below:
TRNS DEMO_ST_PARAMETER2
The result of the calling transformation is: < X1>1 < /X1>
< X2>3 < /X2>
< X3>1 < /X3>
The input parameter PARA1 is changed in the called transformation, but the changed value is not returned to the actual parameter VARI1.
The output parameter PARA2 is set to the value of actual parameter VARI3, which is passed to the called transaction, and this value is returned to the actual parameter VARI2.
The input/output parameter PARA3 is set to the value of actual parameter VARI1, which is passed to the called transaction, and this value is returned to the actual parameter VARI3.
ABAP_EXAMPLE_END