Skip to Content

How to generate a Ref-number automatically ( System Generated) in ABAP

Hi,

I have created a z-table where ref_number is the key field. I want to fill this table automatically by system so that whenever a new record by customer is entererd, this ref_number will be given to them with response.

So Could any one help me out,

Gud points will be rewar5ded for useful answers.

Thanks in advance,

Sunil

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Nov 02, 2007 at 06:53 AM

    hi,

    make use of function module:

    NUMBER_GET_NEXT

    before this you need to define number range for the reference no. for this

    goto tcode: snro there create one object and specify number range.

    then pass this info to Function Module. and collect it in one variable and then insert in your ztable.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 02, 2007 at 07:03 AM

    Hi

    In you table maintenance generator, write code using events in table maintenance screen,

    write the below

    05 NEW_ENTRY click on the nest column and write the code

    • when creating new entry pass counter with automatic generation value.

    DESCRIBE TABLE total LINES lv_lines.

    lv_lines = lv_lines + 1.

    zsd-counter = lv_lines.

    Regards

    Shiva

    Add comment
    10|10000 characters needed characters exceeded