Skip to Content
avatar image
-2
Former Member

Revert the number generated by NUMBER_GET_NEXT

My requirement is like - I am using FM NUMBER_GET_NEXT to generate a number to be printed on smartform. But If user clicks on print preview, the generated number is wasted. It should generate the number only when the user clicks on print button.
How can I do it so that if user clicks on preview button, the number generated should revert back and no number will be wasted.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Dec 31, 2016 at 10:55 PM

    The solution in standard SAP programs is to use a dummy number (for instance $000000001) until the time the "object" is being saved for real. Note that it's not possible to use ROLLBACK WORK because there's a dialog which automatically commits the database changes (if your range object is not based on memory).

    Add comment
    10|10000 characters needed characters exceeded