Application Development and Automation 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: 
Read only

User Exit for SD Billing: When generating Document Number

Former Member
0 Likes
727

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

5 REPLIES 5
Read only

peter_atkin
Active Contributor
0 Likes
692

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

Read only

0 Likes
692

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.

Read only

0 Likes
692

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.

Read only

0 Likes
692

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??

Read only

0 Likes
692

Alex,

Stick the code in a suitable BADI or user-exit (preferably at the save event)

PeteA