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: 

Need to reprice rebate condition when VBAP-ABFOR / payment card is updated

Former Member
0 Kudos

In our order process we have many materials that are rebate-eligible.  I'm an ABAPer and my functional analyst and I are trying to figure out where / how to place code to systematically trigger what is now working correctly as a manual Update process:

When the order in VA01 is placed and the credit card is entered on the header->payment card tab, the VBAP-ABFOR gets updated through current config with a custom indicator (Z2) for credit card.  (More correctly, a current, unsaved order probably has this value in XVBAP or YVBAP.

As you may know the field on the item's Billing Document tab for this is Payment Guarantee Indicator (on the lower portion of the tab screen).

What we want to happen, as soon as CC is entered on the header, is to adjust (and trigger?) a custom rebate condition that we have (ZRB1).

We can get the ZRB1 to adjust manually from the item's condition tab, by hitting the Update (Prices)  button on the bottom of the condition tab screen.

Manually, we can (for instance) choose Pricing Type B ("Carry Out New Pricing"), and the rebate condition ZRB1 is adjusted correctly.  Type B is a bit global however.  We want to trigger the custom ZRB1 condition to apply to the items when CC is entered as the payment method.


We thought we might be able to use one of the unused customer Pricing Types (e.g. "X") to only adjust the ZRB1 rebate condition in these circumstances.

We want it to happen systematically, when a Credit Card is entered, and we want it to be available from the Condition tab Update button as well (for manual applications).

I'm an ABAPer and don't have much experience with determining and activating Pricing Types, etc.

  My functional analyst and I are trying to figure out :

1) how to assign and correctly code one of the unused Pricing Type updates.

2) how to make this trigger systematically, when Credit Card is entered.

We are speculating if USEREXIT_PRICING_RULE in program RV61AFZA is a possibility to contain the code.

I appreciate any help you could provide as to how to accomplish this.

Thanks!
Jeremy H.

1 REPLY 1

Former Member
0 Kudos

Still need help, here.

I managed to code an enhancement in RV61AFZA--USEREXIT_PRICING_RULE to append the custom type of X from the pricing types to the STEU internal table for my new rebate condition type of 'ZRB1'.

Through   A   LOT   of trial and error and debugging, I found that simply adding a check in the include MV45AFZZ:

FORM userexit_field_modification.

   CASE screen-name.

     WHEN 'VBAP-ABFOR'.

       READ TABLE xvbap INDEX 1.

       IF sy-subrc = 0.

         IF xvbap-abfor = 'Z2'.

           PERFORM preisfindung(sapfv45p) USING 'X'.

         ENDIF.

       ENDIF.

   ENDCASE.

...did the trick to reprice when a CC is added to the header in VA01.  (The BA also had to add some config to make the custom update type of X work for the ZRB1 condition type; to tie them together.

So, yay, this is working!

A followup requirement (there is always one, right?!) 🙂   is to DEcouple the update type of B (which right now updates ALL pricing when it is chosen) to NOT update the new ZRB1 condition (only X should do this function now, in this followup requirement).  Any ideas on where to place restrictions on B?  Or if this is even a good idea?

Hopefully someone has some helpful info here...

Thanks

Jeremy H.