cancel
Showing results for 
Search instead for 
Did you mean: 

SD Pricing condition VA00 with Custom Routine.

juliusku
Participant
0 Kudos

Hello everybody,

I am using the condition type VA00 which works great, now we have the requirement to exclude some conditions records from VA00 by material finish code. Therefore, we have created a Z table to define the exclusions and copied the routine #2 adding some custom code to exclude the matching finish codes from our Z table.

This is not working well because there is the possibility that there is a material with many finish codes and it activates many entries from VA00, if one of those items match the Z table it will exclude the whole VA00 condition.

Can anybody let me know a better approach to achieve this?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

sez41
Active Contributor
0 Kudos

How do you distinguish the material codes of which will exclude VA00 condition records from the ones which will not? Can't you distinguish them by using a field in material master (material groups a la MVKE-MVGR* fields come to mind)? If you can, just create a new condition table with material group, assign it to your VA00 access sequence and update your condition records accordingly.

juliusku
Participant
0 Kudos

Thank you very much for your answer!

We have that, when I meant finish codes I meant the Variant Configuration of the materials.I'am attaching some images of the 57 table and the pricing condition that is pulling 2 VA00 conditions that match this table, but I want to exclude one of them.


How can I achieve this? if every time I validate this in the custome code as follows, it is excluding it all.

This is the code in the custom routine in the pricing procedure for VA00. According to this if I exclude

We use this FM to pull the VC Config of the material and then we just see if the finish is in our Z table and we exclude it.

CALL FUNCTION 'VC_I_GET_CONFIGURATION_IBASE'

       EXPORTING

         instance      = komp-cuobj

         language      = sy-langu

       TABLES

         configuration = tkomcon

       EXCEPTIONS

         OTHERS        = 4.

     IF tkomcon[] IS NOT INITIAL.

       CLEAR retcd_f. " Var to check if we should charge for any other Finish.

       LOOP AT tkomcon WHERE atnam = 'FINISH_1' OR

                             atnam = 'FINISH_2' OR

                             atnam = 'FINISH_3' OR

                             atnam = 'FINISH_4' OR

                             atnam = 'FINISH_5' OR

                             atnam = 'FINISH_6'.


*       Do not proceed further if the customer is in exception.

         READ TABLE it_zvc_soldto_fin INTO wa_zvc_soldto_fin WITH KEY soldto = komk-kunnr

                                                              material_group = komp-matkl

                                                              finish_code = wa_finish-zfcod. "@JKL042516

         IF sy-subrc = 0.

           retcd = 4. " AVOID METAL

         ENDIF.


CHECK RETCD = 0.

juliusku
Participant
0 Kudos

Thank you everyone!

I just made it buy replacing the requirement routine with a calculation routine and now I can exclude any entry from the matching condition.

Answers (1)

Answers (1)

juliusku
Participant
0 Kudos

I was thinking of separating records in different condition types such as VA02, VA03, VA04...So it wont exclude everything... but I noticed that there are tons of finish codes.