How to calculate variance in process order?

hi
i hav standard report ME1P,  i need to do some modifications in this standard prgrm
i did all modifications except variance calculation...
can any one expln me the logic of below code?
IF xeipa-lprei IS INITIAL.
      IF xeipa-peinh NE 0.
        new_eipa_netpr = xeipa-preis / xeipa-peinh.
        new_eipa_peinh = xeipa-peinh.
      ELSE.
        new_eipa_netpr = xeipa-preis.
        new_eipa_peinh = 1.
      ENDIF.
      new_eipa_preis = xeipa-preis.
      new_eipa_waers = xeipa-bwaer.
    ELSE.
      IF xeipa-lpein NE 0.
        new_eipa_netpr = xeipa-lprei / xeipa-lpein.
        new_eipa_peinh = xeipa-lpein.
      ELSE.
        new_eipa_netpr = xeipa-lprei.
        new_eipa_peinh = 1.
      ENDIF.
      new_eipa_preis = xeipa-lprei.
      IF xeipa-lwaer NE space.
        new_eipa_waers = xeipa-lwaer.
      ELSE.
        new_eipa_waers = xeipa-bwaer.
      ENDIF.
    ENDIF.
    refe1 = old_eipa_preis * new_eipa_peinh.
    refe2 = new_eipa_preis * old_eipa_peinh.
    IF refe1 NE refe2 OR old_eipa_preis EQ 0 OR
         i_allekz NE space OR old_eipa_waers NE new_eipa_waers.
      IF old_eipa_waers NE new_eipa_waers AND old_eipa_waers NE space.
CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
          EXPORTING
            date             = xeipa-bedat
            foreign_amount   = new_eipa_netpr
            foreign_currency = new_eipa_waers
            local_currency   = old_eipa_waers
          IMPORTING
            local_amount     = wae_eipa_netpr.
        wae_eipa_waers = old_eipa_waers.
      ELSE.
        CLEAR: wae_eipa_netpr, wae_eipa_waers.
      ENDIF.
     PERFORM variance_cal.
     old_eipa_netpr = new_eipa_netpr.
     old_eipa_preis = new_eipa_preis.
     old_eipa_peinh = new_eipa_peinh.
     old_eipa_waers = new_eipa_waers.
  ELSE.
     DELETE xeipa.
  ENDIF.
IF wae_eipa_netpr EQ 0.
    IF refe1 NE refe2 AND old_eipa_preis NE 0.
      IF old_eipa_preis NE 0.
        refe1 = ( new_eipa_preis * old_eipa_peinh -
                  old_eipa_preis * new_eipa_peinh ) * 1000 /
                ( old_eipa_preis * new_eipa_peinh ).
        IF refe1 LE 999999.
          abweichung = refe1.
        ELSE.
          abweichung = 999999.
        ENDIF.
      ELSE.
        abweichung = 0.
      ENDIF.
    ENDIF.
  ELSE.
    IF wae_eipa_netpr NE old_eipa_netpr AND old_eipa_netpr NE 0.
      IF old_eipa_netpr NE 0.
        refe1      = ( wae_eipa_netpr - old_eipa_netpr ) * 1000
                     / old_eipa_netpr.
        IF refe1 LE 999999.
          abweichung = refe1.
        ELSE.
          abweichung = 999999.
        ENDIF.
      ELSE.
        abweichung = 0.
      ENDIF.
    ENDIF.
  ENDIF.
  IF sy-subrc is INITIAL.
    wa_final-abweichung = abweichung.
  ENDIF
Regards
Smitha

Hi,
It all depends on how you want the freight to be calculated (Eg: Volume based, Weight based etc.). Please share the business requirement.
Regards

