This website is not affiliated with, sponsored by, or approved by SAP AG.

0025 - Default Parameters

Moderators: Snowy, thx4allthefish, Rich, ilya

0025 - Default Parameters

Postby Rich » Sat Mar 28, 2009 8:37 am

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.
Regards

Rich

Image
Abap KC:http://www.richard-harper.me.uk/Kb
SFMDR:http://www.se37.com
Rich
 
Posts: 7112
Joined: Thu Oct 31, 2002 4:47 pm
Location: Liverpool

Return to ABAPers

Who is online

Users browsing this forum: No registered users and 1 guest





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.