Skip to Content
author's profile photo Former Member
Former Member

SD: Pricing Routine

Hi all,

I have three condition types, ZCIF, ZFRE, ZFBP. My aim is to bring ZFBP = ZCIF - ZFRE.

I have written a routine with the help of my SD consultant. My logic is working fine in VA01, VF01, VF02. The problem i'm facing is when the user changes the value in VF01 and save again, it is not updating the pricing with the new value.

But the if the user changes new values in VA01 and VF02 and save, then it is working.

Please help me in this. Usefull answers will be surely rewarded.

The code i used inside the routine is as follows. (Routine is attached in ZFBP in pricing, (V/08))

READ TABLE lit_xkomv INTO lfl_xkomv1
                           WITH KEY kschl = ZCIF.

      IF sy-subrc EQ 0.

        READ TABLE lit_xkomv INTO lfl_xkomv2
                           WITH KEY kschl = 'ZFRE'.

        IF sy-subrc EQ 0.

          lfl_xkomv-kwert = lfl_xkomv1-kwert - lfl_xkomv2-kwert.
          lfl_xkomv-kbetr = lfl_xkomv1-kbetr - lfl_xkomv2-kbetr.


          xkomv-kwert = lfl_xkomv-kwert.
          xkomv-kbetr = lfl_xkomv-kbetr.
          xkwert      = lfl_xkomv-kwert.



        ELSE.


          xkomv-kwert = lfl_xkomv1-kwert.
          xkomv-kbetr = lfl_xkomv1-kbetr.
          xkwert      = lfl_xkomv1-kwert.

        ENDIF.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 01:32 PM

    Hi

    I think the problem is with Copy control here.

    Goto VTFA (if you are creating billing document from Sales order directly) there select your combination of sales order and billing document. On Left hand side click one "item" and there change "Pricing type" to 'B'.

    Hope this will work. Try it and revert.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 01:46 PM

    If you have not already used Subtotal WORKD and XWORKE, or Calculation Type 12

    You could also just utilize these to get your result, and save the ABAP code completely

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.