Skip to Content
avatar image
Former Member

a question about character addition.

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Aug 17, 2007 at 02:05 AM
    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 17, 2007 at 02:08 AM

    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

    Add comment
    10|10000 characters needed characters exceeded