Pricing Procedure calculation for Net value

Hi Gurus,
I have  issue with pricing procedure for net price.
My pricing procedure is as follows.
Step    Cond.type       from    to      Subtotal        req.type        cal.type        Basetype
10      CPLF    0       0               0       0       0
20      CA              0       0               0       0       0
30      CPY             0       0               0       0       0
40      CWE             0       0               0       0       0
50      CPY1    30      40              0                           601 0
60      PCP             0       0               0       0       0
70      NCC            50       60              0       0       0       0
80      Subtotal 1      70                      1
90      VC              0       0               0       0       0
110     FPA             0       0               0                          600  0
150     INCR    0       0               0       0       0
160     BINC    0       0               0       0       0
170     PINC            0       0               0       0       0
180     CINC            0       0               0                           602 0
190     PRIN    0       0               0       0       0
200     FINC
210     Subtotal 2      200                    2        0       0
220     ADT             0       0               0       0       0
230     FTAX    0       0       0                                           603 0
240     Subtotal 3      210                     3       0       0
My query is when i am doing pricing for line items
1) For line item 1 net value of the item will be subtotal 1
2) For line item 2 Net value should be through condition type calculation.
3) For line item 3 net value should be through calculation of routine
4) For line item 4 net value should be Subtotal 2
5) For line item 5 net value should be Subtotal 3
So please tell me who to do?
regards
Srinivas

Hi,
Can you please explain what type of pricing you want to for your sales order.
I am confused with your line items.
Can you explain what kind lines item you are entering in your sales order.
Are they proper material for which you have maintained condition record in MM01.
Because for all the line item system will calculate price by the pricing procedure which you have shown.
So in short system will calculate different price for different line item.
After calculating the whole price it will make the total of net amount of all the line item.
And that net amount will be shown in the header data of the sales order.
Regards
Raj.

