Application Development 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: 

increment of alphabets

Former Member
0 Kudos

Hi ,

I have to increment alphabet from 'a' to 'b' to 'c' and so on til 'z' with respect to different count value.How can i do it programatically.

Thanks

7 REPLIES 7

former_member588853
Active Contributor
0 Kudos

Hi,

Take a character variable of length 26 and include 'abcd..xyz'..

depending on your count you can assign the alphabet..

say

x = 'abcdefgh..xyz'.

y = x+0(1) = a,

y = x+2(1) = c and so on..

reward if useful,,

regards,

nazeer

Former Member
0 Kudos

take the system variable SY-ABCDE

and take one character each time u increment

SY-ABCDE = abcd..................z

data : v_cnt type i value 0,

v_char(1).

v_char = SY-ABCDE+V_cnt(1).

Each time v_cnt get incremented the value of v_char will change from a - z

Former Member
0 Kudos

Hai Abhishek Mishra,

Use

CHAR_TO_ASCII FM and then

Add 1 to it.(Use Some temparory number)

Pass this to :

ASCII_TO_CHAR.

Thats all.

Hope you now can do it.

Hope you got it.

Reward points if it helps you.

Regds,

Rama chary.Pammi

sreeramkumar_madisetty
Active Contributor
0 Kudos

Hi

By adding the ASCII values you can do it na?

Regards,

Sreeram

Former Member
0 Kudos

Hi

Try something like this:

PARAMETERS: P_IN(1).

DATA: P_OUT(1),
          V_NEXT TYPE I.     

IF SY-ABCDE CS P_IN.
  V_NEXT = SY-FDPOS + 1.
  P_OUT = SY-ABCDE+V_NEXT(1).
  WRITE P_OUT.
ENDIF.

Max

Former Member
0 Kudos

Hi,

using shift u can solve this problem

define a string with list of alphabets .

each time pick the first character from the string and shift the string circular so that it always gives correct sequence of alphabets

ex:

Data:l_string type string value 'abcdefghijklmnopqrstuvwxyz'.

do counter times.

shift l_string circular.

enddo.

write:/ l_string+0(1).

i hope this is helpful to u...

reward if needful...

Message was edited by:

ramesh kumar

Former Member
0 Kudos

Hi abhishek..

You can do like this.

data:

w_ctr type i,

w_char.

<b>do 26 times.

w_ctr = sy-index - 1.

w_char = sy-abcde+w_ctr(1).

write: / w_char.

enddo.</b>