Application Development and Automation 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: 
Read only

SD Routine causing problem

former_member214709
Participant
0 Likes
1,591

Hi Gurus,

I have created a Routine in VOFM for Condition base value.

The scenario is, whenever the condition type ZW03 has 100% rate, in that case the Net value i.e KOMP-NETWR should become 0.01 and not 0.00(which it is doing currently  ).

I wrote a code for this and it is working perfectly fine in case of sales order creation VA01 as well as when we save the document.

But once we run VA02 and make any changes, again the value returns to 0.00 and not 0.01.

Kindly Help me as this is a very weird problem.

Regards,

Dinesh

10 REPLIES 10
Read only

Sijin_Chandran
Active Contributor
0 Likes
1,508

HI Dinesh ,

Write your code restricted to Tcode VA01 only,

Use IF SY-TCODE = VA01.

        ENDIF.

Read only

0 Likes
1,508

Hi Sijin,

It is working fine for VA01 as well as when we see the same in VA02, but once we make any change it returns to the same value of 0.00.

Regards,

Dinesh

Read only

Former Member
0 Likes
1,508

Hi Dinesh,

can you provide the code ? KOMP-NETWR is CURR 15.2.

Did you define the 0.01 as ...

CONSTANTS: c_netwr TYPE KOMP-NETWR VALUE '0.01'.

If you debug VA02 save, what shows debugger in your code ?

Matthias

Read only

0 Likes
1,508

Hi Matthias,

The following code was written by me:

  IF KOMP-PSTYV EQ 'TAN' AND KOMV-KSCHL EQ 'ZW03' AND KOMV-KBETR EQ '1000.00'.

  XKWERT = KOMP-NETWR - '0.01'.

  LOOP AT TKOMV WHERE KSCHL EQ 'ZW03'.

    TKOMV-KWERT = KOMP-NETWR - '0.01'.

    MODIFY TKOMV  TRANSPORTING KWERT.

  ENDLOOP.

ELSE.

XKWERT = KOMP-NETWR.

ENDIF.

Regards,

Dinesh

Read only

0 Likes
1,508

Dinesh -

Are you able to debug this problem? IN VA02, if you keep a break point in your code, is it stopping there? I think once you do some changes it is not refreshing the pricing condition. Once you complete all your changes, there is a button at the bottom to refresh the pricing. Try that button and see what happens.

Kuntal

Read only

0 Likes
1,508

Hi Kuntal,

Yes, it is stopping there but as soon as we make changes via VA02 (any change in date, qty, billing block) again the value returns to 0.00, for which the routine was applied to make it 0.01.

I have noticed that as soon as the sales order is saved the tables also get updated with the required value i.e 0.01 but still in the change mode it is causing problem.

Regards,

Dinesh

Read only

former_member376453
Contributor
0 Likes
1,508

Dinesh -

As I have said, probably all your pricing condition are not getting refreshed. So either you can check that button I have told in my last post or you can follow below menu path after your changes to refresh the value "EDIT -> NEW Pricing document". I think this should again refresh the values.

Read only

0 Likes
1,508

Kuntal

The condition type which  i have added is a Manual Entry and as soon as we carry out New Pricing the value for condition type ZW03 gets erased.

Read only

0 Likes
1,508

Gurus,

Kindly assist me with this.

Read only

0 Likes
1,508

Dinesh,

Everytime we make a change VA02 entire pricing fucntionality will be triggered.So,if I understand your issue correctly may be you need to include REPRICING functionality in your routine or just check if any of the user exits in MV45AFZ* is having any repricing functionality which is getting triggered and resulting inconsistent results.

K.Kiran.