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: 

Fields which separate from the item and header level in va02

former_member214915
Participant
0 Kudos

Hi,

      Can anybody know that which field from KOMV is used for differentiating the condition types which are applied on header level and on item level.

Regards,

Shahezad

17 REPLIES 17

Sijin_Chandran
Active Contributor
0 Kudos

Hi Shahezad ,

I Guess you requirement resembles with the below thread .

Please check it out :

http://scn.sap.com/thread/3265070

0 Kudos

Hi,

Thanks, but

                  The business requirement is that suppose if i delete the one condition say "JCEP" which is for discount from one material so i need that the sum which is calculated at header level has to be affected means that the sum has to be decrease by that JCEP Condition Value.

0 Kudos

Hello Shahezad ,

Are you designing a pricing procedure ?

If yes then its Functional issue and should discussed with the concerned.

If its for reporting or any other developments then automatically changes are made to Document's pricing aspects whenever a change is made with the pricing procedure.

0 Kudos

Hello Sijin

                 I am not designing pricing procedure i have did coding in

       Program name : SAPMV45A

       Include name :  MV45AFZZ

       Implicit Enhancement : USEREXIT_PRICING_PREPARE_TKOMP.

             that my code get executed the thing is that i am deleting one condition from one material or at item level say "JASS" so i want its condition value which is calculated at header level needs to be deleted say condition value on 'JASS' at item level is 200,00 if i delete it so this value would have to be deleted or decreased from header level of 'JASS' condition.

0 Kudos

Hi Shahezad ,

If a condition type (say JASS ) is maintained as deletable then whenever its value will be deleted from Line item level then automatically its changes will reflect at header level , as far as I know.

0 Kudos

Hi Sijin,

           Thanks but would you know where is this maintained as deletable so that i can check it out

Regards ,

Shahezad

0 Kudos

Hello Shahezad ,

Tcode : V/06.

Give ur condition type : Say JASS.

And see the Properties as shown in below example screen shot.

0 Kudos

Hi Sijin,

            yes i did this ,actually the thing is i am setting or putting condition at header level ,that condition is going to be copied at all item level ,so if suppose say i have applied condition "JASS"

at header level and set its value or amount 200 and added new material or item so header value is coming or in item and again calculation goes on so the sum of item values is coming at header level

so the value of condition 'JASS' becomes 400 and suppose if i delete that condtion from item forcefully because manually we can not do it so i am deleting it by code but its value is not decrementing from header level.

Regards,

Shahezad

0 Kudos

Hello Shahezad ,

As per your statement

 if i delete that condtion from item forcefully because manually we can not do it so i am deleting it by code but its value is not decrementing 

How you are deleting forcefully ?

Are you altering table data ?

If yes , then its not recommended and it will definitely lead to such discrepancies.

0 Kudos

hi Sijin,

In Sales Document

We have Header Condition and Item Condition

In Configuration V/06 we have header and Item checked.

When Header Condition is applied it applies to all the item condition to all material,

but there are few materials where header condition should not be applied to item condition.

We have achived this by using USER_EXIT 'USEREXIT_PRICING_PREPARE_TKOMP'

Where we are deleting item condition which is in xkomv internal table, this is reflecting in Screen as well.

But condition value is not getting changed in header condition

Example

At Header Level

JASS :  200

JASS Needed at Item1 but not in Item 2

At Item Level

Item 1

JASS: 100

Item 2

JASS: 100

After execution of our user exit

Item1

JASS: 100

Item2

JASS is Deleted

So in Header Condition JASS should be : 100 instead of 200 which is not happening.

Please Suggest.

0 Kudos

Hi Shahezad ,

Instead of altering xkomv using UserExit MV45AFZZ depending on your particular condition (i.e for Particular Materials) probably there can be a solution using SPRO.

i.e by doing related changes in Pricing Technique.

Condition records , Condition schema , Condition exclusion bla bla

So better try with a Functional Solution or post a thread in SAP SD forum or consult with your Function Consultant.

And after that only try with MV45AFZZ.

0 Kudos

Hi all,

