Why does this happen?

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Post Reply
crocker
Posts: 5
Joined: Thu Jul 21, 2005 12:52 pm

Why does this happen?

Post by crocker » Tue Aug 02, 2005 11:46 am

Hi.

Put some code in user exit RV60AFZZ, form USEREXIT_NUMBER_RANGE. The code basically takes data from XKOMV and updates a custom field on VBRP and another on VBRK. This is accomplished by updating the working tables XVBRP and XVBRK. When an invoice is created via VF01, these fields are updated correctly and all is well.

The problem is when that invoice is cancelled (VF11), no actual cancellation takes place. There is a cancellation doc number created, but no actual cancellation.

Could anyone tell me why this happens? Thanks, I am fairly new to SAP/ABAP, so any help is welcome.

Thanks!

Crocker.

Hognox1ous

Re: Why does this happen?

Post by Hognox1ous » Tue Aug 02, 2005 12:37 pm

crocker wrote: The problem is when that invoice is cancelled (VF11), no actual cancellation takes place. There is a cancellation doc number created, but no actual cancellation.
.
What do you men, precisely, by 'no actual cancellation takes place'?

crocker
Posts: 5
Joined: Thu Jul 21, 2005 12:52 pm

Post by crocker » Tue Aug 02, 2005 1:07 pm

Sorry for the confusion....When VF11 is run with my logic, a new document number for the cancel is displayed at the bottom of the screen, but when you go to look up that number in VBRK, VBRP it does not exist. When I comment out my code and run the same scenario, the cancel works as it suppossed to.

It seems like by updating the XVBRK, XVBRP tables I am causing problems.

hognoxious
Posts: 1398
Joined: Thu Dec 04, 2003 8:16 am
Location: Stuck in a pagoda with Tricia Toyoda

any old userexit will do...

Post by hognoxious » Tue Aug 02, 2005 1:14 pm

crocker wrote: It seems like by updating the XVBRK, XVBRP tables I am causing problems.
I just reread your post. USEREXIT_NUMBER_RANGE is for changing the number range used (often to have number ranges per company code or sales org, rather than per doc type). Seems you're using it for something other than what it was intended for.
First he pinches my sig, Now he's cribbing my posts too!

crocker
Posts: 5
Joined: Thu Jul 21, 2005 12:52 pm

Post by crocker » Tue Aug 02, 2005 1:22 pm

Thanks for your reply. Where it works great for the creation of an invoice and not for the credit is what has me a bit puzzled. But I agree that perhaps I need to find another userexit.

This exit showed promise due to the fact that XKOMV, XVBRP and XVBRK were all available. I needed to get tax fields from XKOMV moved to my new custom fields within VBRP and VBRK.....all the others I debugged and checked did not provide these tables at the same time....

Thanks again for your response!

phillipm
Posts: 376
Joined: Fri Oct 25, 2002 3:54 am
Location: Lyon, France

Post by phillipm » Wed Aug 03, 2005 2:40 am

Take a look at this note: 415716
It is for User exits in delivery processing. Not exactly your specific, but it has a lot of interesting and useful info. Especially for how to correctly update xvbak, etc.. tables.
If you look there should also be a specific note for your needs.
Have not found it myself.
If you do let us know...

Phillip

crocker
Posts: 5
Joined: Thu Jul 21, 2005 12:52 pm

Post by crocker » Wed Aug 03, 2005 8:25 am

Thank you Phillip, I will have a look and update this thread with anything I find useful.

ocvantol
Posts: 929
Joined: Tue Oct 22, 2002 3:19 am
Location: The Hague

Post by ocvantol » Wed Aug 03, 2005 8:39 am

I have abbused this exit too. XVBRK(P) is an internal table with header line. For each temporary document the user exit is called (vbeln = $....). If you change the body of the internal table make sure you change the header line accordingly. Actually, it is the header line that is being processed, not the body.
Oscar.

Post Reply