Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Errors and corrective action

Former Member
0 Likes
332

hi all,

I am working in a upgrade project.

Can anybody help me in getting the possible errors and corrective action against these keywords.

Or atleast a way to find. (some documentation )

ASSIGN

REPLACE

DESCRIBE

CONDENSE

<b>Points will be rewarded.</b>

1 REPLY 1
Read only

Former Member
0 Likes
312

hi

good

replace->

To replace a string in a field with a different string, use the REPLACE statement.

REPLACE str1 WITH str2 INTO c [LENGTH len].

REPLACE sub_string WITH new INTO dobj

[IN {BYTE|CHARACTER} MODE]

[LENGTH len].

The statement searches the field c for the first occurrence of the first len positions of the pattern str1. If no length is specified, it searches for the pattern str1 in its full length.

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

If the return code value of the system field sy-subrc is set to 0, this indicates that str1 was found in c and replaced by str2. Another return value shows that nothing was replaced. str1, str2, and len can be variables.

DESCRIBE->

You may sometimes need to find out the attributes of a data object at runtime that were not statically available. For example, you may need to find out the type of a generic interface parameter in a subroutine. To do this, you would use the statement:

DESCRIBE FIELD <f> [LENGTH <l>] [TYPE <t> [COMPONENTS <n>]]

[OUTPUT-LENGTH <o>] [DECIMALS <d>]

[EDIT MASK <m>] [HELP-ID <h>].

The attributes of the data object <f> specified by the parameters of the statement are written to the variables following the parameters. You can use any number of the additions in the same statement.

DESCRIBE FIELD DISTANCE BETWEEN <f1> AND <f 2> INTO <d>.

This statement returns the distance between the data objects <f1> and <f 2>.

The next sections describe the additions in detail:

CONDENSE->

The CONDENSE statement deletes redundant spaces from a string:

CONDENSE c [NO-GAPS].

This statement removes any leading blanks in the field c and replaces other sequences of blanks by exactly one blank. The result is a left-justified sequence of words, each separated by one blank. If the addition NO-GAPS is specified, all blanks are removed.

DATA: string(25) TYPE c VALUE ' one two three four',

len TYPE I.

len = strlen( string ).

WRITE: string, '!'.

WRITE: / 'Length: ', len.

CONDENSE string.

len = strlen( string ).

WRITE: string, '!'.

WRITE: / 'Length: ', len.

CONDENSE string NO-GAPS.

len = strlen( string ).

WRITE: string, '!'.

WRITE: / 'Length: ', len.

reward point if helpful.

thanks

mrutyun^