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: 

a question about character addition.

Former Member
0 Kudos

Hi,

i have a question about character. seet the following code.

DATA: lv_entryid TYPE char3.

lv_entryid = '001'.

WRITE : / lv_entryid.

lv_entryid = lv_entryid + 1.

WRITE : / lv_entryid.

the answer is :

001

2

but the result i expect is

001

002.

how to process, Could you please help me?

Thanks in advance.

1 ACCEPTED SOLUTION

gopi_narendra
Active Contributor
0 Kudos
DATA: lv_entryid TYPE char3.

lv_entryid = '001'.
WRITE : / lv_entryid.
lv_entryid = lv_entryid + 1.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
     EXPORTING
          input  = lv_entryid
     IMPORTING
          output = lv_entryid.


WRITE : / lv_entryid.

Try this code and see

Regards

Gopi

2 REPLIES 2

gopi_narendra
Active Contributor
0 Kudos
DATA: lv_entryid TYPE char3.

lv_entryid = '001'.
WRITE : / lv_entryid.
lv_entryid = lv_entryid + 1.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
     EXPORTING
          input  = lv_entryid
     IMPORTING
          output = lv_entryid.


WRITE : / lv_entryid.

Try this code and see

Regards

Gopi

Former Member
0 Kudos

Try this

DATA: lv_entryid TYPE char3,

lv_ntype(3) type n.

lv_entryid = '001'.

WRITE : / lv_entryid.

lv_ntype = lv_entryid + 1.

lv_entryid = lv_ntype.

WRITE : / lv_entryid.

Thanks

Mahesh