Passing parameters with SUBMIT
1. ... USING SELECTION-SET vari
2. ... WITH p op f SIGN s
3. ... WITH p BETWEEN f1 AND f2 SIGN s
4. ... WITH p NOT BETWEEN f1 AND f2 SIGN s
5. ... WITH p IN sel
6. ... WITH SELECTION-TABLE seltab
7. ... WITH FREE SELECTIONS texpr
Passes values to the
PARAMETERS of the program rep
(these can also be defined in the database program SAPDBldb of
the relevant logical database ldb ).
p is the name of a
selection criterion .
... USING SELECTION-SET vari
The variable vari contains the name of a variant
used to start the report.
... WITH p op f SIGN s
op is one of the operations EQ, NE, CP, NP,
GE, LT, LE, GT . s is a variable which must contain one of the
values 'I' or 'E' (any other values result in a runtime
error). The addition SIGN is optional and the default is
'I' . If p is a selection criterion
(SELECT-OPTIONS ), an entry
with LOW = f , OPTION = op and SIGN = s is
generated in the relevant internal table.
If p is a parameter
(PARAMETERS ), the system treats
all options like EQ , i.e. it always transfers a single value.
The field f is passed to the parameter p or to the field
p-LOW of the selection criterion (xxx in the above list) in
internal format. If p is not the same type as f , a type
conversion is performed in the target report when data is passed.
... WITH p BETWEEN f1 AND f2 SIGN s
Passes the range with the lower limit f1 and the
upper limit f2 to the selection criterion p . As with
variant 2, f1 and f2 are passed in internal format and
the handling of SIGN is also the same. The system thus generates
an entry with LOW = f1 , HIGH = f2 , OPTION = BT and
SIGN = s . When data is passed, a type conversion is performed.
... WITH p NOT BETWEEN f1 AND f2 SIGN s
Similar to 3, except that OPTION NB is generated
instead of OPTION BT .
... WITH p IN sel
p is a selection criterion and sel is an
internal table which is compatible with p and contains the
transfer values. You are recommended to define sel with
RANGES . The lines of sel must
have exactly the same structure as the lines of a sdlection table (see
... WITH SELECTION-TABLE seltab
seltab is an internal table with the structure
This variant allows you to set the names and contents of the parameters
and selection options dynamically at runtime.
You can use the function module RS_REFRESH_FROM_SELECTOPTIONS to
read the contents of the parameters and selection options of the
current program into an internal table seltab with the structure
RSPARAMS . By using SUBMIT ... WITH SELECTION-TABLE
seltab , you can then pass these values on directly.
... WITH FREE SELECTIONS texpr
Passes dynamic selections.
texpr is an internal table of the type RSDS_TEXPR (see
type pool RSDS).
You can, for example, fill the object texpr in one
of the following ways:
While processing a report with dynamic selections, call the function
module RS_REFRESH_FROM_DYNAMICAL_SEL . This returns an object of
the type RSDS_TRANGE which a subsequent function module
FREE_SELECTIONS_RANGE_2_EX then converts to an object of the
type RSDS_TEXPR . In this way, you can pass on the dynamic
selections of the current report with SUBMIT .
Call the function modules FREE_SELECTIONS_INIT and
FREE_SELECTIONS_DIALOG in order to offer the user a dialog for
entering dynamic selections. These function modules return an object of
the type RSDS_TEXPR .
You can combine the variants 1-7 in any permutation. The
same selection criterion may be addressed several times with
WITH . This generates several lines in the internal table
assigned to the selection criterion
p . You can also combine parameter transfer
using a variant with explicit parameter passing via the WITH
clause. In the event of a conflict, the parameter passed explicitly
overwrites the corresponding parameter or selection criterion from the
variant. Addition 6 ( WITH SELECTION-TABLE ) can be combined with
parameter transfer using a variant (like directly written WITH
clauses), but not with direct WITH clauses.
The values passed during SUBMIT are not taken over until the
event INITIALIZATION has been
processed, i.e. default values set at
INITIALIZATION are overwritten
if values are passed for the
1st combination - variant and WITH
RANGES RANGE_LANGU FOR SY-LANGU.
PARAMETERS: MSG_FR LIKE T100-MSGNR,
MSG_TO LIKE T100-MSGNR.
MOVE: 'I' TO RANGE_LANGU-SIGN,
'BT' TO RANGE_LANGU-OPTION,
'D' TO RANGE_LANGU-LOW,
'I' TO RANGE_LANGU-HIGH.
MOVE: 'EQ' TO RANGE_LANGU-OPTION,
'E' TO RANGE_LANGU-LOW.
USING SELECTION-SET 'VARIANT1'
WITH MSG BETWEEN MSG_FR AND MSG_TO
WITH LANGU IN RANGE_LANGU.
2nd combination - variant and WITH
DATA: BEGIN OF SELTAB OCCURS 5.
INCLUDE STRUCTURE RSPARAMS.
DATA: END OF SELTAB.
MOVE: 'LANGU' TO SELTAB-SELNAME,
'S' TO SELTAB-KIND, " SELECT-OPTION
'I' TO SELTAB-SIGN,
'BT' TO SELTAB-OPTION,
'D' TO SELTAB-LOW,
'I' TO SELTAB-HIGH.
MOVE: 'E' TO SELTAB-SIGN,
'EQ' TO SELTAB-OPTION,
'F' TO SELTAB-LOW,
SPACE TO SELTAB-HIGH.
MOVE: 'ARBGB' TO SELTAB-SELNAME,
'P' TO SELTAB-KIND, " PARAMETER
'XX' TO SELTAB-LOW.
USING SELECTION-SET 'VARIANT1'
WITH SELECTION-TABLE SELTAB
© SAP AG 1996