07-16-2007 3:20 PM
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
07-17-2007 5:44 AM
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
11-20-2014 3:53 AM
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?
11-20-2014 2:36 PM
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