Production order and Variance

Hi,
I need some clarifictions on production order settlement and variance.
Our PP consultant created one PO.Before release of PO they took standard cost estimate it is showing 9000. In this stnadard cost estimate we are calculating the scrap credit also and scrap credit 1000 and we are mainting for cost center also for scrap credit.
while doing of production of settlement we saw that actual amount is 11000.
As per my knowledge When the production order settlement scrap debit also should settle to scrap cost center. Then our scrap cost center will be 0. But everything is settle except scrap and it is not giving any error also. My doubt is whether scrap is settled or does it was clubbed to any other receiver.
One more question. Why we have to settle the order and why we have to run the variance for order. Does it provides any advantage to the management.
Please guide me deeply.
It is very urgent for me.
Thanks in advance

Hi Sateesh
please check the distribution rule for settlement, you may have put 100 (Full) settlemnt for 1st  Receiver type say Material
Enev if yo maintained two receiver type in order then also if the first one is Full settlement then system will not able take the second receiver type
I think it is going to your 1st receiver type
Thanks
Ansuman

Similar Messages

  • Production order settlement variance button

    Hi,
    I check the settlement of production order and would like to clarify.
    In the settlement rule, the account assignment category is MAT, when double click the rule or click settlement variance button, it shows category PSG.
    why there are 2 settlement? for settlement to asset, there is only 1 and no settlement variance button.
    so why production order settlement has 2 settlement?
    Thanks

    Hi,
    On settlement of Production order, two documents gets created one is Accounting document for posting the variances to Accounts and the Profitability analysis documents.
    This is because, when COPA is activated, the Sold quantity in copa is valuated using the Standard cost estimate.
    For eg: if the SCE of X material is 100 Rs. and Billed quantity is 10 Qty, this billed quantity is valuated using the 100 rs and 1000 Rs is transferred to COPA as COGM.
    But when production is carried out, the actual cost can be different from that of SCE. I,e it can be 120 Rs.
    Hence there is a difference of 20 Rs with which inventory is being valuated less in both Accounts and also in COPA. Hence the same is settled to the respective module on the settlement of Production order so that you have FI and COPA gets reconciled to that extent.
    But Asset settlement we are valuating it with full amount of acquisition. and there is no standard set for the same. Hence the result.
    Thanks & Regards,
    Ravi Kumar

  • IDOC for Creation of Production order and also adding components

    Hi ,
    I have a requirement like I get the data from a 3rd party system and using that i have to create production orders and also should be able to add more materials in COMPONENTS part of that Production order. I was looking for a BAPI which can handle this process.
    And also can any one help me by letting me know is there any Message type available for handling this process of Production order creation and Adding extyra components to it.
    I have a  message type LOIPRO (for Production Order) and associated function modle CLOI_MASTERIDOC_CREATE_LOIPRO for creation of master IDoc, but not sure can i handle the Components part in this.
    Please do send replies ASAP, its very urgent.
    Or else atleast suggest me the other ways of doing this .
    Also send me any BDC program if anyone has already developed for this.
    Thanks
    Kumar
    Edited by: Phani Kumar Peddagopu on Mar 19, 2008 6:56 PM

    Resolved .

  • Open production orders and outbound delivery after go-live

    Hello All,
    I tried to search answer for this question but could not find answer.
    Could anybody suggest, what to do with open production orders and outbound delivery after go-live when WM is activated. As, after go-live WM-PP interface will be activated and system should consume material from storage bin specified in control cycle and that will happen for newly created production order after go-live,but what about existing production orders how to update production supply area against work center in production order.
    Similarly with outbound delivery how to update WM status after go-live.
    Thanks in advance

    Thanks to both Jurgen and Sander
    Regarding production order yes, one way is to re-read PP master data in production orders, but is that the only way to handle this or do we have any other option?
    I was aware of re-read PP master data but it will real time consuming and also if it will problematic for already released or partially confirmed production orders.

  • How to bifurcate production order and purchase order

    hi all,
    is it possible to bifurcate all open production order and purchase order quantity of items.
    ex:i have one item like ffp001 it is showing 100 order quantity.but i want only open purchase quantity.i checked (item master data-->righ click--->Avail to promise) its showing open production and purchase quantity.so i need only open purchase quantity.
    Plz tell me the process of Bifurcation of open orders.
    thanks&Regards,
    P.Pratap

    Hi,
    By default there is no option , as a workaround you can use below method,
    Create 2 warehouse , for example Purchase , Production
    When ever you create purchase order use "Purchase" warehouse, Use production warehouse in production
    In the "Available to Promise" Report you have warehouse filter option.
    Using this filter you achieve can achieve your requirement.
    OR
    Right click "Filter Table"
    Document -> Start with-> PO
    Now you can see only PO
    Refer below image

  • How to attempt production orders and get feedback by using IDocs

    Hi,
    I'm new new to SAP and R3 respectively mySAP. I need to know how to use IDocs (over file system) to attempt production orders to an extern application and how to get the feedback of the whole orders and single operations.
    I found the IDoc-base-type "PPCC2RECORDER01" to send production orders. Is that the right base type for production orders?
    (In consideration of compatibility and support me was recommend to avoid the old types OPERA2 and CONF21.)
    What IDoc-types do I need to get feedback about a production order and its operations?
    I hope someone is understanding my questions is able to help me. Please apologize my broken English.
    Thanks!
    Hannes

    PROGRAM....... ZRCCLORDPROC
    TITLE......... Production Odrer Idocs
    AUTHOR........ Aveek Ghose
    DATE WRITTEN.. 15/09/2006
    R/3 RELEASE... 4.6C
    =====================================================================*
    COPIED FROM... N/A
    DESCRIPTION...
    *& Creation of production order IDOCs to a given selection
    *& This program selects to an input given via the selection screen the *
    *& corresponding production orders from the database. Then the function
    *& module for creation of planned order idocs is called.               *
    *& In general this report is called from the report RCCLTRAN, but it   *
    *& can also be used for its own.                                       *
    =====================================================================*
    PROGRAM TYPE.. Outbound Interface
    DEV. CLASS.... ZPD1
    LOGICAL DB.... N/A
    =====================================================================*
    SCREENS....... N/A
    GUI TITLE..... N/A
    GUI STATUS.... N/A
    TRANSACTIONS.. N/A
    USER EXITS.... N/A
    =====================================================================*
    CHANGE HISTORY                                                       *
    Date       By        Correction Number & Brief Description     Release
    Tables / Structures
    REPORT  zrcclordproc
            NO STANDARD PAGE HEADING
            MESSAGE-ID ZCUST
            LINE-COUNT 65(0)
            LINE-SIZE 255.
    INCLUDE RCORDO01.                    " PBO-Modules                   *
    INCLUDE RCORDI01.                    " PAI-Modules                   *
    INCLUDE RCORDF01.                    " FORM-Routines                 *
    --> Global data
    TYPE-POOLS: cloi.
    include zprodata.        "Types / constants for Orderselection
    include zrcordtop.                      "Tables / Data for this report
    include zrcordtop1.
    include yrccl_constants.
    TABLES : jcds,
             tvarv,
             zzzz_xref_data.
    TYPES:  BEGIN OF ty_date,
              aufnr  TYPE aufnr,
              aedat  TYPE aufaedat,
              aezeit TYPE co_chg_time,
              erdat  TYPE auferfdat,
              erfzeit TYPE co_ins_time,
              loekz  TYPE aufloekz,
              indicator(1) TYPE c,
           END OF ty_date.
    DATA: is_enhancement type isu_ord_segments_determine.
    DATA: itab_date TYPE STANDARD TABLE OF ty_date
                         INITIAL SIZE 0 WITH HEADER LINE.
    DATA: f_objnr TYPE j_objnr.
    DATA: g_report_sub_head(72) TYPE c,          "Sub-Header hold area
          g_report_head(72)     TYPE c,          "Header hold area
          g_run_date(72)        TYPE c,          "Holds message for Run date
          g_run_time(72)        TYPE c.          "Holds message for Run time
    DATA:
    f_old_date TYPE datum,
    f_old_time TYPE uzeit,
    f_continue(1) TYPE c.
    END OF INSERTION DS001
    --> Überschrift für sonstige Einstellungen
    SELECTION-SCREEN SKIP 2.
    SELECTION-SCREEN BEGIN OF BLOCK miscellaneous WITH FRAME.
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN COMMENT 1(30) text-001. "#EC
    SELECTION-SCREEN SKIP 1.
    *>> Logical system comes from Report RCCLTRANS
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 3(30) text-002.
    SELECTION-SCREEN POSITION 35.
    PARAMETERS opt_sys LIKE tbdlst-logsys.
    SELECTION-SCREEN END OF LINE.
    *>> Messagetype comes from Report RCCLTRANS
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 3(30) text-003.
    SELECTION-SCREEN POSITION 35.
    PARAMETERS mestyp LIKE tbdme-mestyp.
    SELECTION-SCREEN END OF LINE.
    *>> Messagetype comes from Report RCCLTRANS
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 3(30) text-004.
    SELECTION-SCREEN POSITION 35.
    PARAMETERS:     p_date     TYPE sydatum.       "last run date
    SELECTION-SCREEN END OF LINE.
    *>> Messagetype comes from Report RCCLTRANS
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 3(30) text-005.
    SELECTION-SCREEN POSITION 35.
    PARAMETERS:     p_time     TYPE syuzeit.       "last run time
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK MISCELLANEOUS.
    *MOD-006
    *>> Messagetype comes from Report RCCLTRANS
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 3(30) text-006.
    SELECTION-SCREEN POSITION 35.
    PARAMETERS: p_update   AS   CHECKBOX DEFAULT space.
    SELECTION-SCREEN END OF LINE.
    *MOD-006
    *MOD-006
    *>> Messagetype comes from Report RCCLTRANS
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 3(30) text-007.
    SELECTION-SCREEN POSITION 32.
    SELECT-OPTIONS: s_rundt FOR sy-datum NO-EXTENSION.
    SELECTION-SCREEN END OF LINE.
    *MOD-006
    *MOD-006
    *>> Messagetype comes from Report RCCLTRANS
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 3(30) text-008.
    SELECTION-SCREEN POSITION 32.
    SELECT-OPTIONS: s_runtm FOR sy-uzeit NO-EXTENSION.
    SELECTION-SCREEN END OF LINE.
    *MOD-006
    **MOD-006
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT 3(30) text-009.
    *SELECTION-SCREEN POSITION 32.
    *SELECT-OPTIONS: s_emat FOR zzzz_xref_data-z_in_value.
    *SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK miscellaneous.
    **MOD-006
    Write selected AUFPL numbers via ranges table to memory ?
    PARAMETERS:
      ordtomem TYPE cloi_x DEFAULT '' NO-DISPLAY.  "X: yes
    do not select from MARC, but use ranges tables directly.   MK 4.0C
    matnr_gl and werks_gl must have the same length.
    PARAMETERS: no_sel  TYPE c DEFAULT ' ' NO-DISPLAY.
    --> Normal selection parameters for ORD comes from the logical db
    *&   Event START-OF-SELECTION
    START-OF-SELECTION.
    --> Select the ORD according to the selected
        MRP controller, Material, work center and plant
    *MOD-006
    Validate the last run date & Time
    PERFORM validate_last_run_date_time.
    *MOD-006
    BEGIN OF INSERTION DS001
    get the entry of the last program run
    select single * for update from ycloidownlprot
                     where logsys = OPT_SYS and
                           downloadtype eq C_DOWNL_PROCESS_ORDERS.
    if YCLOIDOWNLPROT-IN_PROGRESS eq CLOI_TRUE.
    program is already running, do not allow to start again
       write : / text-004, YCLOIDOWNLPROT-USERNAME.
       exit.
    endif.
    YCLOIDOWNLPROT-MANDT        = SY-MANDT.
    YCLOIDOWNLPROT-LOGSYS       = OPT_SYS.
    YCLOIDOWNLPROT-START_DATE   = SY-DATUM.
    YCLOIDOWNLPROT-START_TIME   = SY-UZEIT.
    YCLOIDOWNLPROT-USERNAME     = SY-UNAME.
    YCLOIDOWNLPROT-DOWNLOADTYPE = C_DOWNL_PROCESS_ORDERS.
    YCLOIDOWNLPROT-IN_PROGRESS  = CLOI_TRUE.
    insert or update entry (dependant if entry already exists)
    MODIFY YCLOIDOWNLPROT.
    COMMIT WORK.
    CLEAR CREATED_MASTERIDOCS_PRO.
    EXPORT CREATED_MASTERIDOCS_PRO TO MEMORY ID 'YLOI001'.
    END OF INSERTION DS001
    BEGIN OF INSERTION DS001
    if not sscrfields-ucomm = 'ONLI'.   mk zu 4.0
      exit.
    endif.
    if s_dispo is initial and
        s_matnr is initial and
        s_arbpl is initial and
        s_werks is initial.
       exit.
    endif.
    Send only orders with type 40 - process orders
    p_autyp = '40'.
    END OF INSERTION DS001
    *>> Put the ranges tabs back into matwrk list if no selection (NO_SEL)
      IF no_sel = cloi_true.
        CLEAR t_matwrk_key. REFRESH t_matwrk_key.
        LOOP AT s_matnr.
          t_matwrk_key-matnr = s_matnr-low.
          READ TABLE s_werks  INDEX sy-tabix.
          t_matwrk_key-werks  = s_werks-low.
          APPEND t_matwrk_key.
        ENDLOOP.
        SORT t_matwrk_key BY matnr werks.
        DELETE ADJACENT DUPLICATES FROM t_matwrk_key.
    delete duplicate duplicates from ranges table. Therfore sort by LOW
    (HIGH is not used in this case).
        SORT s_matnr BY low.
        DELETE ADJACENT DUPLICATES FROM s_matnr.
        SORT s_werks BY low.
        DELETE ADJACENT DUPLICATES FROM s_werks.
      ENDIF.
    --> Determine which segments are selected in the message type
      PERFORM ord_segments_determine
        USING mestyp
        CHANGING afpo_x
                 jstk_x
                 afab_x
                 affl_x
                 afvo_x
                 kbed_x
                 jstv_x
                 resb_x
                 kbeu_x
                 afuv_x
                 is_enhancement
                 jstu_x.
    Export the flags to the memory, because the following subroutine
    must not have any parameters !!!
      EXPORT affl_x
             afvo_x
             kbed_x
             resb_x
             kbeu_x
             afuv_x
             TO MEMORY ID 'LOI03'.
    MK 19980326 enhanced selections on header/operation level
    get selection profile for log system from customizing if available
      SELECT SINGLE * FROM tcloi9 WHERE logsys = opt_sys.
    if entry exists for the logical system
      IF sy-subrc = 0.
    if an selection profile for the order is entered, use it for selection
        IF NOT tcloi9-ord_selid IS INITIAL.
          p_selid = tcloi9-ord_selid.
        ENDIF.
        IF NOT tcloi9-ord_opr_selid IS INITIAL AND
           NOT afvo_x IS INITIAL AND NOT affl_x IS INITIAL.
          ord_opr_selid = tcloi9-ord_opr_selid.
        ENDIF.
      ENDIF.
    initialize control key table for selections
      CALL FUNCTION 'CLOI_STEUS_GET'
           EXPORTING
                logsys_to_init         = opt_sys
           IMPORTING
                no_entry_for_logsys    = no_entry_for_logsys
           TABLES
                t_steus                = t_steus
           EXCEPTIONS
                logsys_not_initialized = 1
                OTHERS                 = 2.
    Write structure information into the memory
    perform fill_memory_selobj.
    -> import table with already sent orders
      IMPORT gt_aufnrdone FROM MEMORY ID 'LOIAUFNRTAB'.         "N599845
      SORT gt_aufnrdone BY low.                                 "N599845
    --> Read header information
    GET ioheader.
      Check if material/plant combination is selected MK 4.0C
      CLEAR check_flg.
      IF no_sel = cloi_true.
        READ TABLE t_matwrk_key
                   WITH  KEY matnr = ioheader-matnr
                             werks = ioheader-werks BINARY SEARCH.
        IF sy-subrc  <> 0.
          check_flg = cloi_true.
        ENDIF.
      ENDIF.
    -> check if order was already sent
      IF NOT gt_aufnrdone[] IS INITIAL.                         "N599845
        READ TABLE gt_aufnrdone WITH KEY                        "N599845
          low = ioheader-aufnr                                  "N599845
          TRANSPORTING NO FIELDS                                "N599845
          BINARY SEARCH.                                        "N599845
        IF sy-subrc = 0.                                        "N599845
        -> order already sent
          check_flg = cloi_true.                                "N599845
        ENDIF.                                                  "N599845
      ENDIF.                                                    "N599845
    leave GET routine if check_flg is set.
      CHECK check_flg IS INITIAL.
      CLEAR t_afpo. REFRESH t_afpo.
      CLEAR t_affl. REFRESH t_affl.
      MOVE-CORRESPONDING ioheader TO t_afko.
    GET ioheader LATE.
    BEGIN OF INSERTION DS001
    Check whether the process order has been changed since the last
    run of the program
    clear f_continue.
    if the CHANGED date is greater than the last run or initial
    IF IOHEADER-AEDAT  GT F_OLD_DATE OR
           ( ioheader-aedat  is initial and
             ioheader-aezeit is initial ).
    if the CHANGED date is initial check the creation date
       if ioheader-aedat is initial.
    if the creation date is greater than or equal to the date of the last
    run, if it is equal the creation time must be later or equal to the
    start time of the last run
         IF IOHEADER-ERDAT GT F_OLD_DATE OR
            ( IOHEADER-ERDAT EQ F_OLD_DATE AND
              IOHEADER-ERFZEIT GE F_OLD_TIME ).
           f_continue = 'X'.
         endif.
       else.
         f_continue = 'X'.
       endif.
    if the CHANGED dat is not initial check it against the last run
    ELSEIF IOHEADER-AEDAT  EQ F_OLD_DATE AND
            IOHEADER-AEZEIT GE F_OLD_TIME.
       f_continue ='X'.
    endif.
    Aenderung 295/99  Selektions-Aenderung vom 26. August 99
    Wenn Auftrag bereits techn. abgeschlossen ist, so darf kein IDOC
    erzeugt werden, wenn Auftrag zum löschen vorgemerkt wird.
    CONCATENATE 'OR' IOHEADER-AUFNR INTO F_OBJNR.
    SELECT SINGLE * FROM JEST
                     WHERE OBJNR = F_OBJNR
                     AND   STAT  = 'I0045'.
    IF JEST-INACT EQ SPACE AND SY-SUBRC EQ 0.
       SELECT * FROM JCDS WHERE OBJNR EQ F_OBJNR AND
                                STAT  EQ 'I0045' AND
                                INACT EQ SPACE.
    letzte Aenderung des Status TABG wird geprueft    Beg. WA 354/99
       ENDSELECT.
      IF ( F_OLD_DATE GT JCDS-UDATE OR                         " Beg JB_02
          ( F_OLD_DATE EQ JCDS-UDATE AND
           F_OLD_TIME GT JCDS-UTIME ) ) AND                    " End JB_02
          SY-SUBRC EQ 0.
         CLEAR F_CONTINUE.
       ENDIF.
    ENDIF.
    Ende 295/99
    check f_continue eq 'X'.
    END OF INSERTION DS001
      t_afko-t_afpo = t_afpo[].
      t_afko-t_jstk = t_jstk[].
      t_afko-t_affl = t_affl[].
      t_afko-t_afab = t_afab[].
      APPEND t_afko.
      IF jstk_x = cloi_x.
        t_objnr-objnr = ioheader-objnr.
        APPEND t_objnr.
      ENDIF.
    *---> Remember the orders that are already selected for the global
        selection parameters
      IF ordtomem = cloi_x.                "write order numbers to memory
        t_aufnr_range_done-sign = 'I'.
        t_aufnr_range_done-option = 'NE'.
        t_aufnr_range_done-low = ioheader-aufpl.
        APPEND t_aufnr_range_done.
      ENDIF.
    *---> Remember the orders internal/external keys for AFAB (relationship)
      IF afab_x = cloi_x.
        MOVE-CORRESPONDING ioheader TO t_aufpl_aufnr.
        APPEND t_aufpl_aufnr.
      ENDIF.
    check afpo_x = cloi_x.
    GET ioitem.
    BEGIN OF INSERTION DS001
    Check whether the process order has been changed since the last
    run of the program
    CLEAR F_CONTINUE.
    if the CHANGED date is greater than the last run or initial
    IF IOHEADER-AEDAT  GT F_OLD_DATE OR
           ( ioheader-aedat  is initial and
             ioheader-aezeit is initial ).
    if the CHANGED date is initial check the creation date
       if ioheader-aedat is initial.
    if the creation date is greater than or equal to the date of the last
    run, if it is equal the creation time must be later or equal to the
    start time of the last run
         IF IOHEADER-ERDAT GT F_OLD_DATE OR
            ( IOHEADER-ERDAT EQ F_OLD_DATE AND
              IOHEADER-ERFZEIT GE F_OLD_TIME ).
           f_continue = 'X'.
         endif.
       else.
         f_continue = 'X'.
       endif.
    if the CHANGED date is not initial check it against the last run
    ELSEIF IOHEADER-AEDAT  EQ F_OLD_DATE AND
            IOHEADER-AEZEIT GE F_OLD_TIME.
       f_continue ='X'.
    endif.
    Aenderung 295/99  Selektions-Aenderung vom 26. August 99
    Wenn Auftrag bereits techn. abgeschlossen ist, so darf kein IDOC
    erzeugt werden, wenn Auftrag zum löschen vorgemerkt wird.
    CONCATENATE 'OR' IOHEADER-AUFNR INTO F_OBJNR.
    SELECT SINGLE * FROM JEST
                     WHERE OBJNR = F_OBJNR
                     AND   STAT  = 'I0045'.
    IF JEST-INACT EQ SPACE AND SY-SUBRC EQ 0.
       SELECT * FROM JCDS WHERE OBJNR EQ F_OBJNR AND
                                STAT  EQ 'I0045' AND
                                INACT EQ SPACE.
    letzte Aenderung des Status TABG wird geprueft
       ENDSELECT.
      IF ( F_OLD_DATE GT JCDS-UDATE OR                         " Beg JB_02
          ( F_OLD_DATE EQ JCDS-UDATE AND
           F_OLD_TIME GT JCDS-UTIME ) ) AND                    " End JB_02
          SY-SUBRC EQ 0.
         CLEAR F_CONTINUE.
       ENDIF.
    ENDIF.
    Ende 295/99
    check f_continue eq 'X'.
    END OF INSERTION DS001
      IF afpo_x = cloi_x.
        MOVE-CORRESPONDING ioitem TO t_afpo.
        APPEND t_afpo.
      ENDIF.
    Put matnr and ltrmi in a help structure, which later goes to t_afpo
      IF ioitem-posnr = '0001'.
        MOVE-CORRESPONDING ioitem TO help_afpo.
        APPEND help_afpo.
    put PSP element (internal key) into order header. Unique for positions
        IF t_afko-pspel IS INITIAL.
          t_afko-pspel = ioitem-projn.
        ENDIF.
      ENDIF.
      CHECK affl_x = cloi_x.
    GET iosequen.
      CLEAR t_afvo. REFRESH t_afvo.
      MOVE-CORRESPONDING iosequen TO t_affl.
    GET iosequen LATE.
      t_affl-t_afvo = t_afvo[].
      APPEND t_affl.
      CHECK afvo_x = cloi_x.
    GET iooper.
      CLEAR t_kbed. REFRESH t_kbed.
      CLEAR t_afuv. REFRESH t_afuv.
      CLEAR t_resb. REFRESH t_resb.
      MOVE-CORRESPONDING iooper TO t_afvo.
      "Temporary storing of operation information if for a phase
      "the corresponding operation has is needed
      MOVE-CORRESPONDING iooper TO t_aufpl_aplzl_vornr.
      APPEND t_aufpl_aplzl_vornr.
    check, if selection profile (if exists) for the operation is ok
      IF NOT ord_opr_selid IS INITIAL.
        CALL FUNCTION 'STATUS_CHECK_BY_SELSCHEM'
             EXPORTING
                  objnr          = iooper-objnr
                  selid          = ord_opr_selid
             IMPORTING
                  fullfill       = status_ok
             EXCEPTIONS
                  no_stat_tab    = 1
                  no_stat_scheme = 2
                  OTHERS         = 3.
        IF sy-subrc <> 0.
          status_ok = cloi_x.
        ENDIF.
      ELSE.
        status_ok = cloi_x.
      ENDIF.
    check if control key (STEUS) should not be selected.
      control_key_ok = cloi_x.
      IF no_entry_for_logsys IS INITIAL.
        READ TABLE t_steus WITH KEY
             steus = iooper-steus BINARY SEARCH.
        IF sy-subrc <> 0.
          CLEAR control_key_ok.
        ENDIF.
      ENDIF.
      CHECK NOT status_ok IS INITIAL.
      CHECK NOT control_key_ok IS INITIAL.
    GET iooper LATE.
      t_afvo-t_kbed = t_kbed[].
      t_afvo-t_afuv = t_afuv[].
      t_afvo-t_resb = t_resb[].
      APPEND t_afvo.
      IF jstv_x = cloi_x.
        t_objnr-objnr = iooper-objnr.
        APPEND t_objnr.
      ENDIF.
      CHECK kbed_x = cloi_x.
    GET ioopcap.
      MOVE-CORRESPONDING ioopcap TO t_kbed.
      APPEND t_kbed.
      CHECK resb_x = cloi_x.
    GET ioopcomp.
    do not transfer RESB entries with deletion flag
      CHECK ioopcomp-xloek IS INITIAL.
      MOVE-CORRESPONDING ioopcomp TO t_resb.
      APPEND t_resb.
      CHECK afuv_x = cloi_x.
    GET iosoper.
      CLEAR t_kbeu. REFRESH t_kbeu.
      MOVE-CORRESPONDING iosoper TO t_afuv.
    check if control key (STEUS) should not be selected.
      control_key_ok = cloi_x.
      IF no_entry_for_logsys IS INITIAL.
        READ TABLE t_steus WITH KEY
             steus = iooper-steus BINARY SEARCH.
        IF sy-subrc <> 0.
          CLEAR control_key_ok.
        ENDIF.
      ENDIF.
      CHECK NOT control_key_ok IS INITIAL.
    GET iosoper LATE.
      t_afuv-t_kbeu = t_kbeu[].
      APPEND t_afuv.
      IF jstv_x = cloi_x.
        t_objnr-objnr = iosoper-objnr.
        APPEND t_objnr.
      ENDIF.
      CHECK kbeu_x = cloi_x.
    GET iosocap.
      MOVE-CORRESPONDING iosocap TO t_kbeu.
      APPEND t_kbeu.
    *&   Event END-OF-SELECTION
    END-OF-SELECTION.
    *MOD-006
      DATA: itab_matnr TYPE zzzz_xref_data OCCURS 0.
      DATA: l_wa_matnr TYPE zzzz_xref_data.
      DATA: l_wa_matnr_value TYPE zzzz_xref_data-z_in_value.
      DATA: l_wa_afko TYPE  cloi_afko_struct.
    SELECT *
      FROM zzzz_xref_data
    APPENDING TABLE itab_matnr
    WHERE trans_id = 'ZELCUSMATLOOKUP' AND
           ( z_in_value IN s_matnr OR
             z_out_value IN s_matnr ).
    IF sy-subrc = 0.
         LOOP AT ITAB_MATNR INTO L_WA_MATNR.
           L_WA_MATNR_VALUE = L_WA_MATNR-z_OUT_VALUE.
           S_MATNR-LOW = L_WA_MATNR_VALUE.
           S_MATNR-SIGN = 'I'.
           S_MATNR-OPTION = 'EQ'.
           APPEND S_MATNR.
         ENDLOOP.
       DELETE itab_matnr WHERE NOT in_value IN s_emat.
       SORT itab_matnr BY out_value.
    ENDIF.
    CLEAR: l_wa_matnr.
    **MOD-010
    Data which is not in the material lookup table but in the T_AFKO.
      LOOP AT t_afko INTO l_wa_afko.
       READ TABLE S_MATNR WITH KEY LOW = L_WA_AFKO-MATNR BINARY SEARCH.
        READ TABLE itab_matnr INTO l_wa_matnr
            WITH KEY z_out_value = l_wa_afko-matnr BINARY SEARCH.
        IF sy-subrc NE 0.
          l_wa_afko-rgekz = 'X'.
          MODIFY t_afko FROM l_wa_afko  TRANSPORTING rgekz.
        ENDIF.
       IF NOT P_DATE IS INITIAL.
         IF T_AFKO-GSTRP < p_date OR
                 ( T_AFKO-GSTRP = p_date AND
                   T_AFKO-GSUZP > p_time ).
           L_WA_AFKO-RGEKZ = 'X'.
           MODIFY T_AFKO FROM L_WA_AFKO  TRANSPORTING RGEKZ.
         ENDIF.
       ENDIF.
      ENDLOOP.
    Delete  Data which is not in the material lookup
    table but in the T_AFKO.
    DELETE t_afko WHERE rgekz = 'X'.
    *MOD-010
    *MOD-006
    BEGIN OF INSERTION DS001
      DATA: l_wa_itab_date TYPE ty_date.
    Check whether the process order has been changed since the last
    run of the program
      CLEAR f_continue.
      IF NOT t_afko IS INITIAL.
        SELECT aufnr aedat aezeit erdat erfzeit loekz
        INTO TABLE itab_date
        FROM aufk
        FOR ALL ENTRIES IN t_afko
        WHERE aufnr = t_afko-aufnr.
        IF sy-subrc = 0.
          IF NOT p_date IS INITIAL.
            CLEAR: itab_date.
    Check whether the process order has been changed since the last
    run of the program
            LOOP AT itab_date INTO l_wa_itab_date.
    if the CHANGED date is greater than the last run or initial
              IF l_wa_itab_date-aedat GT p_date OR
                    ( l_wa_itab_date-aedat  IS INITIAL AND
                      l_wa_itab_date-aezeit IS INITIAL ).
    if the CHANGED date is initial check the creation date
                IF l_wa_itab_date-aedat IS INITIAL.
    if the creation date is greater than or equal to the date of the last
    run, if it is equal the creation time must be later or equal to the
    start time of the last run
                  IF l_wa_itab_date-erdat GT p_date OR
                     ( l_wa_itab_date-erdat EQ p_date AND
                       l_wa_itab_date-erfzeit GE p_time ).
                    f_continue = 'X'.
                  ELSE.
                    l_wa_itab_date-indicator = 'X'.
                MODIFY itab_date FROM l_wa_itab_date TRANSPORTING indicator.
                  ENDIF.
                ELSE.
                  f_continue = 'X'.
                ENDIF.
    if the CHANGED dat is not initial check it against the last run
              ELSEIF l_wa_itab_date-aedat  EQ p_date AND
                     l_wa_itab_date-aezeit GE p_time.
                f_continue ='X'.
              ELSE.
                l_wa_itab_date-indicator = 'X'.
                MODIFY itab_date FROM l_wa_itab_date TRANSPORTING indicator.
              ENDIF.
            ENDLOOP.
    *MOD-006
      ELSE.
         CLEAR: ITAB_DATE.
         LOOP AT ITAB_DATE INTO L_WA_ITAB_DATE.
    if the CHANGED date is greater than the last run or initial
           IF L_WA_ITAB_DATE-AEDAT GT P_RUNDT OR
                 ( L_WA_ITAB_DATE-aedat  is initial and
                   L_WA_ITAB_DATE-aezeit is initial ).
    if the CHANGED date is initial check the creation date
             if l_wa_itab_date-aedat is initial.
    if the creation date is greater than or equal to the date of the last
    run, if it is equal the creation time must be later or equal to the
    start time of the last run
               IF L_WA_ITAB_DATE-ERDAT GT P_RUNDT OR
                  ( L_WA_ITAB_DATE-ERDAT EQ P_RUNDT AND
                    L_WA_ITAB_DATE-ERFZEIT GE S_RUNTM-LOW OR
                    L_WA_ITAB_DATE-ERFZEIT LE S_RUNTM-HIGH ).
                 f_continue = 'X'.
               else.
                 l_wa_itab_date-indicator = 'X'.
                 MODIFY ITAB_DATE FROM L_WA_ITAB_DATE
                                   TRANSPORTING INDICATOR.
               endif.
             else.
               f_continue = 'X'.
             endif.
    if the CHANGED dat is not initial check it against the last run
           ELSEIF L_WA_ITAB_DATE-AEDAT  EQ P_RUNDT AND
                  L_WA_ITAB_DATE-AEZEIT GE S_RUNTM-LOW.
             f_continue ='X'.
           ELSE.
             l_wa_itab_date-indicator = 'X'.
             MODIFY ITAB_DATE FROM L_WA_ITAB_DATE
                                TRANSPORTING INDICATOR.
           endif.
         ENDLOOP.
    *MOD-006
          ENDIF.
        ENDIF.
      ENDIF.
    DELETE ITAB_DATE WHERE INDICATOR = 'X'.
    *MOD-006
      CLEAR: itab_date.
      IF s_rundt-high IS INITIAL AND NOT s_rundt IS INITIAL.
        s_rundt-high = sy-datum.
      ENDIF.
      LOOP AT itab_date INTO l_wa_itab_date.
        IF NOT s_rundt IS INITIAL.
    if the CHANGED date is greater than the last run or initial
          IF    ( l_wa_itab_date-aedat  IS INITIAL AND
                  l_wa_itab_date-aezeit IS INITIAL ).
    if the CHANGED date is initial check the creation date
            IF l_wa_itab_date-aedat IS INITIAL.
    if the creation date is greater than or equal to the date of the last
    run, if it is equal the creation time must be later or equal to the
    start time of the last run
              IF ( l_wa_itab_date-erdat GT s_rundt-low AND
                 l_wa_itab_date-erfzeit GT s_runtm-low ) AND
                 ( l_wa_itab_date-erdat LT s_rundt-high AND
                 l_wa_itab_date-erfzeit LT s_runtm-high ).
                f_continue = 'X'.
              ELSE.
                l_wa_itab_date-indicator = 'X'.
                MODIFY itab_date FROM l_wa_itab_date
                                  TRANSPORTING indicator.
              ENDIF.
            ELSE.
              f_continue = 'X'.
            ENDIF.
    if the CHANGED dat is not initial check it against the last run
          ELSEIF ( l_wa_itab_date-aedat  GE s_rundt-low AND
                  l_wa_itab_date-aezeit  GE s_runtm-low ) AND
                 ( l_wa_itab_date-aedat  LE s_rundt-high AND
                 l_wa_itab_date-aezeit LE s_runtm-high ).
            f_continue ='X'.
          ELSE.
            l_wa_itab_date-indicator = 'X'.
            MODIFY itab_date FROM l_wa_itab_date
                               TRANSPORTING indicator.
          ENDIF.
        ENDIF.
      ENDLOOP.
    DELETE itab_date WHERE indicator = 'X'.
    *MOD-006
    **MOD-006
    LOOP AT t_afko INTO l_wa_afko.
       READ TABLE itab_date INTO l_wa_itab_date
                WITH KEY aufnr = l_wa_afko-aufnr BINARY SEARCH.
       IF sy-subrc NE 0.
         l_wa_afko-rgekz = 'X'.
         MODIFY t_afko FROM l_wa_afko  TRANSPORTING rgekz.
       ENDIF.
    ENDLOOP.
    DELETE t_afko WHERE rgekz = 'X'.
    **MOD-006
    -> initialize logical data base to reduce memory consumption
      PERFORM ldb_process_init(sapdbioc)
        CHANGING
          lv_subrc.
    --> add information to the order structure that is not
        selected via logical database:
        - if AFVO-entry is a phase (phflg) --> fill field for
          corresponding operation number (PVZNR)
          The internal node number (aplzl) of the corresponding operation
          is in field PVZKN of the phase
        - relationship information: E1AFABL
          especially: select external numbers for the used
          internal numbers in the table AFAB
        - status information of the order header: E1JSTKL
        - status information of the operation: E1JSTVL
    --> Put matnr and ltrmi in the table t_afko
      SORT t_afko BY aufnr.
      LOOP AT help_afpo.
        READ TABLE t_afko WITH KEY aufnr = help_afpo-aufnr
          ASSIGNING -gltri = help_afpo-ltrmi.
        ENDIF.
      ENDLOOP.
    --> Select entries for order and operation status
      IF NOT t_objnr[] IS INITIAL.
        SELECT objnr stat FROM jest INTO TABLE t_jest2
          FOR ALL ENTRIES IN t_objnr
          WHERE objnr = t_objnr-objnr
          AND   inact <> 'X'.
      ENDIF.
    --> Select entries for relationships from afab for all orders
        into table t_afab_tmp
      SORT t_aufpl_aplzl_vornr BY aufpl aplzl.
      IF afab_x = cloi_x AND NOT t_aufpl_aufnr[] IS INITIAL.
      -> select afab data
        SELECT * FROM afab INTO TABLE t_afab_tmp
          FOR ALL ENTRIES IN t_aufpl_aufnr
          WHERE aufpl_vor = t_aufpl_aufnr-aufpl.
        SELECT * FROM afab APPENDING TABLE t_afab_tmp
          FOR ALL ENTRIES IN t_aufpl_aufnr
          WHERE aufpl_nch = t_aufpl_aufnr-aufpl.
        SORT t_afab_tmp
          BY aufpl_vor aplzl_vor aufpl_nch aplzl_nch aobar mimax.
        DELETE ADJACENT DUPLICATES FROM t_afab_tmp
          COMPARING aufpl_vor aplzl_vor aufpl_nch aplzl_nch aobar mimax.
      -> read external order numbers out of data base
        CLEAR t_aufpl. REFRESH t_aufpl.
        LOOP AT t_afab_tmp ASSIGNING -aufpl_nch.
          COLLECT t_aufpl.
        ENDLOOP.
        CLEAR t_aufpl_aufnr. REFRESH t_aufpl_aufnr.
        IF NOT t_aufpl[] IS INITIAL.
          SELECT aufpl aufnr FROM afko INTO TABLE t_aufpl_aufnr
            FOR ALL ENTRIES IN t_aufpl
            WHERE aufpl = t_aufpl-aufpl.
          SORT t_aufpl_aufnr BY aufpl.
        ENDIF.
      -> add order numbers to afab data
        LOOP AT t_afab_tmp ASSIGNING -aufnr_nch = t_aufpl_aufnr-aufnr.
          ENDIF.
        ENDLOOP.
      -> read operation numbers out of data base
        CLEAR t_aufpl_aplzl. REFRESH t_aufpl_aplzl.
        LOOP AT t_afab_tmp ASSIGNING -aplzl_nch.
          COLLECT t_aufpl_aplzl.
        ENDLOOP.
        IF NOT t_aufpl_aplzl[] IS INITIAL.
          SELECT aufpl aplzl vornr FROM afvc
            APPENDING TABLE t_aufpl_aplzl_vornr
            FOR ALL ENTRIES IN t_aufpl_aplzl
            WHERE aufpl = t_aufpl_aplzl-aufpl
              AND aplzl = t_aufpl_aplzl-aplzl.
          SORT t_aufpl_aplzl_vornr BY aufpl aplzl.
        ENDIF.
      -> add operation numbers to afab data
        LOOP AT t_afab_tmp ASSIGNING -vornr_nch = t_aufpl_aplzl_vornr-vornr.
          ENDIF.
        ENDLOOP.
      ENDIF.                               "afab_x
    --> fill AFAB (relationship information) and status information
      SORT t_aufpl_aufnr BY aufnr.
      LOOP AT t_afko ASSIGNING .
      -> fill order head status information
        IF jstk_x = cloi_x.
          CLEAR t_jstk. REFRESH t_jstk.
          LOOP AT t_jest2 INTO wa_tjest2 WHERE objnr = -t_jstk = t_jstk[].
        ENDIF.
      -> fill afab information
        IF afab_x = cloi_x.
          CLEAR t_aufpl_aufnr.
          READ TABLE t_aufpl_aufnr WITH KEY
            aufnr = -t_afab = t_afab[].
        ENDIF.
      -> fill operation and suboperation status information
        IF jstv_x = cloi_x OR afvo_x = cloi_x.
          LOOP AT .
            -> read status information of suboperation
              IF jstu_x = cloi_x.
                LOOP AT -t_jstu = t_jstu[].
                ENDLOOP.
              ENDIF.
            -> read status information of operation
              IF jstv_x = cloi_x.
                CLEAR t_jstv. REFRESH t_jstv.
                LOOP AT t_jest2 INTO wa_tjest2 WHERE objnr = -t_jstv = t_jstv[].
              ENDIF.
            -> Read operation for a phase
              IF NOT -pvznr = t_aufpl_aplzl_vornr-vornr.
                ENDIF.
              ENDIF.
            ENDLOOP.
          ENDLOOP.
        ENDIF.
      -> collect order numbers
        CLEAR wa_aufnrdone.
        wa_aufnrdone-low = -aufnr.
        APPEND wa_aufnrdone TO lt_aufnrdone.
      ENDLOOP.
    -> append collected order numbers to global table
      APPEND LINES OF lt_aufnrdone TO gt_aufnrdone.
      EXPORT gt_aufnrdone TO MEMORY ID 'LOIAUFNRTAB'.
    -> free large tables
      CLEAR t_jest2. REFRESH t_jest2.
      CLEAR t_afab_tmp. REFRESH t_afab_tmp.
      CLEAR t_aufpl. REFRESH t_aufpl.
      CLEAR t_aufpl_aufnr. REFRESH t_aufpl_aufnr.
      CLEAR t_aufpl_aplzl. REFRESH t_aufpl_aplzl.
      CLEAR t_aufpl_aplzl_vornr. REFRESH t_aufpl_aplzl_vornr.
    -> create idocs
      CALL FUNCTION 'CLOI_MASTERIDOC_CREATE_LOIPRO'
           EXPORTING
                opt_sys      = opt_sys
                message_type = mestyp
           TABLES
                order_data   = t_afko
           EXCEPTIONS
                OTHERS       = 1.
    -> export already selected order numbers via ranges tab to memory
      EXPORT t_aufnr_range_done TO MEMORY ID 'LOI002'.
    **MOD-006
    IMPORT created_masteridocs_pro FROM MEMORY ID 'YLOI001'.
    ycloidownlprot-end_date       = sy-datum.
    ycloidownlprot-end_time       = sy-uzeit.
    ycloidownlprot-idocs_selected = created_masteridocs_pro.
    ycloidownlprot-in_progress    = cloi_false.
    insert or update entry (dependant if entry already exists)
    MODIFY ycloidownlprot.
    COMMIT WORK.
    MESSAGE i967(z001) WITH created_masteridocs_pro.
    **MOD-006
    Update last run date and time
      IF p_update = 'X'.
        PERFORM update_last_run.
      ELSE.
      MESSAGE s000 WITH text-022.
        "Last Run Date and Last Run Time not updated
        LEAVE LIST-PROCESSING.
      ENDIF.
      INCLUDE rcordf01.
    *&      Form  validate_last_run_date_time
          text
    -->  p1        text
    <--  p2        text
    *FORM validate_last_run_date_time.
    IF p_date IS INITIAL OR
        p_time IS INITIAL.
       IF sy-batch IS INITIAL.
         MESSAGE s000 WITH text-017.
         "Last Run date & Last Run Time can not be blank
         LEAVE LIST-PROCESSING.
       ELSE.
         MESSAGE e000 WITH text-017.
         "Last Run date & Last Run Time can not be blank
       ENDIF.
    ENDIF.
    *ENDFORM.                    " validate_last_run_date_time
    *&      Form  update_last_run
          text
    -->  p1        text
    <--  p2        text
    FORM update_last_run.
      CONSTANTS:
            l_c_name    TYPE rvari_vnam  VALUE 'Z_PROC_DATE',
            l_c_name1   TYPE rvari_vnam  VALUE 'Z_PROC_TIME',
            l_c_type    TYPE rsscr_kind  VALUE 'P',
            l_c_numb    TYPE tvarv_numb  VALUE '0000'.
    Update last run date
      UPDATE tvarv SET low  = sy-datum
                 WHERE name = l_c_name AND
                       type = l_c_type AND
                       numb = l_c_numb.
      IF sy-subrc = 0.
        COMMIT WORK.
      ELSE.
        ROLLBACK WORK.
        g_run_date = text-015. "#EC
        "Updation of TVARV table failed for ZLAST_RUN_DATE. Update manually
      ENDIF.
    Update last run time
      UPDATE tvarv SET low  = sy-uzeit
                 WHERE name = l_c_name1 AND
                       type = l_c_type AND
                       numb = l_c_numb.
      IF sy-subrc = 0.
        COMMIT WORK.
      ELSE.
        ROLLBACK WORK.
        g_run_time = text-016. "#EC
        "Updation of TVARV table failed for ZLAST_RUN_TIME. Update manually
      ENDIF.
    ENDFORM.                    " update_last_run

  • Adding fixed cost in production order and creating liability

    Dear All,
    We are manufacturing one of our grade of material in a plant which we do not own.We pay some fixed charges to the owner of that plant @ Rs150 PMT produced in that plant.This  fixed charges is to be included in the production order and at the same time liability for that  fixed charges is also to be created so that payment can be made to that vendor.
    For charging this expenses to the production order we have created one activity type and one secondary cost element.But with this the liability can not be created.
    Please advice how to proceed in this circumstances.
    Regards,
    Shivaji

    hi
    I am following this thread...but want to add some views on this..
    As I understood from your requirement that you are sending this material to a third party for some conversion with a fixed charge...so you must have a conversion contract with that party. In my views the process should be...
    1. Conversion contract with the party (MM)
    2. Material will be received from third party with conversion cost at the time of GR (MM)
         Example... Original cost + fixed conv cost = GR value
    3. Invoicing ... MIRO ..Party will be credited at fixed conversion cost
    4, When the same material is issued to another prod order the GI will be at cost as per sl.2
       Please revert back if you have any question
       Kamal 

  • Refrence number in Production order and purchase requisition

    Dear All
    This is MTO scenerio where sales order is created with refernce to quotation,
    Subsequently in MRP run it creating sales order reservation for quotation number not sales for sales order number
    similarly while creating purchase requisition it is displaying refernce number as quotation number
    My requirement is instead of quotation number sales order number should display in production order and purchase requisition
    All answers r suitably rewarded
    regards

    Hi
    Pl check schedule line category you have set for quotation.
    In sch. line for quotation remove checkmark for transfer of requirement and remove automatic Pr generation.
    This will give required result.
    Regards
    Mandar

  • Production order and its Purchase order after MRP

    Dear Expert,
    I am wondering does SAP B1 2007 provides functionality about a production order and its purchase orders generated after a MRP will be marked so that I can check the corresponding purchase orders of a production order ?
    Thanks,
    Deckard

    Hi Suraj V ,
    Thanks for the reply, I have more questions about,
    (1) is it possible to trace those purchase orders from the production order?
    (2) is it possible to reserve those purchase orders of a production order because I found that the system allow another production orders to take the inventory by the receipt of the purchase orders marked by the other production orders?
    Thanks a lot
    Deckard

  • The relationship between production order and purchase requistion After running MPS

    Dear Experts:
         I met a issue . My users want to know the relationship between production order and purchase requistion . In my company we create production order and  purchase req. by  running MRP. our operations are:
    1. T-CODE: MD41  create planned order .
    2. T-CODE: CO41 convert planned order to production order .
    3. T-CODE: MD15 convert planned order to purchase Requisition.
      but I can't  find the  relation of them. would you like to give me some advices? thank you very much.

    Hello
    On the standard MTS process there is no link between the requirement (STO) and the replenishment element (production order).
    See the below extraction from note 12955:
    There is no index that the system could use to determine which issue element (sales order, planning, reservation, dependent requirement, ...) is covered by a certain receipt element (purchase order, production order, purchase requisition, planned order, stock level ...).
    A production order, for example, can be created to cover several different requirements, even when you are using lot sizing procedure EX.
    You can use transaction MD09 or MD04to determine the pegged requirements, but they are calculated dynamically and there is not fixed link between requirement and receipt.
    BR
    Caetano

  • Evaluation Structure for Production Order and Repetitive Manufacturing

    Dear PP friends,
    I am trying to create a Evaluation Structure with reference to an Evaluation Structure (t-code MCR7). I need to join the Standard Evaluation Structures S021 (Production Order) and S026 (Material Usage), but S021 is not appearing to choose characteristics and key figures.
    Does anyone have suggestions?
    My requirement is to create a report where I can see goods receipt x goods issues per order.
    Thanks in advance.
    Marcos

    Hi,
             As we know that In Repetitive Manufacturing, components are often staged at the production line without reference to a particular order.
    To create the demand program again for your production order, you must define the planning strategy for a product. Planning strategies represent the methods of production for planning and manufacturing or procuring a product. and run the scenario accordingly.
    Regards
    Chandra

  • Additive cost not seen in production order and while settling hits PRD

    I am using additive costs for my product costing via CK74n.
    Cost estimate looks good since I have the valuation variants setup to include additive costs.
    But when I see the production order that is being created, all others costs are being considered except additive costs. They are recognized but not as a line item instead as a variance. When I settle the order the costs actually hit price difference account and not even the GL account that I had assigned for the additive cost. SAP did not consider the cost as variance even if it was showing up as variance initially. This as I understood is partly because of the settlement rule that I have in place which tells SAP to go and settle on the material (which is standard SAP to do since I want all the costs from the production order to settle on the eventual material going into stock) so SAP went on to settling on the material. Since the material is set as standard price the variance is being booked as a price difference entry.
    Ideally I would have expected the additive cost getting debited to the order and credited to the gl account that I assigned for the additive cost. The eventual cost (incl. additive cost) should hit the inventory.
    Am I missing a step?

    Hi Sapluver,
    Appreciate your prompt response..Please see my response in italics
    Few queries related to your post.
    1. So your standard cost got two part, one with quantity structure ( materials, labor, OSC etc) which the system cost automatically and one manual part, which is your additive cost. While costing system picks up this manual part from CK74N.
    I hope this part you got correct. Yes, the cost estimate is reading from both the qty structure and the additive costs and the cost roll-up is coming up correctly
    2. Now in actual cost controlling, i think System is not sure how to valuate your additive cost actual part.I agree, the additive cost does appear in the cost analysis section of the production order but does not show up as a line item initially. Instead it comes up as a difference item right in the bottom of the screen after totals have been displayed without any line item reference. As if the system is not sure how to display the line item. Once I have done the material issuance confirmation to the order, the additive cost got picked up correctly as I have set it up in the cost component structure as material overhead but again shows up only as variance
    Which method you used to debit your production order with additive cost, is it a normal journal entry or through some automatic posting through routing ( example OSC through Purchase order/Good Receipt).I probably need to understand your point more clearly? I am not manually debiting the production order at all for the additive cost. I was expecting SAP to debit the order the same way it does for overheads. Overheads too initially show up as variance but then when we run the overhead calculation KGI2 the overheads costs get debited to the production order. Was expecting similar behavior for additive costs. I am receiving the finished product from the production order into stock via MIGO goods receipt movement type 101. I was expecting the debit to happen perhaps at the time of settlement via CO88 but here the system posted it to the price difference account via account key PRD. This I understand the system did because the settlement rule is set to post all the costs on the material and the material has the valuation control as standard price; so the system is seeing the additive cost as a price difference hence posting it to the price difference account.
    System is unaware of the additive cost from actual cost point of view, there is no specification to additive cost from costing variant for actual cost. So you have to debit the order with the additive cost part.So do I manually debit the order with the additive cost? What about the price difference additive cost sitting on the order? Would appreciate if you can tell me the process steps for posting this correctly
    regards
    Sapluver

  • Production order and planned order qty should not consider in MRP

    Dear All,
    i do not want to consider the previous month production order qty and plenned order qty (Nothing but WIP qty) in the current momth MRP, but the stock has to consider in MRP.
    Example,
    Before MRP,
    material : XYZ
    Stock : 1000
    Prod Qty : 500 for 02.04.2008
    PIR Qty : 2000 for 02.05.2008
    After MRP, the requirement should be as below said,
    material : XYZ
    Stock : 1000
    Prod Qty : 500 for 02.04.2008
    PIR Qty : 2000 for 02.05.2008
    Pld OrdQty : 1000 for 02.05.2008
    For the above requirement ,i have done settings in the availabilty check like , for include planned order and include production order are "DO NOT TAKE IN ACCOUNT".
    Even then also the planned order qty is generating for the "500" only.
    please give the solution for the above said requirement.
    thanx in advance
    Regards
    Srinivas

    hi
    MRP will always consider the prod order qty while doing nert req calculation.One thing u can do is TECo the prod orders and un MRP then it wont consider prod order qty.
    The Availability check will check whether the components r avalaible or not based on ur scope of check
    Reward points if useful
    Amit

  • Production Order and Internal Order for each item of the sales order

    Hi
       I am developing Make To Order Report where I have to display the MTO Line Items and non MTO Line Items. For non MTO Line Items I have to display Internal order with Planned and Actual Costs and also Production Order with Planned and Actual Costs. Could anybody tell how to get the Internal order no and production order with Planned and Actual costs for each line item for a sales order.
    Thanks
    Naga

    Hi,
    You can get the Production orders, Planned orders, Internal orders generated for Sales order item from AFPO table (use fields KDAUF-Sales order number & KDPOS-Sales order item). Then to identify the order type use order category (AUTYP) from table AUFK.
    Once you have the Production/internal order, you can ge the cost from COSS and COSP table. Use the object number from AUFK to get the cost entries from COSS & COSP.
    You can use the following sample code as reference.
    Hope this is helps.. (Don't forget to mark it... )
    Form GET_COSTS                                                       *
    Get the material cost, labour hours and the labour cost for the      *
    sales order material.                                                *
    There are no interface parameters to be passed to this subroutine.   *
    FORM GET_COSTS.
      DATA V_OBJNR LIKE AUFK-OBJNR.
    DATA v_menge LIKE vbap-kwmeng.
      SELECT SINGLE OBJNR
        INTO V_OBJNR
        FROM AUFK
       WHERE AUFNR EQ AFPO-AUFNR.
      SELECT * FROM COSS
       WHERE OBJNR EQ V_OBJNR
         AND WRTTP IN ('01', '04'). " p_wrttp. "Labour Cost ( Plan, Actual)
        PERFORM GET_VALUES_FROM_COSS.
      ENDSELECT.
      SELECT * FROM COSP
       WHERE OBJNR EQ V_OBJNR
         AND WRTTP IN ('01', '04')         " p_wrttp
         AND KSTAR NE '0000510033'. " EQ p_kstar2.      "Material Cost
        PERFORM GET_VALUE_FROM_COSP.
      ENDSELECT.
    Get the unit cost of the production order by dividing the production
    cost by the order quantity. The result will be multiplied by the
    GL posting qunatity (Delivery quantity) to get the production cost
    for the quantity being deluivered.
      IF NOT AFPO-PSMNG IS INITIAL.
        OUT_REC-LABOUR_HOURS_ACT = OUT_REC-LABOUR_HOURS_ACT / AFPO-PSMNG.
        OUT_REC-ADDNL_LABOUR_HOURS_ACT =
                          OUT_REC-ADDNL_LABOUR_HOURS_ACT / AFPO-PSMNG.
        OUT_REC-LABOUR_HOURS_PLN = OUT_REC-LABOUR_HOURS_PLN / AFPO-PSMNG.
        OUT_REC-ADDNL_LABOUR_HOURS_PLN =
                         OUT_REC-ADDNL_LABOUR_HOURS_PLN / AFPO-PSMNG.
        OUT_REC-LABOUR_COST_ACT = OUT_REC-LABOUR_COST_ACT / AFPO-PSMNG.
        OUT_REC-ADDNL_LABOUR_COST_ACT =
                         OUT_REC-ADDNL_LABOUR_COST_ACT / AFPO-PSMNG.
        OUT_REC-LABOUR_COST_PLN = OUT_REC-LABOUR_COST_PLN / AFPO-PSMNG.
        OUT_REC-ADDNL_LABOUR_COST_PLN =
                         OUT_REC-ADDNL_LABOUR_COST_PLN / AFPO-PSMNG.
        OUT_REC-MATERIAL_COST_ACT = OUT_REC-MATERIAL_COST_ACT / AFPO-PSMNG.
        OUT_REC-ADDNL_MATERIAL_COST_ACT =
                         OUT_REC-ADDNL_MATERIAL_COST_ACT / AFPO-PSMNG.
        OUT_REC-MATERIAL_COST_PLN = OUT_REC-MATERIAL_COST_PLN / AFPO-PSMNG.
        OUT_REC-ADDNL_MATERIAL_COST_PLN =
                         OUT_REC-ADDNL_MATERIAL_COST_PLN / AFPO-PSMNG.
      ENDIF.
    Multiply the calculated Unit Production costs with the GL quantity to
    get the actual production cost of the quantity delivered.
    Calculation for Labour Hours
      OUT_REC-LABOUR_HOURS_ACT = OUT_REC-LABOUR_HOURS_ACT *
                                 OUT_REC-QUANTITY.
      OUT_REC-ADDNL_LABOUR_HOURS_ACT = OUT_REC-ADDNL_LABOUR_HOURS_ACT *
                                 OUT_REC-QUANTITY.
      OUT_REC-LABOUR_HOURS_PLN = OUT_REC-LABOUR_HOURS_PLN *
                                 OUT_REC-QUANTITY.
      OUT_REC-ADDNL_LABOUR_HOURS_PLN = OUT_REC-ADDNL_LABOUR_HOURS_PLN *
                                 OUT_REC-QUANTITY.
    Calculation for Material Cost
      OUT_REC-MATERIAL_COST_ACT = OUT_REC-MATERIAL_COST_ACT *
                                  OUT_REC-QUANTITY.
      OUT_REC-ADDNL_MATERIAL_COST_ACT =
          OUT_REC-ADDNL_MATERIAL_COST_ACT * OUT_REC-QUANTITY.
      OUT_REC-MATERIAL_COST_PLN = OUT_REC-MATERIAL_COST_PLN *
                                  OUT_REC-QUANTITY.
      OUT_REC-ADDNL_MATERIAL_COST_PLN =
          OUT_REC-ADDNL_MATERIAL_COST_PLN * OUT_REC-QUANTITY.
    Calculation for Labour cost
      OUT_REC-LABOUR_COST_ACT   = OUT_REC-LABOUR_COST_ACT *
                                   OUT_REC-QUANTITY.
      OUT_REC-ADDNL_LABOUR_COST_ACT = OUT_REC-ADDNL_LABOUR_COST_ACT *
                                  OUT_REC-QUANTITY.
      OUT_REC-LABOUR_COST_PLN   = OUT_REC-LABOUR_COST_PLN *
                                  OUT_REC-QUANTITY.
      OUT_REC-ADDNL_LABOUR_COST_PLN = OUT_REC-ADDNL_LABOUR_COST_PLN *
                                  OUT_REC-QUANTITY.
    Get the planned material cost from the total of the planned cost of
    the component materials in the production order confirmations.
      SELECT BWART MENGE MATNR SHKZG FROM AUFM
        INTO (AUFM-BWART, AUFM-MENGE, AUFM-MATNR, AUFM-SHKZG)
       WHERE AUFNR EQ AFPO-AUFNR.
        CHECK AUFM-BWART NE '101'.
        READ TABLE I_MBEW WITH KEY MATNR = AUFM-MATNR
                                   BWKEY = AFPO-DWERK.
        IF SY-SUBRC NE 0.
          SELECT MATNR BWKEY ZPLPR LPLPR PEINH
            FROM MBEW
            INTO I_MBEW
           WHERE MATNR EQ AUFM-MATNR
             AND BWKEY EQ AFPO-DWERK.
            APPEND I_MBEW.
          ENDSELECT.
        ENDIF.
        IF SY-SUBRC EQ 0.
          IF I_MBEW-ZPLPR NE 0.
            IF AUFM-SHKZG EQ 'H'.
              OUT_REC-PLANNED_MATERIAL_COST =
              OUT_REC-PLANNED_MATERIAL_COST +
                           ( I_MBEW-ZPLPR * AUFM-MENGE / I_MBEW-PEINH ).
            ELSE.
              OUT_REC-PLANNED_MATERIAL_COST =
              OUT_REC-PLANNED_MATERIAL_COST -
                           ( I_MBEW-ZPLPR * AUFM-MENGE / I_MBEW-PEINH ).
            ENDIF.
          ELSEIF I_MBEW-LPLPR NE 0.
            IF AUFM-SHKZG EQ 'H'.
              OUT_REC-CURRENT_MATERIAL_COST =
              OUT_REC-CURRENT_MATERIAL_COST +
                           ( I_MBEW-LPLPR * AUFM-MENGE / I_MBEW-PEINH ).
            ELSE.
              OUT_REC-CURRENT_MATERIAL_COST =
              OUT_REC-CURRENT_MATERIAL_COST -
                           ( I_MBEW-LPLPR * AUFM-MENGE / I_MBEW-PEINH ).
            ENDIF.
          ENDIF.
        ENDIF.
      ENDSELECT.
    Get the Future material cost per Unit by deviding the calculated
    Future material cost above with the goods reciept quantity to, then
    multiply the unit cost with the GL quantity to get the Future material
    Cost for the Quantity delivered. (Quantity in the entery from GLPCA
    Table).
      IF NOT AFPO-WEMNG IS INITIAL.
        OUT_REC-PLANNED_MATERIAL_COST =
           OUT_REC-PLANNED_MATERIAL_COST / AFPO-WEMNG * OUT_REC-QUANTITY.
        OUT_REC-CURRENT_MATERIAL_COST =
           OUT_REC-CURRENT_MATERIAL_COST / AFPO-WEMNG * OUT_REC-QUANTITY.
      ENDIF.
    ENDFORM.                               " GET_COSTS
    Form GET_VALUE_FROM_COSP                                             *
    Get the Material cost from COSP table.                               *
    There are no interface parameters to be passed to this subroutine.   *
    FORM GET_VALUE_FROM_COSP.
      FIELD-SYMBOLS: <FS> TYPE ANY.
      DATA: V_COMPONENT TYPE I.
    Cummulate the posting values of all the 16 period buckets as to get
    total production order cost. This is to handle the aprtial posting of
    prodction order values in diffrent periods.
      V_COMPONENT = 15.
      DO 16 TIMES.
        ADD 1 TO V_COMPONENT.
        ASSIGN COMPONENT V_COMPONENT OF STRUCTURE COSP TO <FS>.
        IF COSP-WRTTP EQ '04' AND COSP-KSTAR EQ P_KSTAR2.
          ADD <FS> TO OUT_REC-MATERIAL_COST_ACT.
        ELSEIF COSP-WRTTP EQ '04'.
          ADD <FS> TO OUT_REC-ADDNL_MATERIAL_COST_ACT.
        ELSEIF COSP-WRTTP EQ '01' AND COSP-KSTAR EQ P_KSTAR2.
          ADD <FS> TO OUT_REC-MATERIAL_COST_PLN.
        ELSEIF COSP-WRTTP EQ '01'.
          ADD <FS> TO OUT_REC-ADDNL_MATERIAL_COST_PLN.
        ENDIF.
      ENDDO.
    ENDFORM.                               " GET_VALUE_FROM_COSP
    Form GET_VALUES_FROM_COSS                                            *
    Get the Labour cost and Labour hours from the COSS table.            *
    There are no interface parameters to be passed to this subroutine.   *
    FORM GET_VALUES_FROM_COSS.
      FIELD-SYMBOLS: <FS1> TYPE ANY,
                     <FS2> TYPE ANY.
      DATA: V_COMPONENT1 TYPE I,
            V_COMPONENT2 TYPE I.
    Cummulate the posting values of all the 16 period buckets as to get
    total production order cost. This is to handle the aprtial posting of
    prodction order values in diffrent periods.
      V_COMPONENT1 = 15.
      V_COMPONENT2 = 111.
      DO 16 TIMES.
        ADD 1 TO: V_COMPONENT1, V_COMPONENT2.
        ASSIGN COMPONENT V_COMPONENT1 OF STRUCTURE COSS TO <FS1>.
        ASSIGN COMPONENT V_COMPONENT2 OF STRUCTURE COSS TO <FS2>.
        IF COSS-WRTTP EQ '04' AND COSS-KSTAR EQ P_KSTAR1.
          ADD <FS1> TO OUT_REC-LABOUR_COST_ACT.
          ADD <FS2> TO OUT_REC-LABOUR_HOURS_ACT.
        ELSEIF COSS-WRTTP EQ '04'.
          ADD <FS1> TO OUT_REC-ADDNL_LABOUR_COST_ACT.
          ADD <FS2> TO OUT_REC-ADDNL_LABOUR_HOURS_ACT.
        ELSEIF COSS-WRTTP EQ '01' AND COSS-KSTAR EQ P_KSTAR1.
          ADD <FS1> TO OUT_REC-LABOUR_COST_PLN.
          ADD <FS2> TO OUT_REC-LABOUR_HOURS_PLN.
        ELSEIF COSS-WRTTP EQ '01'.
          ADD <FS1> TO OUT_REC-ADDNL_LABOUR_COST_PLN.
          ADD <FS2> TO OUT_REC-ADDNL_LABOUR_HOURS_PLN.
        ENDIF.
      ENDDO.
    ENDFORM.                               " GET_VALUES_FROM_COSS

  • Open production orders and its costs migration

    Hi All,
    We are migrating open production orders from legacy to SAP.
    We have some standard cost production orders are open in legacy and like to migrate a open production orders to SAP?
    May I know how can I do from controlling point of view?
    I have one typical scenario.
    I have one production order in legacy with 10 standard cost materials produce and out of 10, 5 materials are completed in legacy and we wants to migrate remaining 5 materials to SAP.
    What are the steps I needs to follow to migrate open production orders.
    Any help is appreciated.
    Thanks,
    Anusha

    Hi Anusha,
    Below is the process: (presuming that you're uploading balances as of 01.04.2009)
    Upload all material masters,
    Upload material initial balances,
    Create new Production Orders as of cut off date, say 01.04.2009
    Issues goods to Production Orders created above.
    All the goods/material issued to Production are debited to raw material consumption account.
    The value of WIP can only be ascertained during month-end closing process.
    If it is pressing requirement then upload the balances as of 31.03.2009 and then do a month-end/year-end closing.
    Thanks,
    Srikanth

Maybe you are looking for