‎2007 Sep 11 6:57 AM
Hi friends,
I need a small help.I am implementing a custom enhancement for Sales Orders.
For this,I am using the User Exit SAVE_DOCUMENT_PREPARE in the standard program MV45FZZ(Include in SAPMV45A).I wrote a small logic,that gets triggered each time a Sales Order is created or Changed through VA01 or VA02 respectively.
For <b>VA02</b> i.e., <b>change</b> my logic works pretty well.I am capturing the current Sales Order Number using <b>XVBAP-VBELN</b> and implementing my logic.
But while <b>creation</b> i.e., <b>VA01</b>,I am using the same logic and trying to capture current Sales Order through <b>XVBAP-VBELN</b>(not yet saved).
But,<b>XVBAP-VBELN</b> is blank when I am debugging.
Where does the Sales Order Number get saved,while it is being created i.e., before being saved.
Regards,
Imran.
‎2007 Sep 11 7:16 AM
hi Masood,
it is not saved to anywhere (in the database), before it is saved. It exists only in the memory.
What is the logic which you applied?
ec
‎2007 Sep 11 7:32 AM
Hi Eric,
I need to check the Pricing date PRSDT in VBKD for the Current Sales Order.If it is less than a value(Constant Date),I need to place a Billing Block.
While changing i.e., VA02,I can access XVBAP-VBELN and retrieve PRSDT from VBKD and check it.
But,while Creation i.e., VA01, XVBAP-VBELN is blank.
How can I get the current Sales Order while creation through VA01 ?
Regards,
Imran.
‎2007 Sep 11 7:23 AM
check the value of <b>vbak-vbeln</b> in the subroutine <b>userexit_save_document</b>
Also make a note of the following
<b>USEREXIT_SAVE_DOCUMENT</b>
Use this user exit to fill user-specific statistics update tables.
The user exit is called up by the FORM routine BELEG-SICHERN before
the COMMIT command.
Note
If a standard field is changed, the field r185d-dataloss is set to
X. The system queries this indicator at the beginning of the safety
routine. This is why this indicator must also be set during the
maintenance of user-specific tables that are also to be saved.
<b>USEREXIT_SAVE_DOCUMENT_PREPARE</b>
Use this user exit to make certain changes or checks immediately
before saving a document. It is the last possibility for changing or
checking a document before posting.
The user exit is carried out at the beginning of the FORM routine
BELEG_SICHERN.