Syntax for Move part two

This topic is in continuation with Syntax for SAP ABAP MOVE part one.

Variant 2

MOVE f+off1(len1) TO g+off2(len2).

Effect

With offset off2 and length len2 , field g receives the contents of field f with offset off1 and length len1 . Therefore, the offset and length specifications can also be variable.

Example

DATA: FIELD1(10) VALUE '1234567890',
OFF1 TYPE I VALUE 1,
LEN1 TYPE I VALUE 2,
FIELD2(8) VALUE 'abcdefgh',
OFF2 TYPE I VALUE 3,
LEN2 TYPE I VALUE 4.
MOVE FIELD1+OFF1(LEN1) TO FIELD2+OFF2(LEN2).

FIELD2 now has the value ' abc23 h '.

Variant 3

MOVE c1 TO c2 PERCENTAGE n.

Additions

1. ... LEFT
2. ... RIGHT

Effect

c1 and c2 must be type C fields; n is a field with a numeric value between 0 and 100. The left part of field c1 ( n percent) is moved to field c2 and is left-justified. c2 is filled with blanks if necessary.

Addition 1

... LEFT

Effect

This is the standard. With this statement, you can make clear that transfer is to be left-justified.

Addition 2

... RIGHT

Effect

Transfer is right-justified, the left part of field c1 as standard.

The runtime required to transfer a C(1) field to a C(1) field is 1 msn (standard microseconds). Conversions should be avoided for performance reasons, i.e. the fields should have the same type and length. For example, a MOVE of a C(10) field to a C(10) field takes about 2 msn, while a MOVE of a C(10) field to a type I field needs about 10 msn.

Recent posts at team blogs are

Syntax for Move
work flow management in sap abap
Switch in C Programming
Heat transfer through radiation (physics)

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

No comments:

Post a Comment