SAP ABAP Syntax for Parameters part two

SAP ABAP Syntax for parameters is the previous post and this is in continuation with that.

Addition 4

... LIKE g

Effect

Creates the field p with the same attributes as the field g which is already defined. g can be either a database field or an existing internal field.

You cannot use the addition ... LIKE g with the addition ... TYPE typ . No explicit length may be specified for the parameter (for example, a statement such as PARAMETERS p(len) LIKE g is not allowed).

Example

PARAMETERS PROGRAM LIKE SY-REPID.

If g is an ABAP/4 Dictionary field of the type CHAR , length 1 and default values 'X' and ' ' (according to the relevant domain), the parameter is always displayed as a checkbox on the selection screen (see also AS CHECKBOX ).

Field attributes on the selection screen:

The input/output field which appears on the selection screen for the parameter has the attributes of the field g specified after LIKE . These include type, length or - with ABAP/4 Dictionary fields - conversion exit .

If g is an ABAP/4 Dictionary field, the selection screen is automatically regenerated after most field attribute changes. An excception to this rule are the attributes "Check table" and "Fixed values". If these change, you must generate the program in the ABAP/4 Development Workbench. This also generates the selection screen.

The maximum permitted length of a parameter on the selection screen is 45 (scrollable up to length 132). If you have defined it longer than this (either explicitly with p(200) or implicitly with LIKE ), the parameter is truncated on the selection screen after the 132nd character. However, you can use SUBMIT to pass longer parameters to a report (particularly if these are not displayed on the selection screen at all because of the addition NO-DISPLAY ).

Addition 5

... MEMORY ID pid

Effect

On the selection screen, assigns the memory ID pid to the parameter, i.e. when you execute the report, the selection screen displays the last value which the user entered in a field with the memory ID pid .

The memory ID must be a constant, i.e. a value specified without quotation marks, and can be up to 3 characters long.

Addition 6

... MATCHCODE OBJECT mobj

Effect

On the selection screen, assigns the matchcode object mobj to the parameter.

The name of the matchcode object must be a constant, i.e. a value specified without quotation marks, and can be up to 4 characters long.

Addition 7

... MODIF ID key

Effect

The screen fields contain the specified modification group ( SCREEN-GROUP1 ) which you can use for screen modifications (e.g. set to "not ready for input") under AT SELECTION-SCREEN .

The name of the modification group must be a constant, i.e. a value specified without quotation marks, and can be up to 3 characters long.

Example

PARAMETERS CHARLY MODIF ID ABC.
...
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'ABC'.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
...

Effect

The parameter is not ready for input on the selection screen.

ABAP TOPIC WISE COMPLETE COURSE

BDC
OOPS ABAP
ALE
IDOC'S
BADI
BAPI
Syntax Check
Interview Questions
ALV Reports with sample code
ABAP complete course
ABAP Dictionary
SAP Scripts
Script Controls
Smart Forms
Work Flow
Work Flow MM
Work Flow SD
Communication Interface

SAP ABAP Syntax for Paramters

Basic form

PARAMETERS p

Effect

This statement only makes sense in report programs, i.e. in programs defined as type '1' in the attributes. You execute report programs with the SUBMIT statement. When this takes place, the parameters and selection options (SELECT-OPTIONS ) specified in the report program shape the interface which determines what the user sees on the selection screen.

These
parameters and selection options are then presented to the user who can enter values (see the addition NO-DISPLAY or SUBMIT without the addition VIA SELECTION-SCREEN ).

Creates internal fields like the DATA statement. By making the appropriate entry in the attributes, you can assign a report to a logical database ldb . In this case, both the logical database ldb and the report can define parameters (and selection options). You define the database-specific parameters (i.e. those belonging to the logical database) in an ABAP/4 INCLUDE program DBldbSEL (in the logical database maintenance transaction).

Since the system then integrates this
INCLUDE program in the logical database access program SAPDBldb and (partially) in the report, the database-specific parameters (and selection options) are available to both. The ("report-specific") parameters defined in the report are known only in the report (not in the SAPDBldb ). Some additions of PARAMETERS are allowed only in the DBldbSEL .

Example

