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

Character type field

Former Member
0 Likes
682

Hi all,

I stored 'A' in a character field which is of lenght 1. How can it be incremented to B, C, D and so on. (Suppose in loop or so).

Regards,

Balakrishna.N

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
657

Hi,

u have to build up the logic...

use SY-ABCDE.

get the fpos value of the character in sy-abcde . and increment the position by 1. u will get the next character.

regards,

lavanya

Hi all,

I stored 'A' in a character field which is of lenght 1. How can it be incremented to B, C, D and so on. (Suppose in loop or so).

Regards,

Balakrishna.N

3 REPLIES 3
Read only

Former Member
0 Likes
657

Hi,

DATA: WA_VALUE(3),

WA_CTR TYPE I,

WA_CHAR(1).

DO 26 TIMES.

WA_CTR = SY-INDEX - 1.

WA_CHAR = SY-ABCDE+WA_CTR(1).

WRITE: / WA_VALUE.

ENDDO.

Thanks

Nayan

Read only

Former Member
0 Likes
658

Hi,

u have to build up the logic...

use SY-ABCDE.

get the fpos value of the character in sy-abcde . and increment the position by 1. u will get the next character.

regards,

lavanya

Read only

Former Member
0 Likes
657

Use Translate


CONSTANTS:
  trn(52) VALUE 'ABBCCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSSTTUUVVWWXXYYZZA'.
DATA:
  chrfld VALUE 'A'.

DO 26 TIMES.
  WRITE:/ chrfld.
  TRANSLATE chrfld USING trn.
  WRITE AT 10 chrfld.
ENDDO.