Similar Messages

  • Pricing procedure using AltCaltype & Altbase value

    How to create Pricing procedure using AltCaltype & Altbase value.Can any one provide an example for it

    Hi Pradeep,
    There are very basic questions in pricing. You can search the forum and you will definitely get lot of answers for this.
    However, Alt calculation type and AltCnBV are the ABAP routines assigned in the pricing procedure. There are lot os standard routines given by SAP and if in case they do not meet your business requirement, then you can create one and assign in the pricing procedure to meet the busines requirement.
    Examples:
    Alt Calculation Type: This defines how the value for a condition type is to be calculated. Suppose, net price =qty*unit price
    Alternative formula for condition base value : Suppose you have a freight charge of $100 to be distributed on 3 different line items proportionately based on the individual weights in the sales order, you can define the routine and assign it in this field in the procing procedure
    Regards,
    Raghav

  • PRICING PROCEDURE-CALCULATION SCHEMA

    Dear All,
    There are some queries regarding pricing procedure calculation schema.Please help me out:
    1) What is the use of the "Requirement" column in calculation schema in real time scenario?
    2) What is meant by "Alternative calculation type" and "Alternative base value" column?What is its use in real time scenario?
    3) In the Print column if we place "X",it says "Printing at item level (previous procedure)".What does this actually means?
    4) What is the use of "Accurals" and what effect does it have in the pricing procedure and pricing calculation?
    For all the above queries  some real time scenario example willbe highly appreciable.
    Regards,
    Indranil

    1) What is the use of the "Requirement" column in calculation schema in real time scenario?
    Requirement
    Use
        If the requirement is fulfilled (SY-SUBRC = 0), then output
        determination also takes into consideration output type or the access
        sequence, for which the requirement has been specified.
    Examples
        A possible requirement would be, for example, that a difference shoul
        be made between document currency and local currency .
    Definition
         Number of a subroutine (= form routine), that checks a requirement at a
         specific time.
    Use
         The standard SAP system contains some standard routines for checking
         requirements when copying. You can also define your own routines
         according to the needs of your company.
    Example
         If you copy a quotation to a sales order, the system can check every
         quotation item to ensure that the customer had not rejected them for any
         reason.
    2) What is meant by "Alternative calculation type" and "Alternative base value" column?What is its use in real time scenario?
    If you are using any Formula to Derive the Condition Type then you can use  Alternative formula to the formula in the standard system that
    determines a condition.
    Alternative formula for condition base value
         Formula for determining the condition basis as an alternative to t
         standard.
    Example
         An absolute header discount is, for example, distributed in the st
         system according to the cumulative value of the items.
         If the system, however, distributes the absolute header discount
         according to volume, a header discount of $30 results in the follo
         discounts:
         Item       Value  Volume              Discount
                                      Stand. disc.   Volume disc.
           1        $1000  2 cbm         $20             $10
           2        $500   4 cbm         $10             $20
    3) In the Print column if we place "X",it says "Printing at item level (previous procedure)".What does this actually means?
    If you Put 'X" , it will be shown in the Print Output..
    Print ID for condition lines
         Controls issue of condition lines when printing documents such as order
         confirmations or invoices.
    Use
         In releases previous to 4.0, the following print indicators are
         available :
         o   ' ' : Condition line is not printed
         o   'X' : Condition line is printed at item level
         o   'S' : Condition line is printed in totals block
         The following standard logic is set out for these printing indicators:

  • Pricing procedure determination for complaint document with reference to billing

    Hello Guys,
    I am configuring complaint process for project purpose and I got stuck. I need to change the pricing procedure which is determined for complaint
    document . Right now the pricing procedure is copied from Billing Document for which complaint refers to.
    I am searching a place in configuration where I could change the pricing procedure determination for complaint document with reference to billing doc.
    Could you please advise where I can find it ?
    Thank you in advance!
    Br,
    Frederic

    Hello Frederic,
    I would check the following in SPRO:
    - CRM
    - Basic Functions
    - Pricing
    - Pricing in the Business Transaction
    - Determine Pricing Procedures
    Here the pricing procedure depends on sales organization, division, distribution channel, document pricing procedure and and customer pricing procdure.
    Best regards,
    Thomas Wagner

  • Agent's Commission calculation in pricing procedure only for NEW Saleorders

    Hi Guys,
    In a pricing procedure, .the base for agent commission was calculated on cost + markup price and freight and this base for commision + commision + insurance gave the base price.But now client wants to calculate commision from cost + mark up + freight + insurance + packing charges
    So, the steps are changed in pricing and it is working perfectly. While checking the billing documents and open orders, it is showing new pricing procdure.
    The pricing procedure should take its effect from now only and not for old billing documents I mean the open orders, open deliveries and open items.
    I understand that in open sales orders, if update button is pressed on condition tab and carry out new pricing only changes will occur. Otherwise it will NOT happen
    If I goto VF02 and take a billing documen, it is having the new pricing procedure
    I didnot maintain new condition types. Only the steps were changed.
    Please help me in this regard by suggesting a suitable solution.
    Regards,
    Anbu

    Thanks a lot for your suggestion. i had already made the changes in the existing procedure and given them.... then only we realized the problem....they created around 15 billing documents that day and all showed the changed pricing procedure( these were open orders). but my client doesn't want to revert back to the old procedure and as a solution to the change in value for the newly billed documents they have issued the debit note.... now everything is ok( except  that the changed procedure is seen in the old documents too. but the values haven't changed) so client is happy this way...  hope there wont be any issue regarding this in future...
    Thanks a lot for your advice....

  • Problem in pricing procedure calculation

    Hi,
    I configure pricing procedure and it works in the regular sales order are 1100/20/20 correctly and shows the correct calculation but in the third party sales order, I use the same pricing procedure in the sales area 1100/50/20 and the system shows the net value but it does not calculate total price and total price is zero.
    So I want to know that sales area and item category has relation with pricing procedure or not?
    and How I can fix it?
    thaks,

    Hi,
    There is no direct link between Sales area and item category.
    You must be knowing that pricing proc. is determined by Sales Area + Cust. pricing proc + Doc. pricing proc.
    So, kindly check in OVKK if the correct pricing proc. is maintained or not.
    Then, check in VK12 / VK13 for your condition type if you have entered correct organizational elements like sales org / distribution channel
    Kindly check this and post your feedback
    regards,
    Sagar

  • Pricing - Requirment / calculation type / base value

    Dear Friends,
    Thnaks for the support and guidance provided by you for my previous posts
    In Pricing Procedure we give Requirment, Calculation type and Alternative formula for condition base value, I would like to know where do we exctly define all this?
    Or are they standard? If standards where we can see how they works?
    Regards
    Vishal

    Hi,
    go through the below Examples for better understanding ..
    Example: 1
    Condition Type: PR00
    Requirement 2 Item with Pricing
    Purpose:
    This is an example of a pricing requirement.  This requirement is met if the document item category is relevant for pricing and no previous condition in the pricing procedure has set the condition exclusion flag. This requirement can be assigned to condition types in the pricing procedure to avoid unnecessary accesses to the database when an item is not relevant for pricing or a condition exclusion indicator has been set.
    Example: 2
    Condition Type:  Net value
    Calculation Type: 2 Net value
    Purpose:
    This is an example of a condition value formula.  This type of formula can be used to influence the value shown for the condition in pricing.  A condition value formula is assigned to a condition type or value line in the pricing procedure.
    Formula '2' sets the value equal to net value that has been calculated so far for the item in the pricing procedure.  It contains the amount excluding taxes.
    Example: 3
    Condition Type: R100
        Alt.Condition Base Value: 28 (100% Discount)
    Purpose:
    This is an example of a condition base value formula.  A condition base value formula can be used to influence the basis the system uses when computing a pricing value.  A condition base formula is assigned to a condition type in the pricing procedure.
    Formula '28' sets the rate of the condition to a 100% discount.  This formula was delivered with condition type R100 to support free goods functionality.
    Reward if it is useful,
    Chandramohan

  • Pricing procedure  change the condition value

    Hi,
    My pricing procedure determines the Tax in %basis.Now i have a rewuirement wherein i should be able to enter the amount in AMOUNT COLOUMN in condition tab. This value should be the condition Value for the condition type.
    Now my pricing procedure doesnt allow me to make any changes and the condition type is greyed out. how can i calulate the tax in amount instead of % and be able to enter the value manually?
    Thanks,
    Challa

    Hi Challa,
    Price can be maintained either on percentage basis or on amount basis.
    So you have to make changes in condition type to convert it from percentage to amount.
    Go to IMG u2013 sales and distribution u2013 master data u2013 basic function u2013 pricing u2013 pricing control u2013 define condition type.
    Select maintain condition type from the options.
    Now select your condition type and click on detail.
    Change the calculation type from A (percentage) to B (Fixed amount) and save it.
    Now go to VK11 and maintain the new condition record for that condition type.
    Now create the sales order and go to condition tab and check out the pricing it will be amount.
    Please do this method if you find any difficulty then tell us.
    Regards
    Raj.

  • Function module to pricing procedure calculation

    hi,
    I want to know whether any function modules available to get as I see in  Invoice ->
    select item level conditions.
    Where i can see the basic price ,discount, etc as defined in the corresponding pricing procedure.
    i have tried with
    RV_INVOICE_PRICE_PBO
    PRICING_SUBSCREEN_SET_DATA
    here i get only the records which have condition type,
    similarly for P.O. we have
    ME_SWP_SIC_GET_PRICING_INFO
    regards,
    Prabhu
    Points assured.

    REPORT  zmm_pvr.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                     TYPE-POOLS                                          *
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    TYPE-POOLS slis.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                       TABLES                                            *
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    TABLES: mara,                         " General Material Data
            marc,                         " Plant Data for Material
            ekko,                         " Purchasing Document Header
            ekpo,                         " Purchasing Document Item
            lfa1,                         " Vendor Master (General Section)
            konv,                         " Conditions (Transaction Data)
            mbew,                         " Material Valuation
            makt.                         " Material Descriptions
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                    DATA DECLARATION                                     *
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    DATA: BEGIN OF i_mat OCCURS 1,
            matnr LIKE mara-matnr,
            mtart LIKE mara-mtart,
            werks LIKE marc-werks,
            abcin LIKE marc-abcin,
          END OF i_mat.
    DATA: BEGIN OF itab OCCURS 1,
            ebeln LIKE ekko-ebeln,
            bedat LIKE ekko-bedat,
            lifnr LIKE ekko-lifnr,
            waers LIKE ekko-waers,
            bukrs LIKE ekko-bukrs,
            ekorg LIKE ekko-ekorg,
            name1 LIKE lfa1-name1,
            werks LIKE ekpo-werks,
            menge LIKE ekpo-menge,
            meins LIKE ekpo-meins,
            netpr LIKE ekpo-netpr,
            netwr LIKE ekpo-netwr,
            menge1(16),
            netpr1(16),
            menge2  TYPE string,
            netpr2 TYPE string,
            lrate TYPE p DECIMALS 2,
            stax LIKE ekpo-netwr,
            exbed LIKE ekpo-netwr,
            dcost LIKE konv-kwert,
            nomvl LIKE ekpo-netwr,
            nomrt LIKE ekpo-netwr,
            zplp1 LIKE mbew-zplp1,
            verpr LIKE mbew-verpr,
            bgval LIKE ekpo-netwr,
            varnc LIKE ekpo-netwr,
            maktx LIKE makt-maktx,
            knumv LIKE ekko-knumv,
            ebelp LIKE ekpo-ebelp,
            matnr LIKE ekpo-matnr,
            matkl LIKE ekpo-matkl,
            mtart LIKE ekpo-mtart,
            bprme LIKE ekpo-bprme,
            txz01 LIKE ekpo-txz01,
            mwskz LIKE ekpo-mwskz,
            prdat LIKE ekpo-prdat,
          END OF itab.
    DATA: wtab LIKE itab.
    DATA: v_steuc TYPE marc-steuc.
    DATA: v_brsch TYPE lfa1-brsch.
    DATA: wa_komk TYPE komk.
    DATA: wa_komp TYPE komp.
    DATA: it_komv TYPE TABLE OF komv.
    DATA: wa_komv TYPE komv.
    DATA : wa_fieldcat TYPE  slis_fieldcat_alv,
           gt_fieldcat TYPE  slis_t_fieldcat_alv,
           wa_layout   TYPE  slis_layout_alv,
           lt_sort     TYPE  slis_t_sortinfo_alv,
           i LIKE sy-tabix.
    DATA: gt_events     TYPE slis_t_event.
    DATA: gd_prntparams TYPE slis_print_alv.
    DATA: it_color TYPE   slis_t_specialcol_alv.
    DATA: wa_color TYPE   slis_specialcol_alv.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                          Begin Of Selection Screen                      *
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    SELECTION-SCREEN BEGIN OF BLOCK pas WITH FRAME TITLE text-001.
    SELECT-OPTIONS s_matnr FOR  ekpo-matnr.
    SELECT-OPTIONS s_werks FOR  ekpo-werks.
    SELECT-OPTIONS s_bedat FOR  ekko-bedat.
    PARAMETERS     p_abcin LIKE marc-abcin OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK pas.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                           INITIALIZATION                                *
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    INITIALIZATION.
      IF sy-datum+4(2) GE 4.
        s_bedat-low+6(2) = 01.
        s_bedat-low+4(2) = 04.
        s_bedat-low(4) = sy-datum(4).
      ENDIF.
      IF sy-datum+4(2) LT 4.
        s_bedat-low+6(2) = 01.
        s_bedat-low+4(2) = 04.
        s_bedat-low(4) = sy-datum(4) - 1.
      ENDIF.
      s_bedat-high   = sy-datum.
      APPEND s_bedat.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                        AT Selection Screen Output                       *
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    AT SELECTION-SCREEN.
    Check for Material Type
      SELECT amatnr amtart bwerks babcin INTO CORRESPONDING FIELDS OF TABLE i_mat
      FROM mara AS a INNER JOIN marc AS b
           ON amatnr = bmatnr
      WHERE a~matnr IN s_matnr
        AND ( amtart = 'IRAM' OR amtart = 'IPAM' OR amtart = 'PRAM' OR amtart = 'PPAM' )
        AND b~werks IN s_werks
        AND b~abcin = p_abcin.
      SORT i_mat BY matnr werks.
      CHECK NOT i_mat[] IS INITIAL.
      READ TABLE i_mat INDEX 1.
      IF sy-subrc <> 0.
        MESSAGE e006(zmm).
        LEAVE LIST-PROCESSING.
      ENDIF.
    Check for Date
      IF ( s_bedat-low IS INITIAL AND s_bedat-high IS INITIAL ).
        s_bedat-sign   = 'I'.
        s_bedat-option = 'BT'.
        IF sy-datum+4(2) GE 4.
          s_bedat-low+6(2) = 01.
          s_bedat-low+4(2) = 04.
          s_bedat-low(4) = sy-datum(4).
        ENDIF.
        IF sy-datum+4(2) LT 4.
          s_bedat-low+6(2) = 01.
          s_bedat-low+4(2) = 04.
          s_bedat-low(4) = sy-datum(4) - 1.
        ENDIF.
        s_bedat-high   = sy-datum.
      ELSEIF ( s_bedat-low IS NOT INITIAL AND s_bedat-high IS INITIAL ).
        s_bedat-low6(2) = s_bedat-low6(2).
        s_bedat-low4(2) = s_bedat-low4(2).
        s_bedat-low(4)   = s_bedat-low(4).
      ELSEIF ( s_bedat-low IS NOT INITIAL AND s_bedat-high IS NOT INITIAL ).
        s_bedat-sign   = 'I'.
        s_bedat-option = 'BT'.
        s_bedat-low6(2) = s_bedat-low6(2).
        s_bedat-low4(2) = s_bedat-low4(2).
        s_bedat-low(4)   = s_bedat-low(4).
        s_bedat-high6(2) = s_bedat-high6(2).
        s_bedat-high4(2) = s_bedat-high4(2).
        s_bedat-high(4)   = s_bedat-high(4).
      ENDIF.
      APPEND s_bedat.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                            START OF SELECTION                           *
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    START-OF-SELECTION.
    *----- Get all PO for given selection criteria.
    LOOP AT i_mat.
      SELECT
        aebeln abedat alifnr aknumv awaers abukrs a~ekorg
        bebelp bmatnr bmatkl bnetpr bbprme btxz01 bwerks bmenge bmeins bnetwr bmtart bmwskz b~prdat
      FROM ( ekko AS a INNER JOIN ekpo AS b ON  amandt = bmandt AND aebeln = bebeln )
      INTO CORRESPONDING FIELDS OF TABLE itab
      FOR ALL ENTRIES IN i_mat
      WHERE a~bedat IN s_bedat
       AND  a~loekz = ''
       AND  b~matnr = i_mat-matnr
       AND  b~werks = i_mat-werks
       AND  b~loekz = ''
       AND  b~pstyp = '0'
       AND  b~bstyp = 'F'
       AND  b~knttp = ''.
    ENDLOOP.            " END OF i_mat
      CHECK NOT itab[] IS INITIAL.
      SORT itab BY ebeln ebelp.
    *----- Calculating The DCOST -- Delivery Cost
      DATA: BEGIN OF i_konv OCCURS 0,
             knumv LIKE konv-knumv,
             kposn LIKE konv-kposn,
             stunr LIKE konv-stunr,
             zaehk LIKE konv-zaehk,
             kschl LIKE konv-kschl,
             kbetr LIKE konv-kbetr,
             kwert LIKE konv-kwert,
           END OF i_konv.
      SELECT knumv kposn stunr zaehk kschl kbetr kwert
      FROM konv
      INTO CORRESPONDING FIELDS OF TABLE i_konv
      FOR ALL ENTRIES IN itab
      WHERE knumv = itab-knumv
       AND kposn = itab-ebelp
        AND ( kschl   = 'ZFC3' OR kschl   = 'ZQIQ'
           OR kschl   = 'ZQIV' OR kschl   = 'ZFA3'
           OR kschl   = 'ZFB3' OR kschl   = 'ZPF2'
           OR kschl   = 'ZPQ2' OR kschl   = 'ZPV2'
           OR kschl   = 'ZOCP' OR kschl   = 'ZOCQ'
           OR kschl   = 'ZOCV' OR kschl   = 'ZMT1'
           OR kschl   = 'ZIN2' OR kschl   = 'ZIQ2'
           OR kschl   = 'ZIV2' OR kschl   = 'ZBK1'
           OR kschl   = 'ZBKQ' OR kschl   = 'ZBKV' ).
      SORT i_konv BY knumv kposn stunr zaehk kschl .
      DELETE ADJACENT DUPLICATES FROM i_konv.
      DELETE i_konv WHERE kbetr = 0.
      DATA: BEGIN OF i_knumv OCCURS 0,
              knumv LIKE konv-knumv,
              kwert LIKE konv-kwert,
            END OF i_knumv.
      LOOP AT i_konv.
        MOVE i_konv-knumv TO i_knumv-knumv.
        MOVE i_konv-kwert TO i_knumv-kwert.
        COLLECT i_knumv.
      ENDLOOP.
      CLEAR i_konv.
      CLEAR i_knumv.
      LOOP AT itab INTO wtab.
        READ TABLE i_knumv WITH KEY knumv = wtab-knumv.
        IF sy-subrc = 0.
          wtab-dcost = i_knumv-kwert.
          MODIFY itab FROM wtab.
        ENDIF.
      ENDLOOP.
      CLEAR i_knumv.
      CLEAR itab.
    *----- Get the vendor name.
      LOOP AT itab.
        SELECT SINGLE name1 FROM lfa1 INTO itab-name1
                                        WHERE lifnr = itab-lifnr.
        MODIFY itab INDEX sy-tabix TRANSPORTING name1.
      ENDLOOP.
    *----- Calculate Excise Duty, Educat. cess, Sec edu. cess, sales tax
      CLEAR: wa_komk, wa_komp.
    Selecting The Value Of STEUC (Controlling Code)
      CLEAR itab.
      LOOP AT itab.
        SELECT SINGLE steuc
          FROM marc
          INTO v_steuc
         WHERE matnr = itab-matnr
           AND werks = itab-werks.
    Selecting The Value Of BRSCH (Industry key)
        SELECT SINGLE brsch
          FROM lfa1
          INTO v_brsch
         WHERE lifnr = itab-lifnr.
    Filling KOMK (Header Structure)
        wa_komk-kappl     = 'TX'.
        wa_komk-kalsm     = 'TAXINN'.
        wa_komk-lifnr     = itab-lifnr.
        wa_komk-waerk     = itab-waers.
        wa_komk-aland     = 'IN'.
        wa_komk-hwaer     = 'INR'.
        wa_komk-bukrs     = itab-bukrs.
        wa_komk-brsch     = v_brsch.
        wa_komk-prsdt     = itab-bedat.
        wa_komk-ekorg     = itab-ekorg.
        wa_komk-mwskz     = itab-mwskz.
    Filling KOMP (Details Structure)
        wa_komp-kposn     = itab-ebelp.
        wa_komp-matnr     = itab-matnr.
        wa_komp-werks     = itab-werks.
        wa_komp-matkl     = itab-matkl.
        wa_komp-meins     = itab-meins.
        wa_komp-vrkme     = itab-bprme.
        wa_komp-netwr     = itab-netwr.
        wa_komp-wrbtr     = itab-netwr.
        wa_komp-mwskz     = itab-mwskz.
        wa_komp-netpr     = itab-netpr.
        wa_komp-mtart     = itab-mtart.
        wa_komp-kursk_dat = itab-prdat.
        wa_komp-steuc     = v_steuc.
        wa_komp-mgame     = itab-menge.
        wa_komp-mglme     = itab-menge.
        FREE it_komv.
    Calling The Pricing Function To Get GR EXCISE, GR ECES, GR VAT/CST
        CALL FUNCTION 'PRICING'
          EXPORTING
            calculation_type = 'B'
            comm_head_i      = wa_komk
            comm_item_i      = wa_komp
          TABLES
            tkomv            = it_komv.
    Calculating The Excise --excise duty
        DATA: l_kbetr        TYPE komv-kbetr.
        DATA: l_gr_excise    TYPE ekpo-brtwr.
        DATA: l_basic_gr_val TYPE ekpo-netpr.
        l_basic_gr_val = itab-netwr.
        CLEAR: l_kbetr, l_gr_excise.
        LOOP AT it_komv INTO wa_komv WHERE kschl = 'JMOP'
                                        OR kschl = 'JAOP'
                                        OR kschl = 'JMIP'
                                        OR kschl = 'JAOQ'.
          l_kbetr     = ( wa_komv-kbetr / 10 ).
          l_gr_excise = ( l_kbetr * l_basic_gr_val ) / 100.
        ENDLOOP.
        LOOP AT it_komv INTO wa_komv WHERE kschl = 'JAIP'
                                        OR kschl = 'JAIQ'
                                        OR kschl = 'JMIQ'
                                        OR kschl = 'JMOQ'.
          l_gr_excise = ( wa_komv-kbetr * l_basic_gr_val ).
        ENDLOOP.
    Calculating The ECES -- Educational Cess
        DATA l_gr_eces      TYPE ekpo-netpr.
        CLEAR: l_kbetr, l_gr_eces.
        LOOP AT it_komv INTO wa_komv WHERE kschl = 'ZECE'
                                        OR kschl = 'ZECN'.
          l_kbetr     = ( wa_komv-kbetr / 10 ).
          l_gr_eces   = ( l_kbetr * l_gr_excise ) / 100.
        ENDLOOP.
    Calculating The SECES -- Sec. Educational Cess
        DATA l_gr_secs      TYPE ekpo-netpr.
        CLEAR: l_kbetr, l_gr_secs.
        LOOP AT it_komv INTO wa_komv WHERE kschl = 'JSEP'
                                        OR kschl = 'JSEI'.
          l_kbetr     = ( wa_komv-kbetr / 10 ).
          l_gr_secs   = ( l_kbetr * l_gr_excise ) / 100.
        ENDLOOP.
    Calculating The VAT/CST --Sales Tax
        DATA l_gr_vatcst    TYPE ekpo-netpr.
        CLEAR: l_kbetr, l_gr_vatcst.
        LOOP AT it_komv INTO wa_komv WHERE kschl = 'JVRN'
                                        OR kschl = 'JVRD'
                                        OR kschl = 'JVCS'
                                        OR kschl = 'JVCD'
                                        OR kschl = 'JVCN'
                                        OR kschl = 'JIPS'
                                        OR kschl = 'JIPC'
                                        OR kschl = 'JIPL'.
          l_kbetr     = ( wa_komv-kbetr / 10 ).
          l_gr_vatcst = ( ( l_basic_gr_val + l_gr_excise + l_gr_eces + l_gr_secs ) * l_kbetr ) / 100.
        ENDLOOP.
    Calculating The NOMVL & NOMVR -- NOM Value (Setoff / Inventory ) & NOM Rate
        DATA: l_netpr TYPE ekpo-netpr,
              l_menge TYPE ekpo-menge,
              l_dcost TYPE ekpo-netwr,
              l_nomvl TYPE ekpo-netwr,
              l_nomrt TYPE ekpo-netwr.
        l_netpr = itab-netpr.
        l_menge = itab-menge.
        l_dcost = itab-dcost.
        CLEAR: l_nomvl, l_nomrt.
        LOOP AT it_komv INTO wa_komv WHERE kschl = 'JMOP'                        "------setoff
                                        OR kschl = 'ZECE'
                                        OR kschl = 'JSEP'.
          l_nomvl = ( l_netpr * l_menge ) + l_gr_vatcst + l_dcost - ( l_gr_excise + l_gr_eces + l_gr_secs ).
          l_nomrt =  l_nomvl / l_menge.
        ENDLOOP.
        LOOP AT it_komv INTO wa_komv WHERE kschl = 'JMIP'                        "-------inventory
                                        OR kschl = 'ZECN'
                                        OR kschl = 'JSEI'.
          l_nomvl = ( l_netpr * l_menge ) + l_gr_vatcst + l_dcost.
          l_nomrt =  l_nomvl / l_menge.
        ENDLOOP.
        itab-exbed = l_gr_excise + l_gr_eces + l_gr_secs.
        itab-stax  = l_gr_vatcst.
        itab-nomvl = l_nomvl.
        itab-nomrt = l_nomrt.
        MODIFY itab .
        CLEAR itab.
      ENDLOOP.           " end of itab
      LOOP AT itab WHERE exbed = 0.
        itab-nomvl = ( itab-netpr * itab-menge ) + itab-stax + itab-dcost.
        itab-nomrt = itab-nomvl / itab-menge.
        MODIFY itab INDEX sy-tabix TRANSPORTING nomvl nomrt.
      ENDLOOP.
    *----- Calculating The Budget Rate, Moving Average Price, Landed Rate & Material Description
      DATA: verp(15).
      DATA: matdes(40).
      LOOP AT itab.
        SELECT SINGLE zplp1 FROM mbew INTO itab-zplp1
                                        WHERE matnr = itab-matnr AND bwkey = itab-werks.
        SELECT SINGLE verpr FROM mbew INTO itab-verpr
                                        WHERE matnr = itab-matnr AND bwkey = itab-werks.
        itab-lrate = itab-netwr / itab-menge.
        SELECT SINGLE maktx FROM makt INTO itab-maktx
                                        WHERE matnr = itab-matnr AND spras = 'EN'.
        MODIFY itab INDEX sy-tabix TRANSPORTING zplp1 verpr lrate maktx.
        verp = itab-verpr.
        matdes = itab-maktx.
      ENDLOOP.
    *----- Calculating The Budget Value & Variance
      LOOP AT itab.
        itab-bgval = itab-zplp1 * itab-menge.
        itab-varnc = itab-bgval - itab-nomvl.
        MODIFY itab INDEX sy-tabix TRANSPORTING bgval varnc.
      ENDLOOP.
    *------ Calculating Total of Quantity
      DATA: BEGIN OF i_quan OCCURS 1,
               quant LIKE ekpo-menge,
               unit LIKE ekpo-meins,
               nomvl LIKE ekpo-netwr,
               curr LIKE ekko-waers,
               varnc LIKE ekpo-netwr,
               bgval LIKE ekpo-netwr,
             END OF i_quan.
      LOOP AT itab.
        MOVE itab-menge TO i_quan-quant.
        MOVE itab-meins TO i_quan-unit.
        MOVE itab-nomvl TO i_quan-nomvl.
        MOVE itab-waers TO i_quan-curr.
        MOVE itab-varnc TO i_quan-varnc.
        MOVE itab-bgval TO i_quan-bgval.
        COLLECT i_quan.
      ENDLOOP.
      CLEAR itab.
      CLEAR i_quan.
      DATA: qty(15).
      DATA: unt(3).
      DATA: wtd TYPE p DECIMALS 2.
      DATA: wtd2(15).
      DATA: cur(3).
      DATA: var(15).
      DATA: nomvl(15).
      DATA: bgval(15).
      DATA: bgv TYPE p DECIMALS 2.
      DATA: bgv2(15).
      LOOP AT i_quan.
        qty = i_quan-quant.
        unt = i_quan-unit.
        cur = i_quan-curr.
        var = i_quan-varnc.
        bgval = i_quan-bgval.
        nomvl = i_quan-nomvl.
        wtd = nomvl / qty.
        bgv = bgval / qty.
      ENDLOOP.
      CLEAR i_quan.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                          DATA DISPLAY                                   *
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      wa_fieldcat-fieldname  = 'EBELN'.
      wa_fieldcat-seltext_l  = 'Purchase Order'.
      wa_fieldcat-tabname    = 'ITAB'.
      wa_fieldcat-row_pos    = 1.
      wa_fieldcat-col_pos    = 1.
      APPEND wa_fieldcat TO gt_fieldcat.
      wa_fieldcat-fieldname  = 'BEDAT'.
      wa_fieldcat-seltext_l  = 'PO Date'.
      wa_fieldcat-tabname    = 'ITAB'.
      wa_fieldcat-row_pos    = 1.
      wa_fieldcat-col_pos    = 2.
      APPEND wa_fieldcat TO gt_fieldcat.
      wa_fieldcat-fieldname  = 'NAME1'.
      wa_fieldcat-seltext_l  = 'Vendor Name'.
      wa_fieldcat-tabname    = 'ITAB'.
      wa_fieldcat-row_pos    = 1.
      wa_fieldcat-col_pos    = 3.
      APPEND wa_fieldcat TO gt_fieldcat.
      wa_fieldcat-fieldname  = 'WERKS'.
      wa_fieldcat-seltext_l  = 'Plant'.
      wa_fieldcat-tabname    = 'ITAB'.
      wa_fieldcat-row_pos    = 1.
      wa_fieldcat-col_pos    = 4.
      APPEND wa_fieldcat TO gt_fieldcat.
    wa_fieldcat-fieldname  = 'MENGE2'.
      wa_fieldcat-fieldname  = 'MENGE'.
      wa_fieldcat-seltext_l  = 'Quantity'.
      wa_fieldcat-tabname    = 'ITAB'.
      wa_fieldcat-row_pos    = 1.
      wa_fieldcat-col_pos    = 5.
      wa_fieldcat-do_sum     = 'X'.
      APPEND wa_fieldcat TO gt_fieldcat.
    wa_fieldcat-fieldname  = 'NETPR2'.
      wa_fieldcat-fieldname  = 'NETPR'.
      wa_fieldcat-seltext_l  = 'Basic Rate'.
      wa_fieldcat-tabname    = 'ITAB'.
      wa_fieldcat-row_pos    = 1.
      wa_fieldcat-col_pos    = 6.
      wa_fieldcat-do_sum     = ' '.
      APPEND wa_fieldcat TO gt_fieldcat.
    wa_fieldcat-fieldname  = 'EXBED'.
    wa_fieldcat-seltext_l  = 'Excise'.
    wa_fieldcat-tabname    = 'ITAB'.
    wa_fieldcat-row_pos    = 1.
    wa_fieldcat-col_pos    = 7.
    APPEND wa_fieldcat TO gt_fieldcat.
      wa_fieldcat-fieldname  = 'STAX'.
      wa_fieldcat-seltext_l  = 'Sale Tax'.
      wa_fieldcat-tabname    = 'ITAB'.
      wa_fieldcat-row_pos    = 1.
      wa_fieldcat-col_pos    = 7.
      APPEND wa_fieldcat TO gt_fieldcat.
      wa_fieldcat-fieldname  = 'DCOST'.
      wa_fieldcat-seltext_l  = 'Delivery Cost'.
      wa_fieldcat-tabname    = 'ITAB'.
      wa_fieldcat-row_pos    = 1.
      wa_fieldcat-col_pos    = 8.
      APPEND wa_fieldcat TO gt_fieldcat.
      wa_fieldcat-fieldname  = 'NETWR'.
      wa_fieldcat-seltext_l  = 'Landed Value'.
      wa_fieldcat-tabname    = 'ITAB'.
      wa_fieldcat-row_pos    = 1.
      wa_fieldcat-col_pos    = 9.
      wa_fieldcat-do_sum     = 'X'.
      APPEND wa_fieldcat TO gt_fieldcat.
      wa_fieldcat-fieldname  = 'LRATE'.
      wa_fieldcat-seltext_l  = 'Landed Rate'.
      wa_fieldcat-tabname    = 'ITAB'.
      wa_fieldcat-row_pos    = 1.
      wa_fieldcat-col_pos    = 10.
      wa_fieldcat-do_sum     = ' '.
      APPEND wa_fieldcat TO gt_fieldcat.
    wa_fieldcat-fieldname  = 'NOMVL'.
    wa_fieldcat-seltext_l  = 'NOM Value'.
    wa_fieldcat-tabname    = 'ITAB'.
    wa_fieldcat-row_pos    = 1.
    wa_fieldcat-col_pos    = 12.
    wa_fieldcat-do_sum     = 'X'.
    APPEND wa_fieldcat TO gt_fieldcat.
    wa_fieldcat-fieldname  = 'NOMRT'.
    wa_fieldcat-seltext_l  = 'NOM Rate'.
    wa_fieldcat-tabname    = 'ITAB'.
    wa_fieldcat-row_pos    = 1.
    wa_fieldcat-col_pos    = 13.
    wa_fieldcat-do_sum     = ' '.
    APPEND wa_fieldcat TO gt_fieldcat.
      wa_fieldcat-fieldname  = 'BGVAL'.
      wa_fieldcat-seltext_l  = 'Budget Value'.
      wa_fieldcat-tabname    = 'ITAB'.
      wa_fieldcat-row_pos    = 1.
      wa_fieldcat-col_pos    = 11.
      wa_fieldcat-do_sum     = 'X'.
      APPEND wa_fieldcat TO gt_fieldcat.
      wa_fieldcat-fieldname  = 'ZPLP1'.
      wa_fieldcat-seltext_l  = 'Budget Rate'.
      wa_fieldcat-tabname    = 'ITAB'.
      wa_fieldcat-row_pos    = 1.
      wa_fieldcat-col_pos    = 12.
      wa_fieldcat-do_sum     = ' '.
      APPEND wa_fieldcat TO gt_fieldcat.
      wa_fieldcat-fieldname  = 'VARNC'.
      wa_fieldcat-seltext_l  = 'Variance'.
      wa_fieldcat-tabname    = 'ITAB'.
      wa_fieldcat-row_pos    = 1.
      wa_fieldcat-col_pos    = 13.
      wa_fieldcat-do_sum     = 'X'.
      APPEND wa_fieldcat TO gt_fieldcat.
      wa_layout-colwidth_optimize = 'X'.
      wa_layout-zebra = ' '.
      DATA: ls_event TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 0
        IMPORTING
          et_events   = gt_events[].
      READ TABLE gt_events WITH KEY name =  slis_ev_end_of_page
                               INTO ls_event.
      IF sy-subrc = 0.
        MOVE 'END_OF_PAGE' TO ls_event-form.
        APPEND ls_event TO gt_events.
      ENDIF.
      READ TABLE gt_events WITH KEY name =  slis_ev_end_of_list
                             INTO ls_event.
      IF sy-subrc = 0.
        MOVE 'END_OF_LIST' TO ls_event-form.
        APPEND ls_event TO gt_events.
      ENDIF.
      gd_prntparams-reserve_lines = '7'.   "Lines reserved for footer
      gd_prntparams-no_coverpage = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
                i_callback_program        = sy-repid
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
           i_callback_top_of_page            = 'TOP-OF-PAGE'
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      i_callback_html_end_of_list           = 'END_OF_LIST_HTML'
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
                is_layout                 = wa_layout
                it_fieldcat               = gt_fieldcat
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
             i_default                    = 'X'
             i_save                       = 'X'
      IS_VARIANT                        =
       it_events                         = gt_events
      IT_EVENT_EXIT                     =
      is_print                          = gd_prntparams
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
        TABLES
          t_outtab                          = itab
       EXCEPTIONS
         program_error                     = 1
         OTHERS                            = 2
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    *&      Form  top-of-page
          text
    -->  p1        text
    <--  p2        text
    FORM top-of-page .
    ALV Header Declarations
      DATA: t_header TYPE slis_t_listheader,
            wa_header  TYPE slis_listheader,
           wa_header1 TYPE slis_listheader,
           wa_header2 TYPE slis_listheader,
           wa_header3 TYPE slis_listheader,
            wa_header4 TYPE slis_listheader.
    Title
      wa_header-typ = 'H'.
      wa_header-info = 'Purchase Variance Report'.
      APPEND wa_header TO t_header.
      CLEAR wa_header.
    Material
    SHIFT p_matnr LEFT DELETING LEADING '0'.
    wa_header1-typ = 'S'.
    wa_header1-info = ' '.
    CONCATENATE 'Material : ' p_matnr matdes INTO wa_header1-info SEPARATED BY space.
    APPEND wa_header1 TO t_header.
    CLEAR wa_header1.
    Plant
    IF ( s_werks-low IS NOT INITIAL AND s_werks-high IS NOT INITIAL ).
       wa_header2-typ = 'S'.
       wa_header2-info = ' '.
       CONCATENATE 'Plant : ' s_werks-low 'to' s_werks-high INTO wa_header2-info SEPARATED BY space.
       APPEND wa_header2 TO t_header.
       CLEAR wa_header2.
    ELSEIF ( s_werks-low IS NOT INITIAL AND s_werks-high IS INITIAL ).
       wa_header2-typ = 'S'.
       wa_header2-info = ' '.
       CONCATENATE 'Plant : ' s_werks-low INTO wa_header2-info SEPARATED BY space.
       APPEND wa_header2 TO t_header.
       CLEAR wa_header2.
    ELSEIF ( s_werks-low IS INITIAL AND s_werks-high IS INITIAL ).
       EXIT.
    ENDIF.
    Period
      IF ( s_bedat-low IS NOT INITIAL AND s_bedat-high IS INITIAL ).
        wa_header4-typ = 'S'.
        wa_header4-info = ' '.
        CONCATENATE 'Period : '
                    s_bedat-low+6(2) '.'
                    s_bedat-low+4(2) '.'
                    s_bedat-low(4) INTO wa_header4-info SEPARATED BY space.
        APPEND wa_header4 TO t_header.
        CLEAR wa_header4.
      ELSE.
    IF ( s_bedat-low IS INITIAL AND s_bedat-high IS INITIAL ).
        wa_header4-typ = 'S'.
        wa_header4-info = ' '.
        CONCATENATE 'Period : '
                    s_bedat-low+6(2) '.'
                    s_bedat-low+4(2) '.'
                    s_bedat-low(4)
                    'to'
                    s_bedat-high+6(2) '.'
                    s_bedat-high+4(2) '.'
                    s_bedat-high(4) INTO wa_header4-info SEPARATED BY space.
        APPEND wa_header4 TO t_header.
        CLEAR wa_header4.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = t_header.
      I_LOGO                   =
      I_END_OF_LIST_GRID       =
      I_ALV_FORM               =
    ENDFORM.                    " top-of-page
    *&      Form  end_of_list_html
          output at the end of the list - not in printed output       *
    FORM end_of_list_html USING end TYPE REF TO cl_dd_document.
      DATA: ls_text TYPE sdydo_text_element,
            l_grid     TYPE REF TO cl_gui_alv_grid,
            f(14) TYPE c VALUE 'SET_ROW_HEIGHT'.
      DATA: qty1 TYPE sdydo_text_element.
      DATA: unt1 TYPE sdydo_text_element.
      DATA: wtd1 TYPE sdydo_text_element.
      DATA: cur1 TYPE sdydo_text_element.
      DATA: var1 TYPE sdydo_text_element.
      DATA: verp1 TYPE sdydo_text_element.
      DATA: bgv1 TYPE sdydo_text_element.
      qty1 = qty.
      unt1 = unt.
      wtd1 = wtd.
      cur1 = cur.
      var1 = var.
      verp1 = verp.
      bgv1 = bgv.
      ls_text = 'SUMMARY'.
      CALL METHOD end->add_text
        EXPORTING
          text         = ls_text
          sap_emphasis = 'strong'.
    Total Qty Bought (start new line)
      CALL METHOD end->new_line.
      CALL METHOD end->add_text
        EXPORTING
          text = 'Total Qty Bought : '.
      CALL METHOD end->add_text
        EXPORTING
          text = qty1.
      CALL METHOD end->add_text
        EXPORTING
          text = unt1.
    Wtd. Avg. Purchase Rate
      CALL METHOD end->new_line.
      CALL METHOD end->add_text
        EXPORTING
          text = 'Wtd. Avg. Purchase Rate : '.
      CALL METHOD end->add_text
        EXPORTING
          text = cur1.
      CALL METHOD end->add_text
        EXPORTING
          text = wtd1.
    Wtd. Avg. Budget Rate
      CALL METHOD end->new_line.
      CALL METHOD end->add_text
        EXPORTING
          text = 'Wtd. Avg. Budget Rate : '.
      CALL METHOD end->add_text
        EXPORTING
          text = cur1.
      CALL METHOD end->add_text
        EXPORTING
          text = bgv1.
    Gain / Loss
      CALL METHOD end->new_line.
      CALL METHOD end->add_text
        EXPORTING
          text = 'Gain / Loss : '.
      CALL METHOD end->add_text
        EXPORTING
          text = cur1.
      CALL METHOD end->add_text
        EXPORTING
          text = var1.
    MAP ( Moving Average Price )
      CALL METHOD end->new_line.
      CALL METHOD end->add_text
        EXPORTING
          text = 'Mov Avg Price : '.
      CALL METHOD end->add_text
        EXPORTING
          text = cur1.
      CALL METHOD end->add_text
        EXPORTING
          text = verp1.
    ENDFORM. "end_of_list_html.
    *&      Form  END_OF_PAGE
    FORM end_of_page.
      DATA: listwidth TYPE i,
            ld_pagepos(10) TYPE c,
            ld_page(10)    TYPE c.
      wtd2 = wtd.
      bgv2 = bgv.
      CONDENSE qty.
      CONDENSE unt.
      CONDENSE wtd2.
      CONDENSE bgv2.
      CONDENSE var.
      CONDENSE verp.
      SKIP.
      WRITE:/ 'SUMMARY:'.
    write:/ sy-uline(7).
      WRITE:/ 'Total Qty Bought        : ', qty, unt.
      WRITE:/ 'Wtd. Avg. Purchase Rate : ', wtd2, cur.
      WRITE:/ 'Wtd. Avg. Budget Rate   : ', bgv2, cur.
      WRITE:/ 'Gain / Loss             : ', var, cur.
      WRITE:/ 'Mov Avg Price           : ', verp, cur.
    ENDFORM.                    "END_OF_PAGE
    *&      Form  END_OF_LIST
    FORM end_of_list.
      DATA: listwidth TYPE i,
            ld_pagepos(10) TYPE c,
            ld_page(10)    TYPE c.
      wtd2 = wtd.
      bgv2 = bgv.
      CONDENSE qty.
      CONDENSE unt.
      CONDENSE wtd2.
      CONDENSE bgv2.
      CONDENSE var.
      CONDENSE verp.
      SKIP.
      WRITE:/ 'SUMMARY:'.
    write:/ sy-uline(7).
      WRITE:/ 'Total Qty Bought        : ', qty, unt.
      WRITE:/ 'Wtd. Avg. Purchase Rate : ', wtd2, cur.
      WRITE:/ 'Wtd. Avg. Budget Rate   : ', bgv2, cur.
      WRITE:/ 'Gain / Loss             : ', var, cur.
      WRITE:/ 'Mov Avg Price           : ', verp, cur.

  • Wrong depreciation calculated for base value 04 + EA-FIN activated

    Hi,
    after activating EA-FIN, depreciation for assets using base value 04 (= half of replacement value) is calculated wrong.
    While AW01 for a particular asset shows depreciation values based on the FULL replacement value (like it would be base value 03) AW01_AFAR (the u201Coldu201D asset explorer) shows the correct depreciation for base value 04.
    The wrong base value can also be seen using the "display depreciation calculation" button in both transactions.
    There are no enhancements for base value determination active.
    I didnu2019t find any SAPNET notes nor SCN entries regarding this case, any ideas?
    Best regards, Christian

    For what it's worth, I did a search and didn't find anything either. 
    It sounds like you've already tried this, but if the base value (the actual $$ value) is different in the trace on both tcodes then you have a problem.  I would be sure to recalculate the values when you enter AW01 and AW01_AFAR to ensure that it's correct before looking at the trace.
    The formula for the replacement value is: 
    ( u_ganlc-kansw + u_ganlc-answl +
                   u_ganlc-kmafa + u_ganlc-mafav + u_ganlc-zusma +
                   u_ganlc-mafam + u_ganlc-mafal +
                   u_ganlc-kaufw + u_ganlc-aufwv +
                   u_ganlc-aufwp + u_ganlc-aufwl ) / 2 .
    I'd look at ANLC for the asset and do the calculation yourself to confirm the value. 
    You've probably done all of that so I predict an OSS message in your future !
    -nathan

  • Pricing Procedure determination for Quotation,Contract,Scheduling Agreement

    Hello All,
                 Plz let me know,how the pricing procedure(Both Item & Header Level) can be determined for Quotation,Contract,Scheduling Agreement.
    Do let me know with configuration details.
    Thanks
    JP

    Hi Jyoti ,
    There isn't any separate pricing procedure for Quotaions , Contracts , Scheduling Agreement s..
    The pricing which u normally find in PO derived from Vendor Master ( Based on Vendor Schema ) , hold good for the above purchasing documents.
    Regards
    Ramesh Ch

  • Reg:Conversion for Net value

    Hi All,
              I need to convert vbrp-netwr (net value) into USD  with function module                                        CONVERT_TO_LOCAL_CURRENCY .can any one can help me out by posting answer in detail.
    with regards,
    sumanth reddy

    Hi Sumanth,
    Chk this out
    data: lv_amount type p decimals 2.
    CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
      EXPORTING
      CLIENT                  = SY-MANDT
        date                    = sy-datum
        foreign_amount          = '1000'  amount which you wanted to   (table-filed)
        foreign_currency        = 'XXX' from what currency (table-filed)
        local_currency          = 'USD'  to currency (table-filed)
      RATE                    = 0
      TYPE_OF_RATE            = 'M'
      READ_TCURR              = 'X'
    IMPORTING
      EXCHANGE_RATE           =
      FOREIGN_FACTOR          =
       LOCAL_AMOUNT            = LV_AMOUNT   =====> final amount which is tobe displayed
      LOCAL_FACTOR            =
      EXCHANGE_RATEX          =
      FIXED_RATE              =
      DERIVED_RATE_TYPE       =
    EXCEPTIONS
      NO_RATE_FOUND           = 1
      OVERFLOW                = 2
      NO_FACTORS_FOUND        = 3
      NO_SPREAD_FOUND         = 4
      DERIVED_2_TIMES         = 5
      OTHERS                  = 6
    IF sy-subrc = 0.
      WRITE: LV_AMOUNT.
    ENDIF.
    revert for further clarification
    Thanks and Regards'
    Srikanth.P

  • TPM-FM: pricing procedure determination for budget postings

    Hi Experts,
    We are setting up Funds management for trade promotions in CRM 7.0
    We have set up fund plans and funds with attributes like account/account hierarchy and product hierarchy. When we try to create a budget posting (transaction type BPUP) we get the error message that a price procedoure could not be determined.
    In the IMG we have set up price determination up for procedure 0CRMBP  with condition type 0BPO and checked that the document and customer pricing procedures are correctly stated.
    When we look at the error message we can see that the system is not able to determine an attribute for the customer pricing procedure as we don't have an account/account hierarchy ID on the budget posting transaction. This is only stated on the fund transaction type.
    Any ideas what's missing?
    BR,
    Anne

    Thanks for posting a resolution.
    Regards,
    Anik Roy
    SAP Moderator

  • Total for net value

    Hi,
    How can i make the total of net value auart.
    i hve tried in this way...Can someone suggest me the suitable way.
    sort itab by auart.
    loop at itab.
    at end of auart.
    sum.
    write : /5 itab-vbeln, 15 itab-posnr,25 itab-auart ,
    30 itab-matnr,35 itab-zmeng,40 itab-zieme
    , 45 itab-netwr,50 itab-waerk.
    endat.
    endloop.

    Your Internal table  should in sorted  way of fields  arranged  .
    data : Begin of  Itab occurs 0,
    vbeln,
    auart ,
    posnr,
    matnr,
    zmeng,
    zieme
    netwr,
    waerk
    end of itab .
    Reward points  if it is usefull..
    Girisih

  • Free goods pricing procedure

    Hi,
    I need to  configure the free gods functionality and I look for clarification from those who have configured it . My questions are.
    1) how does the system determines while creating sales order that free goods are involved.
    2) for main item,  if the item category is TAN, then for exclusive free goods the item category will be TANN ? Is the following combination ok for free goods item category detemination ?
    OR + NORM+TAN(higher level) +FREE(usage)=TANN......where TAN is the item cateogry of main item
    3) How is the free goods pricing procedure works. ?? I mean do we have to define  the basic price condition PR00 in the free goods pricing procedure so that the system applies the basic price to the main item  ? for example if the main billable qty is 10, and per unit price is 100, then the basic price will be 10*100=1000 for the main billable items in the free goods pricing procedure.
    now if free goods are 2 (exclusive), then the system shows in the pricing line item a basic price of 2100=200 and then a condition R100 is shown as a negative amount of 2100= -200 so that net value is zero ??
    4) I think when the material is entered, then the system reads the free goods master record and then determines the main item category for billable item and then free item category is determined and then pricing is carried out
    pls validate my above points ?
    regds

    Hi
    Yes, there will be only one pricing procedure for free goods and normal goods.
    Free goods procedure is to determine the free goods condition records (maintained through VBN1) and now way related to pricing.
    Pricing procedure is to determine the price for each line item based on the conditon records (maintained through VK11).
    As an example- there is free goods conditon record for a material as 10 + 2 exclusive and hence for an order quantity of 10 you can see a second line item for a quantity of 2 as a sub item with item category as TANN.
    The pricing happens the same way for both the line items and you can check that in the conditions tab of each line item.
    While carrying out the pricing, system goes to the first conditon type in the pricing procedure and if it satisfies the requirement then accesses the conditon records and picks if there is any valid conditon record. Like wise, it checks all the condition types in the pricing procedure. In this process it also checks the conditon type R100 and the requirement will not be satisfied for the first line item and hence will not determine any value. In the case of the sub item with TANN item category, the condition records will be determined as happened for the first line item and also the R100 will be determined. Because, the reqirement for R100 says, the pricing details(in VOV7) for the corresponding item category(which is TANN) should be B-Pricing for free goods(100% discount). TANN satisfies this conditon and it determines the total amount here, making the net value as zero. If there are any values below the R100 condition type in the pricing procedure, then the net value will not be zero. Hence positioning of the R100 condition type has importance in designing the pricing procedure. If you change the value for TANN in VOV7 from B to X, then R100 will not be determined even though the free goods are determined in the sales order as sub items. The pricing happens the same way to both main item and sub item (free goods).
    Regards,
    Ravi