PARAMETERS: SUM(1).

The name of a parameter can be up to 8 characters long. By selecting Goto -> Text elements and then choosing Selection texts followed by Display , you can enter a description for each parameter; this is then displayed on the selection screen. You define the report-specific parameter texts with the text elements of the report and the database-specific parameter texts with the text elements of the database program SAPDBldb .

Addition 1

... DEFAULT f

Effect

Assigns the default value f to the parameter.

You must specify the default value f in internal format, e.g.

PARAMETERS DATE LIKE SY-DATUM DEFAULT '19931224' ,

not ... DEFAULT '24.12.1993' .

Addition 2

... TYPE typ

Effect

Assigns the type typ to the internal field.

Example

PARAMETERS: NUMBER(4) TYPE P DEFAULT '999'.

Addition 3

... DECIMALS dec

Effect

Assigns dec decimal places to the internal field. dec must be numeric.

You can only use the addition DECIMALS dec with the addition TYPE P , i.e. it is only allowed with parameters of type P .

Example

PARAMETERS: NUMBER (4) TYPE P DECIMALS 2
DEFAULT '123.45'.

ABAP TOPIC WISE COMPLETE COURSE

BDC
OOPS ABAP
ALE
IDOC'S
BADI
BAPI
Syntax Check
Interview Questions
ALV Reports with sample code
ABAP complete course
ABAP Dictionary
SAP Scripts
Script Controls
Smart Forms
Work Flow
Work Flow MM
Work Flow SD
Communication Interface

SAP ABAP Syntax for Overlay

SAP abap programming learning process shall start with syntax check of each key word and here is the effort for that.

Basic form


OVERLAY c1 WITH c2.

Addition

... ONLY c3

Effect

The contents of the field c2 overlay the field c1 in all positions where c1 has the value SPACE ; c2 itself remains unchanged. The return code value is set as follows:

SY-SUBRC = 0 At least one character in c1 is overlaid by a character from c2 .
SY_SUBRC = 4 No character in c1 was overlaid by a character from c2 .

Example

DATA: WORK(20) VALUE 'Th t h s ch ng d.',
HELP(20) VALUE 'Grab a pattern'.
OVERLAY WORK WITH HELP.

WORK now contains ' That has changed. ' and the system field SY-SUBRC is set to 0.

Addition

... ONLY c3

Effect

The contents of the field c2 overlay the field c1 only in those positions where c1 has one of the characters existing as a value in c3 ; the fields c2 and c3 remain unchanged.

Example

Linking field selection templates:

DATA: ONE(16), TWO(16).
ONE = '----****++++....'.
TWO = '-*+.-*+.-*+.-*+.'.
OVERLAY ONE WITH TWO ONLY '.'.
OVERLAY TWO WITH ONE ONLY '.+'.
OVERLAY ONE WITH TWO ONLY '+*'.

Field ONE now contains '-----***-*++-*+.' and field TWO contains '-*---***-*++-*+.' .

Performance

The runtime required for the OVERLAY command in the example of the basic form is about 45 msn (standardized microseconds). To execute the addition ... ONLY c3 , about 40 msn are needed.

ABAP TOPIC WISE COMPLETE COURSE

BDC OOPS ABAP ALE IDOC'S BADI BAPI Syntax Check
Interview Questions ALV Reports with sample code ABAP complete course
ABAP Dictionary SAP Scripts Script Controls Smart Forms
Work Flow Work Flow MM Work Flow SD Communication Interface

OTHER PROGRAMMING COURSES:

Dot Net Complete Course Part one and two ASP.NET part one and two
Programming with C and C Sharp
Interview Questions in dot net and asp.net part one part two
Software Testing Complete course part one and two and Interview Questions

What is Data Structures ?

Team blog recent posts

SAP ABAP EDI Interface testing

ABAP Syntax for Open
Software testing development process over view
Errors and approximations(physics)

Thank you for visiting SAP ABAP REPORTS.If you liked the post, please subscribe to RSS FEED or get the updates directly into your mail box through EMAIL SUBSCRIPTION.You can contact me at d_vsuresh[at the rate of]yahoo[dot]co[dot]in for any specific feed back.