‎2008 Jul 11 2:46 PM
Dear Experts,
I have the requirement to store some info to an add-on table when saving the billing document. As you know,the billing document number just generates at last time,before which it shows in form of '$0000001'. So do you know which user exit will show me the true number of billing document when it is saved
‎2008 Jul 11 4:35 PM
Alex,
We have exactly the same issue in PM/CS when using orders and notifications.
A trick I have used in the past is to utilise an "at save" user-exit, then use the following syntax:
PERFORM XYZ ON COMMIT.
In our case, this performs the XYZ form after the document number has been assigned by the system
PeteA
‎2008 Jul 11 7:38 PM
Hi ,Dear Pete,
Actually,I don't know what you exactly mean.
I want to find a userexit ,function module exit or a BAdI which can provide me with the Billing document number before it saved. If you do know the solution,please explain it and let me know. Thanks very much.
‎2008 Jul 12 8:51 AM
Alex,
Here's an example using user-exit IWO10009 (at saving a PM/CS order).
If you debug IWO10009 in create mode, then the order number has not yet been assigned. We therefore use the ON COMMIT syntax to force the system to perform the code later in the process i.e. on commit...
* Note the u201Con commitu201D statement. This ensures the order number is
* available during creation mode.
if sy-binpt = ' ' and sy-uname <> u2018WF-BATCHu2019.
perform after_number_assignment on commit.
endif.
*&---------------------------------------------------------------------*
*& Include: ZXWOCF01
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Form: After_Number_Assignment
*&---------------------------------------------------------------------*
form after_number_assignment .
* perform your code here
endform.
‎2008 Jul 12 2:05 PM
Dear Pete,
Thanks for your explanation,but i still have confusion.
I wanna know where the Form "after_number_assignment" was defined. As I know , we could just append our codes in existing userexit form, do you mean we can append our own form n standard program??
‎2008 Jul 12 2:49 PM
Alex,
Stick the code in a suitable BADI or user-exit (preferably at the save event)
PeteA