cancel
Showing results for 
Search instead for 
Did you mean: 

Modify Positions at save

Former Member
0 Kudos

Dear all

I have to check and modify if needed KDMA from vbap. I try to use Userexit USEREXIT_SAVE_DOCUMENT_PREPARE in MV45AFZZ.

I do following:

LOOP AT xvbap.

IF xvbap-kdmat IS INITIAL.

xvbap-kdmat = w_norepar.

modify xvbap transporting kdmat.

ENDIF.

ENDLOOP.

ENDIF.

I check at the end and in xvbap all kdma are filled. When I goto VA02 after, the field is still empty.

can you help?

thank you

Herbert

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

The user exit may require the code to be triggered in various places depending on the keys that are pressed and when you want the move to occur.

I suggest debugging to see that indeed the logic is being triggered at the correct time and that the value you are passing is populated.

As for the modify statement, try something more along these lines

modify xvbap index sy-tabix transporting kdmat.

When processing the record the position is key to updating the correct record.

Former Member
0 Kudos

Dear Anabela

i'm not sure about your answer. It's not a problem updating the xvbap. I set a break-point at the end of the user exit, and xvbap is filled correctly.

So in this case the data are filled ok when we leave the user exit. But then the standard routine does not seems to consider this.

Should it be possible to modify position data in this user-exit? Have you already done this?

Former Member
0 Kudos

We do use the user exit to modify fields in SD tables.

In one case, the logic is triggered in the following user exits

FORM USEREXIT_MOVE_FIELD_TO_VBKD.

FORM USEREXIT_SAVE_DOCUMENT.

FORM USEREXIT_SAVE_DOCUMENT_PREPARE.

It is necessary in each of them because sometimes the value gets cleared.

I'm not saying that you need it in each of those user exits, but you may want to check if the value gets cleared in any one of them.

Answers (0)