If we put condition on Header Its applies on all item,with the help of MV45AFZZ  and some tables we exclude this condition in some service materials,its deleted only item level but calculating on header,we want to system should delete in item level and calculate  as per items level ,i think not possible to change the pricing procedure for some service materials because this condition is using on all material and  its standers condition

Please Suggest.

Regards,

Uzair

SD CONSULTANT

0 Kudos

Hi Sijin,

          and i had posted this on SD Forum   i again got that problem now i tried for to solve this with routine but didnt got anything

actually the problem is

I have a requirement to distribute the header pricing condition to specific line item or we can say particular set of material this line item  has different item category.

Example :  Order has 4 line items it has  line 10 and 20 and  30 and 40 , than Order header condition 2 percent should be disctributed to line 30 and 40 only.

and in at item 10 and 20 i want this 2 percent condition to be deleted.

Regards,

Shahezad

0 Kudos

Hi Shahezad ,

Kindly paste the routine(VOFM) code .

0 Kudos

Hi,

      Here i am pasting that code but it wont work properly

      i have created this routine in vofm --> formula--> condition value --> 600

DATA :  wa_tkomv like line of tkomv,

            wa_xkomv LIKE LINE OF xkomv.

   IF komp-matnr = 'YA01'.

       Clear : wa_tkomv,wa_xkomv.

       LOOP AT xkomv INTO wa_xkomv.

         IF ( wa_xkomv-kschl = 'JASS'

              OR wa_xkomv-kschl = 'JCEQ'

              OR wa_xkomv-kschl = 'JCEP'

               ).

         IF ( wa_xkomv-kherk = 'D' AND WA_XKOMV-KPOSN = KOMP-KPOSN ).

            READ TABLE tkomv INTO wa_tkomv WITH KEY kherk = 'D' kposn = komp-kposn kschl = wa_xkomv-kschl.

              DELETE TABLE xkomv FROM wa_xkomv.

              delete table tkomv from wa_tkomv.

          ENDIF.

       ENDIF.

     ENDLOOP.

   ENDIF.

IF komp-matnr = 'M1'.

       Clear : wa_tkomv,wa_xkomv.

       LOOP AT xkomv INTO wa_xkomv.

         IF ( wa_xkomv-kschl = 'JASS'

              OR wa_xkomv-kschl = 'JCEQ'

              OR wa_xkomv-kschl = 'JCEP'

              OR wa_xkomv-kschl = 'JEAT'

               ).

         IF ( wa_xkomv-kherk = 'D' AND WA_XKOMV-KPOSN = KOMP-KPOSN ).

            READ TABLE tkomv INTO wa_tkomv WITH KEY kherk = 'D' kposn = komp-kposn kschl = wa_xkomv-kschl.

            DELETE TABLE xkomv FROM wa_xkomv.

            delete table tkomv from wa_tkomv.

         ENDIF.

         ENDIF.

     ENDLOOP.

   ENDIF.

IF komp-matnr = '000000000000000051'.

       Clear : wa_tkomv,wa_xkomv.

       LOOP AT xkomv INTO wa_xkomv.

         IF ( wa_xkomv-kschl = 'JASS'

              OR wa_xkomv-kschl = 'JCEQ'

              OR wa_xkomv-kschl = 'JCEP'

              OR wa_xkomv-kschl = 'JEAT'

              OR wa_xkomv-kschl = 'JEAQ'

               ).

         IF ( wa_xkomv-kherk = 'D' AND WA_XKOMV-KPOSN = KOMP-KPOSN ).

            READ TABLE tkomv INTO wa_tkomv WITH KEY kherk = 'D' kposn = komp-kposn kschl = wa_xkomv-kschl.

            DELETE TABLE xkomv FROM wa_xkomv.

            delete table tkomv from wa_tkomv.

         ENDIF.

         ENDIF.

     ENDLOOP.

   ENDIF.

0 Kudos

Is it triggering at VF01 ?

or

Are you finding error in the logic you have written ?

0 Kudos

   It is triggering in VA02 where i want but it would deleting conditions from item but values of that conditions are coming as some at header level as i am deleting these condtion i dont want there values to be aaded at header level.