Skip to Content
avatar image
Former Member

Is there somewhere to define and maintain Sequence Numbers

Hello all,

I am working on an outbound file layout (via DMEE) for a Bank and one of the fields they require is a non-repeating sequence number. Here is the exact requirement:

The Transaction Sequence Number is used to link all the records relating to a specific transaction. This is an ascending number starting at 00000001 for the first transaction, and increasing by 1 for each subsequent transaction. This number will re-initialize back to 00000001 when it reaches 99999999.

The customer should keep the sequencing between files, thus if the last transaction in the last file was u201800001338u2019 the next files will start with transaction u201800001339u2019 (n+1)

My question is: Is there a dictionary item for creating sequences and corresponding functions for getting the next value and current values of that sequence. I was thinking of something along a DB Sequence as implemented in say Oracle DB: Create Sequence my_seq ....

Select my_seq.next_val into my_field etc.

Failing that, is there some existing SAP routine(s) which performs this functionality.

It took me about a day to code up a set of sequence components which will do what I want, but I would prefer to use something provided by SAP.

Here is my system info:

SAP_BASIS 620 0058 SAPKB62058 SAP Basis Component

SAP_ABA 620 0058 SAPKA62058 Cross-Application Component

SAP_APPL 470 0025 SAPKH47025 Logistics and Accounting

SAP_HR 470 0010 SAPKE47010 Human Resources


PI 2004_1_470 0015 SAPKIPZI5F PI_2004_1_for_R3_Release_470

PI_BASIS 2005_1_620 0000 - PI_BASIS 2005_1_620

ST-PI 2005_1_620 0008 SAPKITLQG8 SAP Solution Tools Plug-In

EA-APPL 110 0021 SAPKGPAA21 SAP R/3 Enterprise PLM, SCM, Financials

EA-FINSERV 110 0006 SAPKGPFA06 SAP R/3 Enterprise Financial Services

EA-GLTRADE 110 0006 SAPKGPGA06 SAP R/3 Enterprise Global Trade

EA-HR 110 0010 SAPKGPHA10 SAP R/3 Enterprise HR Extension

EA-PS 110 0006 SAPKGPPA06 SAP R/3 Enterprise Public Services

EA-RETAIL 110 0006 SAPKGPRA06 SAP R/3 Enterprise Retail

DIMP 471 0009 SAPKIPME09 DIMP 471 : Add-On Supplement

ST-A/PI 01K_R3_470 0000 - Application Servicetools for R/3 470

Thanks for your time!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Sep 10, 2008 at 03:02 PM


    there are multiple ways you can do that..

    1) Create a Z table to store the last transaction number...and when the next time the program runs..get the value from the ztable...and update the last transaction number before the program ends..


    2) Create a number range object in SNRO and use the function module NUMBER_GET_NEXT to get the next running sequence number...


    3) Use the IMPORT / EXPORT TO DATABASE to store the last transaction in the memory...

    IMPORT last = last

    FROM DATABASE indx(st)

    ID 'TABLE'.



    Add comment
    10|10000 characters needed characters exceeded