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: 

Enhancement for VA01 item's pricing date

Former Member
0 Kudos
681

In VA01, there are 'first date' and 'pricing date' in sales order's item. I want to enhance VA01 to realize: If end user change the 'first date', the 'pricing date' will auto change to the value equal to 'first data'.

For example:

sales order item's first date is 2008/3/25, pricing date is also 2008/3/25.

Then user change the first date to 2008/5/25, I need the pricing date auto change to 2008/5/25.

In that way, sales item's net value will also auto update.

I have try many ways, like bellow:

VA01 EXIT: MV45AFZZ,MV45ATZZ, MV45AOZZ,MV45AIZZ, MV45AFZB

BADI: BADI_SD_SALES

I can't find any enhancement to realize the function.

Could anyone give me some idea?

Cheers! Thanks in advance.

Regards,

Eric .

3 REPLIES 3

Former Member
0 Kudos
114

Hello Eric,

I believe you can do it in MV45AFZZ

Please do the following in the code for item section

FORM USEREXIT_MOVE_FIELD_TO_VBAP.

although it is meant for updating the ZZ fields we can write the code here since it gets triggered for each line item

if sy-tcode = 'VA01' or sy-tcode = 'VA02'.

if 'first date' NE 'pricing date'.

pricing data = first date.

endif.

endif.

The fields may be stored in structure VBAP and in table XVBAP as internal table....

Please let me know if it worked out..

Reward if useful

Regards

Byju

0 Kudos
114

Hi Byju:

I can't do it in MV45AFZZ

because the 'first date' field is VBEP-EDATU,'pricing date' is field is VBKD- PRSDT. The date fields is not in table VBAP.

So USEREXIT_MOVE_FIELD_TO_VBAP can't slove my issue.

thank you all the same.

you can download description of my issue:

http://www.esnips.com/doc/999911de-1098-4221-a571-4352400c924b/VA01-Enhancement

if you have any other idea,please help me. thanks very much.

0 Kudos
114

Ok Eric,

Lets try an alternative here ...

We have 2 subroutines in MV45AFZZ

(1)FORM USEREXIT_MOVE_FIELD_TO_VBEP

(2)FORM USEREXIT_MOVE_FIELD_TO_VBKD

in subroutine(1) Can we try an export to memory with a table of 3 fields vbeln/posnr/EDATU

In subroutine(2) we can import the same table and do the check .thet if the dates are different pass the value of one to another

Only thing we need to make sure is that duplicate entries are not maintained in the internal table we export..in the import side we can easily identify required data using the item number....

Can you pls check and revert.....

Reward if helpful

Regards

Byju