Google Search - Blog...........

SAP ABAP - Replace Command - Introduction, Syntax & Example.

You use the REPLACE statement.

Syntax:


REPLACEWITHINTO[LENGTH<1>].


ABAP/4 searches the field for the first occurrence of the first,1 positions of the pattern . If no length is specified, it searches for the pattern in its full length.

Then, the statement replaces the first occurrence of the pattern in field with the string . If a length was specified, only the relevant part of the pattern is replaced.

REPLACE STR1 WITH STR2 INTO STRING.
Here whole string is searched for string1 and is replaces with str2.


REPLACE ‘&’ WITH ‘M’
Here the system searches string for & and replaces it with ‘M’.


No comments:

Post a Comment