cancel
Showing results for 
Search instead for 
Did you mean: 

VOFM Pricing Routine Requirement add checking on Item Cat

Former Member
0 Kudos

There is a requirement wherein the pricing condition type, which currently has a routine requirement 24 on the pricing procedure, will check what the item category is. If it finds ZMC6 item cat for that line item, the pricing procedure should skip the condition type ZREB.

What I plan is to copy Pricing Requirement 24, create a new one and add Item Cat on the checking.

Where should I add the KOMP-PSTYV checking on the code?

We already tried to add it right after...

komp-kposn ne 0 

... but what happens is, if the line item with ZMC6 item cat is on line item 10 (first item), all succeeding line items will skip ZREB pricing condition type.


TIA for the help.

Accepted Solutions (0)

Answers (2)

Answers (2)

VeselinaPeykova
Active Contributor

I added a check for item category in kobed (check: komp-pstyv ne 'ZTA1'), in the if... endif part. Everything seems to work as I would expect - the condition is determined in final billing, but not in my standard sales order, and only when the item is pricing-relevant and the category is not ZTA1.

In my case the custom condition is fixed amount surcharge with condition category = L, the price source in VTFL for both item categories is E with pricing type = G. I also have a pricing requirement in the pricing procedure for my outbound delivery.

I don't know how exactly your changed code looks like and what is the pricing configuration in your system (which is the reason why I listed my settings and the code change), but you can simply place a break-point in the routine and find out in debug what is going on.

If you don't feel comfortable troubleshooting pricing via debug, or if you have insufficient authorizations to do so, ask a more experienced colleague from the development department to assist you.

*** Needless to say, the hard-coding by item category in my example was merely for testing purposes, I would not normally suggest this in a real scenario.

Former Member
0 Kudos

This is how the code looks like right now:

FORM KOBED_600.
sy-subrc = 4.

  if komp-kposn ne 0.
     check komp-pstyv ne 'ZMC6'.   
       check: komp-prsfd = 'X'.
  endif.

  check: komk-vbtyp ca vbtyp_fakt or   "Invoices
         komk-vbtyp ca vbtyp_anfo or   "Credit / Debit requests
         komk-vbtyp = 'H'.             "Returns
  check: komk-vbtyp ne 'U'.            "excluding Pro Forma invoices

sy-subrc = 0.

ENDFORM.


FORM KOBEV_600.

  sy-subrc = 4.
  check: komk-vbtyp ca vbtyp_fakt or
         komk-vbtyp ca vbtyp_anfo or
         komk-vbtyp = 'H'.
  check: komk-vbtyp ne 'U'.
  check komp-pstyv ne 'ZMC6'.   
  sy-subrc = 0.

ENDFORM.

Jelena
Active Contributor

Just add CHECK .... right before SY-SUBRC = 0 line. I don't know about the purpose of KPOSN condition here but if it doesn't apply to your case then obviously new validation must not be inside that IF... condition.

You could also probably shorten that PSTYV validation but that's another story. Get an ABAPer to work on this.

+1 to Veselina.