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 Exits-Help Needed

Former Member
0 Likes
577

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.

3 REPLIES 3
Read only

JozsefSzikszai
Active Contributor
0 Likes
532

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

Read only

0 Likes
532

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.

Read only

Former Member
0 Likes
532

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.