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: 

Revert the number generated by NUMBER_GET_NEXT

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor

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).

1 REPLY 1

Sandra_Rossi
Active Contributor

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).