Similar Messages

  • How to calculate work in process for maintenance order

    how to calculate work in process for maintenance order i.e raw materials not used

    Hi,
    Generally, when u create PR from maintenance order, account assignment category should be F. Cost of services first settles on the order when u create service entry sheet. Further it got settled onto settlement receiver given in order.
    If you want to change the category from F to K for maintenance orders then follow the IMG menu path as given below.
    Plant Maintenance and Customer Service > Maintenance and Service Processing > Maintenance and Service Orders  >
    General Data > Define Account Assignment Cat. and Document Type for Purchase Requisitions

  • How to get the all process orders and outbound deliveries based on material

    Hi Team ,
    I need one help from you regarding the MB 56 transaction.
    My doubt is : How to get the all process orders and outbound deliveries based on material, plant and batch?
    Please help me regarding this.
    Thanks & Regards,
    Srikanth.

    Hi,
    You can use ST05,to trace the program and find out,
    hope it will help you...
    thanks and regards,
    veera.

  • How to track changes for Process Order

    Dear All,
    how can i have change documents for a process order like , which user have done Batch determination, order release,  operation confirmation and GI and GR.
    if i can understand  there is an option in process order GOTO->LOGS->....... to view some of these information but that is not working on my side saying "There are no entries in the release log ". how to activate these logs...
    thanks to all
    Zeeshan

    Dear,
    You can find Changes Details in Order Status tab(Blue Ikon)
    GO to that Ikon ---> Extras --> Change Documents --> All ---> Then Press All Changes
    Please refer  SAP note 390635 .
    But if you want change document in details or restrict changes then you have to use OCM :-Order Change management.
    Regards,
    R.Brahmankar

  • Is calculation of variance in Process Order Mandatory

    Dear PP Gurus,
    I would like to know is Variance Calculation is Mandatory Befor Performing Settlement for Process Orders ,Once the Order is Technically Completed.What implications will be  there if I perform Settlement Transaction(KO88) Directly with out Perfoming Variance Calculation.
    Regards
    Varma

    as per my understanding,Varinace key  in Material masster costing view controls whether order has to undergo Variance calcualtion or not before Settlement.
    If Varinace key is maintained the variance is calcualted between the Target and actual paramentes.
    If not, still the varince is  seen in the cost analysis report.but against the Planned and actual parameters.
    However you can do the Settlement without Varinace calculation.
    Regards
    Ratan

  • Remaining Variance on Process Order

    Analysis of variances on a process order results in the difference being calculated as a Remaining Variance (Only remaining var. in version 0 - no target costs, message KV 151).
    I want to include this variance in a report.
    In which table can I find this data?
    Thanks

    Ttry COSS and COSP
    table with value type 31 which is variance value type...
    Do not forget to save the variance results...

  • How to find smartform for process order

    Hi Experts,
    I have a scenario where in i have to find the name of the smartform which is being used for the T'code COR2 (process order),
    there is no output type assigned for it.
    thanks,
    venki...

    hi Venki.
    the method of finding Manual/Standard smartform against transaction.
    If ABAPER created the smartform then you simple find relevant smartform via
    Execute Tcode --> System --> Status --> Double click on Program
    you can search with "formname " from this program.
    If you want to search smartform against standard tcode then you have to follow above method but you will check the smartform one-by-one and find required smartform.
    or
    you just copy the program and put into SE80 and there  you can also find with the word of "smartform"
    while you said about the smartform against COR2. this tx has not smartform while you can call smartform via SAP BADI.
    Regards,

  • How should calculate  variance between dynamic input?

    HI  Experts,
    how should calculate Actual cost varience  between two month.

    Hi
    From the screen shot it says only u r using 2 months here.
    But if you are running for year,then this can be the steps.
    1.sort month ..go to values and the arrange .
    2.The data should display properly monthly wise
    3.Then If you have direct month object then create Previous([Month]).we have previous function
    4.write Diff=[Actual Cost]-Previous Actual Cost

  • How to calculate variance between two dimension values

    Hello:
    I have built a cube in Analytical workspace (9.2.0.5) with 3 dimensions. Time, Product & Scenario. I am using BI Beans (thick client) for the presentation layer. What I need is the ability to calculate the variance between two dimension values of same measure. For example, if My scenarios are 'Actual' and 'Budget', when I present the results on the screen for any measure (e.g Total Sales), I should be able to calculate & display the difference between 'Actual' & 'Budget' values of that measure.
    I have more than 7 scenarios and more than 40 measures. It could even be the difference between two product categories. How do I do it either in AW or at BI Beans Level?
    Thank you very much for your help.
    regards
    Suresh

    You want to look at qualified data references in the OLAP DML references. Basically, any data reference may be qualified by specifying a dimension name and value:
    sales(time 'jan92')
    forces the dimension TIME to the member 'jan92', no matter whether 'jan92' is in status or not. The resulting expression is essentially no longer dimensioned by the dimension TIME.

  • Setting an job for closing settled process orders

    Hi PP Gurus,
    I have a requirement to set a background job to close the process orders that have been settled and have not been modified with a certain time frame.
    Are there any standard programs which support this requirement of influencing the selection parameters like settled + eligibility  time frame? How to identify the settled process orders in SAP?
    Regards,
    Ramana

    Hi,
    After the settlement, no particular status is updated in the process order. Hence not possible to select only those orders to close which have been settled.
    Workaround I can think of is, in Tcode COHVPI, select those orders which have status TECO and VCAL, my argument would be orders which have status TECO and Variance calculated would be settled most of the time (Say 99%).
    Hence set the parameters for background job as status TECO and VCAL. Then go to mass processing tab, select the function COMPLETE, select BACKGROUND in execute function option and create a variant and save.
    In SM36 create job, enter the program PPIO_ENTRY, enter the variant created in the earlier step, schedule the date and time.
    Regards
    Vinod

  • Process order should not take part in MRP run

    Hello Colleagues
    I looking for a way how to exclude not released process orders (we have PP-PI) from MD04 report. Not released process order should not take part in MRP run. I was trying to do it using OPJJ for availability check 02 and checking rule PP but I was not able to get result. Could you please help, probably there are other settings?
    Best Regards
    Eduard

    Hi,
    Settings in OPJJ will take effect only when you create or release process orders.
    As a work around you can try to exclude process order is
    1. Create a Storage location and make it not relevant for MRP-OMIR
    2. In Material master for the material in MRP assign storage location MRP as 1 (exclude storage location stock)
    3. Create the process order, in the GR tab enter the storage location (not MRP relevant)
    In the MRP run it will not take the process order into account.
    After releasing change the storage location to the normal sotrage location.
    In this process flow, the control is with the storage location.
    Check it in your sandbox.
    Thanks,
    JK

  • Find flagged process orders for deletion

    Hi all ,
    How do i find flagged process orders for deletion ?
    i need report or t-code

    Hello,
    Try with t-code COOISPI. In selection,Put material no and system status(sel. at header level) as DLFL
    and also check  "with deeltion flag indicator"
    Check with result and revert.
    Regards,

  • Goods Receipt for Material which has no Standard Price in Process Order

    Hello everyone, is there a way by which we can prevent GR for process order which contains material that does not have standard price? And if ever we received material using process order how can we correct the process order right after we correct the standard price.

    Hi,
    i just don't know why you raised new thread as already ur previous thread is not closed
    Now just let us know whether system is throwing any error
    or what exactly happing in cofirmation screen
    Go to OPK4, here
    under goods movement there is option all components  just tick it
    then in second tab Gen individual entry tick Goods movement & termination for incorrect goods movement
    Coming to GR
    what is storage location ur giving
    just check in MMSC, whether this storage location is activated for the header material ( GR )
    Added
    Plz Go through all possible options
    [Auto GR is not happening.;
    Regards
    kumar
    Edited by: kumar kumar on Nov 10, 2009 2:25 PM

  • Process orders in the weekend moving during the night in APO/PPT1

    Hello Gurus,
    I have a problem on the scheduling of production orders when these orders are scheduled
    on the week end.
    Problem description: 
    On day 1 the short term planner schedules production orders in PPT1 (APO) on the
    week end.
    During the night these production orders are re-exploded in ECC (see: COR2 => Read
    Master Data)
    On day 2 the end production date of orders that were in the week end, have moved
    by the system to the Sunday night.
    Step 1: The order is scheduled on the week end on Saturday 14 March 2015.
    Step 2: We explode the order in ECC
    In ECC, we have:
    But if we check the order in APO, we have:
    You can see that the process order are placed at the night of sunday, also if in ECC after explosion was always where was planned.
    Have you any idea how to avoid that the process order moving in APO ?
    Thanks Gurus.
    Livio

    Hi
    You may have 2 settlement rules for CO Products... So ensure you enter PA Trf Str at all the places... This error is never thrown by SAP w/o valid reason
    br, Ajay M

  • Std Costing and Actual costing at process Order

    Hello Friends,
    Followings are the client requirements, Please give me your ideas :-
    1 . Costing variant is same for all three - costing run, process order (plan and actual), means there is no prices variance on process order level. ( material at std price, Activity plan price, overhead fix%)
    2. Alongwith this above client also need to capture actual result (material at MAP, activity at monthly actual price, overhead fix %)
      In this case there is price and  usage variance can see.
    Now as I think that both scenarios are not possible on process order level.  According to me we can do by a customize actual costing cockpit.
    Need your openion that do we have any option thru standard funcations of sap to get this requirement.  If you need any other explanation , please do let me know.
    Thanks
    Ravi

    Thanks friends. I have done.

Maybe you are looking for

  • Why this line of code returns null always??

    Dear All, Just a question. I have this snippet of code where a user is required to input a number. <af:panelGroupLayout layout="vertical" id="pgl1">   <af:inputText label="number" id="it1"                     value="#{MyBean.number}" immediate="true"

  • Zen Autoscan FM Tu

    Hi - I have problems with the autoscan function on the FM Tuner - Zen Neeon. I can manually tune to various stations via the toggle wheel - a bit of a pain and a very slow process. Using autoscan it appears to only go between 95.5 and 96.0. Anyone ha

  • Moving Clips - Files lost

    Hi, I don't know what's going on here and would appreciate some advice. I imported a new set of clips and decided to move them off my system drive onto my media drive. I CMD dragged the event, and it worked, but it seemed odd that it was immediate. I

  • Why do I have numerous imac kernel panic in a month?

    not know why, I reinstalled the system, the hardware test done,and I can not avoid the kernel panic. Someone would know that it is interpreting the report, hit one for you to look. Interval Since Last Panic Report: 108378 sec Panics Since Last Report

  • Como puedo mover objetos durante ejecucion de VI con el teclado?

    Hola: Quisiera poder mover un boton boleano izquierda, derecha mientras que se ejecuta el programa . Como seria posible mover objetos durante la ejecution del VI? Gracias, saludo Eduardo