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

Sales Order Change Problem Data Refresh

Former Member
0 Likes
1,607

Hello Experts,

My issue is the following:

In the transaction VA02, i want change the value of the field VBAP-ABGRU. I did it in the User Exit MV45AFZZ, in the FORM USEREXIT_FIELD_MODIFICATION.

The value of the field changes but the Item line stays shading. I must make some change in the Sales Order and press Enter so that the system takes into account the modification and activates the Item Line.

To resolve this problem, i tried use the BAPI 'BAPI_SALESORDER_CHANGE' but another problem appears is that this BAPI clears all of global variables of VA02, so at the end, all fields in the transaction VA02 are blanks although the Sales Order exists and has data!!

Exist some solution to refresh sales order data inside the transaction VA02 (to activate the Item line) without do changes and press ENTER?

Thank you.

1 ACCEPTED SOLUTION
Read only

naimesh_patel
Active Contributor
0 Likes
1,148

You should change / modify the VBAP fields in the routine USEREXIT_MOVE_FIELD_TO_VBAP.

Change the values in the XVBAP.

Set a break point in the subroutine and try it in debugging.

Regards,

Naimesh Patel

7 REPLIES 7
Read only

naimesh_patel
Active Contributor
0 Likes
1,149

You should change / modify the VBAP fields in the routine USEREXIT_MOVE_FIELD_TO_VBAP.

Change the values in the XVBAP.

Set a break point in the subroutine and try it in debugging.

Regards,

Naimesh Patel

Read only

0 Likes
1,148

Hello Naimesh,

Thank you for your answer.

I did it but the problem that the system doesn't pass by this form in the first.

I start the transaction VA02, i put the Order Number and i do ENTER, the system doesn't pass by the break-point in the FORM USEREXIT_MOVE_FIELD_TO_VBAP !!

And me, i need activate the Item Line before show it to the user so that can change it. So, i must put my code in one Form from where the system pass in the first like USEREXIT_FIELD_MODIFICATION or USEREXIT_READ_DOCUMENT.

Do you have any idea please?

Read only

0 Likes
1,148

Try to change it in the subroutine USEREXIT_READ_DOCUMENT.

Change the internal table XVBAP.

Regards,

Naimesh Patel

Read only

0 Likes
1,148

Hi Naimesh.

I tried it too, the value of VBAP-ABGRU changes but the Item Line and some fileds in the screen are always shading (even though the musn't when i clear the VBAP-ABGRU)!!

For that, I msut do some change in the order and press ENTER to activate them. And this is the problem, i want that to be activated automaticaly.

What do you think?

Read only

0 Likes
1,148

I got your problem now.

After some debuggin and digging into SAPMV45A, I found out that the Editable or non-editable property of the fields is being set based on the XVBUP-ABSTA (which is the Line item rejection status).

So, in the subroutine, USEREXIT_READ_DOCUMENT:

Clear XVBAP-ABGRU for all the items (Internal table)

Clear XVBAP-ABGRU (workarea)

Set A in XVBUP-ABSTA for all the items (internal table)

Set A in XVBUP-ABSTA (workarea)

It will open up the fields for editing and remove the block.

Regards,

Naimesh Patel

Read only

0 Likes
1,148

Thank you very very very very MUCH Naimesh.

That works perfectly.

I owe you a coffee

Read only

0 Likes
1,148

I prefer Starbucks one

Just kidding...