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: 

Sales Order userexit

Former Member
0 Kudos

Hi folks

I try to replace default value of VBAK-KKBER with another value during sales order creation in VA01. I could find structures like VBAK, XVBAK, YVBAK, SVBAK, etc in MV45AFZZ. I assigned new value for KKBER field in these structures and tested. I tested userexit_save_document, userexit_move_field_to_vbak and another userexit EXIT_SAPFV45K_001. But could not replace VBAK-KKBER value, after sales order creation VBAK table shows old default value.

Anyone can give me an idea to solve my issue.

All helpful answers will be awarded.

Thanks

HBK

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Bala,

Set a breakpoint at the place where you change the KKBER value. When you reach that breakpoint, step thru it. Then immediately after you set the value to your liking, create a watchpoint in the debugger on VBAK-KKBER. This will expose the code that is changing VBAK-KKBER from your value to another value.

Investigate why that is happening and address it then.

I might also suggest changing the value in UserExit Userexit_save_document_prepare INSTEAD of userexit_save_document.

5 REPLIES 5

ferry_lianto
Active Contributor
0 Kudos

Hi HBK,

Please assign the value to XVBAK-KKBER instead of VBAK-KKBER.

Hope this will help.

Regards,

Ferry Lianto

Please reward points if helpful.

0 Kudos

Hi Ferro,

I am working on a similar thing. I am confused why do we have to use XVBAP instead of VBAP or XVBAK instead of VBKA. I am confused on the X.

Shejal.

0 Kudos

Shejal,

The "X" means the "change" values.

VA0x has data objects like YVBAP and XVBAP, for example.

YVBAP contains the line item values at the time that the user started the transaction. XVBAP contains the line item values AS THE USER IS RUNNING VA0x (including the user's changes). These 2 data objects allow you to compare the before and after values.

Former Member
0 Kudos

Bala,

Set a breakpoint at the place where you change the KKBER value. When you reach that breakpoint, step thru it. Then immediately after you set the value to your liking, create a watchpoint in the debugger on VBAK-KKBER. This will expose the code that is changing VBAK-KKBER from your value to another value.

Investigate why that is happening and address it then.

I might also suggest changing the value in UserExit Userexit_save_document_prepare INSTEAD of userexit_save_document.

0 Kudos

Hi, Ari!

Could you tell me how you have solved this problem?

Thank you in advance,

Andréia Freitas