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.

No comments:

Post a Comment