Page 1 of 1

0025 - Default Parameters

Posted: Sat Mar 28, 2009 8:37 am
by Rich
Default Parameters.

The Parameter command can be provided with a 'Default' value which the user would generally have to enter such as:

Code: Select all

Parameters: p_myPar type myType default 'A'.
This also works well when using constants and variables:

Code: Select all

Constants: c_myConst type myType value 'B'.
Data:      g_myVar   type myType value 'C'.

Parameters: p_myPar  type myType default c_myConst,
            p_myPar1 type myType default g_myVar.
But do this:

Code: Select all

Data:      g_myVar   type myType.

Initialization.
   Move 'C' to g_myVar.

Parameters: p_myPar1 type myType default g_myVar.
And it doesn't !

What you have to do is to move the value directly to the input parameter:

Code: Select all

Initialization.
   Move 'C' to p_myPar1.

Parameters: p_myPar1 type myType.