Maybe you are looking for

  • Can we write a join on a view and a table

    Hi all, can we write a join on a view and a table. i got the requirement from my functional people about the following one Select CAUFV-AFUNR, CAUFV-AUART, AFVC-VORNR, CAUFV-FTRMI, CRHD-ARBPL into <ProOrd>, <OrdTyp>, <Opt>, <RelDat>, <WorCen> from CA

  • Over writing condition value

    Dear All, We have maintained condition record for BED, Scess and SHcess in our company. Now, a new requirement has come up to maintain automatic as well as manual condition types for excise duties. Whenever we enter the manual excise condition type, 

  • Films Are twice As Long In iTunes

    I have converted a DVD to mp4 and imported it into iTunes so that I can then transfer it to my iPod. The mp4 file on my laptop shows a correct running time of 01:12:40, yet when I drag it into iTunes it shows a running time of 02:25:21. When I play i

  • Try  Catch problem CS6

    All my try catch scripts don't work on CS6 $.strict = false; function myGetScriptPath() { try{ return app.activeScript; catch(myError){ return File(myError.fileName); myGetScriptPath() Can anyone tell me the problem? Thanks Trevor

  • Needed to round a number to nearest thousand

    Hi all, Can any one say is there any function to round a number to nearest thousand. example == 73882 it must be rounded to 74000. Thanks Ravi use small case when you are posting the questions Edited by: Vijay Babu Dudla on Dec 15, 2008 12:09 PM