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

What does this code do?

Former Member
0 Likes
867

Hi Experts,

What does this code do?

Num = 81977990.

Translate num(5) using u2018 0u2019.

Thanks,

Girish

In the future, please just try it out.

Edited by: Rob Burbank on Feb 18, 2009 9:33 AM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
805

Hi,

There will be no change in num value.

7 REPLIES 7
Read only

Former Member
0 Likes
805

I don't think there will be any change ..

Read only

0 Likes
805

Hi Srini,

can u please explain me what is happening in the 2nd line-Translate

Read only

Former Member
0 Likes
805

Hi Girish,

The code that you have specified here does not do anything.

But basically Translate statement is used to specify a PATTERN and using that you can change the input.

Just Press F1 on TRANSLATE key word. You wil know the exact use for that.

E.G.


DATA text TYPE string. 
text = `Barbcbdbarb`. 
TRANSLATE text USING 'ABBAabba'. 

Best Regards,

Ram.

Edited by: ram Kumar on Feb 18, 2009 6:43 PM

Read only

former_member156446
Active Contributor
0 Likes
805

These variants of the TRANSLATE statement are not allowed in Unicode programs. Their functions are replaced with methods of the following conversion classes:

CL_ABAP_CONV_IN_CE

Reading data from a byte-like data object and converting from an external format to the system format.

CL_ABAP_CONV_OUT_CE

Converting data from the system format to an external format and writing in a byte-like data object.

CL_ABAP_CONV_X2X_CE

Converting data from an external format to another external format.

DATA: num TYPE char10.

num = 81977990.
TRANSLATE num(5) USING '0'.

WRITE: num.

REPLACE num(5) IN num WITH '0'.

WRITE: num.

output:  81977990  
07990

Read only

Former Member
0 Likes
806

Hi,

There will be no change in num value.

Read only

Former Member
0 Likes
805

Nvm.

Read only

Former Member
0 Likes
805

Can't you press just F8 button and see?