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: 

MV45AFZZ USEREXIT_SAVE_DOCUMENT Change VBEP-ETTYP Value

90070279
Participant
0 Kudos
1,854

Greetings,

In VA01/VA02, credit check processing seems to occur after userexit_save_document_prepare leaving me only with userexit_save_document. In userexit_save_document, I am trying to change the schedule line category depending on VBUK-CMGST value.

My question is whether I need a BADI or is there some other formula/user-exit available. I have tried to change the value in userexit_save_document and it changes but the change does not carry through to the database. When I leave the user-exit, the value is ok but somewhere down the road it gets lost.

Here is my current userexit code for the include called from within userexit_save_document:

form zz_zv45cor_credit.

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

check xvbep[] is not initial.

loop at xvbap

where updkz <> 'D'

and ( pstyv = 'TAC' or pstyv = 'TAN' or pstyv = 'TAS' ).

clear xvbep.

loop at xvbep where posnr = xvbap-posnr

and wmeng <> 0

and updkz ne 'D'.

if vbuk-cmgst = 'B' and xvbep-ettyp ne 'Z0'.

if sy-tcode = 'VA02' and xvbep-updkz is initial.

move-corresponding xvbep to yvbep.

append yvbep.

xvbep-updkz = 'U'.

endif.

xvbep-ettyp = 'Z0'.

modify xvbep.

elseif vbuk-cmgst = 'D' and xvbep-ettyp ne 'CP'.

if sy-tcode = 'VA02' and xvbep-updkz is initial.

move-corresponding xvbep to yvbep.

append yvbep.

xvbep-updkz = 'U'.

endif.

xvbep-ettyp = 'CP'.

modify xvbep.

endif.

endloop.

endloop.

endform. " zz_zv45cor_credit

Any help or ideas is appreciated..

Thanks,

Tim

3 REPLIES 3

Former Member
0 Kudos
273

Hi TIM ,

we dont have any Active BADIs for this. Just check ur conditions itself , or try with tables YVBAP inst.of XVBAP.

Regards

Peram

bdienes2
Participant
0 Kudos
273

Hi Tim,

I am seeing the same behavior where the VBEP records are not saved even though the data is correct after it leaves the user exit.

Is this due to the XVBEP-UPDKZ values?

What was your solution?

90070279
Participant
0 Kudos
273

Hello Brian,

This was a long time ago and I don't really remember the specifics anymore. We ended up divesting the company that this code was intended for and as such this code or requirement is no longer in our system. However I seem to recall that I was not able to change the XVBEP table in this user exit no matter the XVBEP values - but don't hold me to that. Sorry I can't be of more help. I did try to look through version management, etc but I just don't see that I have this code so perhaps I was doing this in a sandbox instance.

Thanks,

Tim