How to get Initial Production Order Qty?

Hi Gurus,
I need to stage initial production order quantity in BW. How can i do that? Is there any change record management or table in R/3 from which I can get the Initial Productin order qty?
Regards,
Gaurav

Hi !
I was having a look at "2LIS_04_P_MATNR", 
The underlyning tables for this are AFPO and AFKO.
We have a field "PSMNG" - Item Quantity Order. I think corresponds to your requirment ....
Also, have a look at the folowing link ..
http://help.sap.com/saphelp_nw70/helpdata/EN/88/7fc73c0c52085be10000000a114084/frameset.htm
Hope it helps !
Please update me if it works for you !
Award points if it is helpful.
Regards
Anshul

Similar Messages

  • How to get open production orders by plant wise

    Hi,
    How to get open production orders by plant wise.
    i know from tcode COOIS, is it possible to get from this. if so what are the parameters we have to give to get open production orders by plant wise.
    is there any tcode or tables available , please provide details .
    regards,
    Hari priya

    Hi,
    What is your definition of Open Production Orders?
    Definetly you will get the report from COOIS for Plant wise.
    Whther you want to consider all the Orders having the Status REL but not DLV?
    Then there is a chance of having the Orders, still with PDLV status but GR is done for the full Qty. May be you don't want to consider the TECO status, eventhough the Order is short closed??
    Better to ommit the Orders with CRTD status also..
    So, based on this which status to consider and which status not to consider..
    You can define the "Selection profile status" in BS42.
    Use this selection profile in COOIS, so that the rsults will be accurate..
    Best Regards,
    Siva

  • How to get the Purchase order Qty in the object dependency

    Hi,
    We are using variant pricing in the purchase order. I have condition type say u201CZVBPu201D for Pallet cost. I defined Pallet cost as 5 USD per each (pallet). I have to calculate Number of pallets = Purchase order Qty/ 5. The number of pallets should be rounded to nearest integer.
    My question is how to get the Purchase order Qty in the object dependency?
    Is there any reference table and field can be used to get Purchase order Qty just like we use MMCOM-VKOND for variant pricing.
    Appreciate your help
    Thanks,
    Srini

    Hi,
    1. I do not have system now so I can not conclusively tell about table field .
    2. Since I did it long back so I also do not exactly remember it, there are more than one place where PO qty appears for example Item overview and Item details - one of the PO qty when used in the characteristic do pull the PO qty which can be used for variant pricing (so request to please update the forum with the correct table and field once you find it - in the meantime if I get opportunity to get to system I will also try and find out ).

  • How to get the Open Order Qty value from Transaction Code RWBE?

    Hello,
    Recently I have a program that needs to extract the value of Open Order Qty value from RWBE.
    My specific steps are as follows:
    - I go to tcode <b>RWBE</b>
    - I select the <b>material and plant</b>
    - I tick the checbox for <b>"Also select special stocks"</b> and <b>"Also select stock commitments"</b>
    - I execute the program double click one of the rows for the <b>Unrestricted Use coulmn</b> and view the <b>Open Order Qty</b>.
    My question is how is this particlar variable attained? I tried Ekbe and the ELIKZ feild from EKPO and I still cant seem to get the right value.
    Hope to hear from you soon.
    Thank you and good day.

    check with FM :
    CALL FUNCTION 'MB_ADD_PURCHASE_ORDER_QUANTITY'
           EXPORTING
              x_matnr = t_matnr-matnr         " TGA/4.6 Erw. Lot
              x_meins = t_matnr-basme         " TGA/4.6 Erw. Lot
                x_matnr = prt_matnr-matnr  " TGA/4.6 Erw. Lot
                x_meins = prt_matnr-basme  " TGA/4.6 Erw. Lot
                x_elikz = space
                x_loekz = space
           TABLES
                xtab    = xtab
                xwerks  = r_werks.
    above fm will get open order qty for given material in po

  • How to get all production orders for a workcenter

    Hello ...
    I have a requirement to create a report of all production orders for a given workcenter.  The user enters the workcenter (CRHD-ARBPL), plant (CRHD-WERKS) and a date range, and wants to see a list of orders (AUFNR) that fall within that date range along with some other data from AFKO and AFPO. 
    I can't figure out a good, consistent way to get from workcenter to production orders.
    Any ideas?
    Thanks!
    Sharon

    Hi there check this program for relation between SO PO and Production order
    REPORT z_so_info.
    TABLES: vbak, vbap, afko, afpo.
    *Field catalog
    TYPE-POOLS: slis.
    DATA: lv_repid TYPE sy-repid VALUE sy-repid,
    xfield TYPE slis_t_fieldcat_alv,
    afield TYPE slis_fieldcat_alv.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(25) text-002.
    SELECT-OPTIONS: so_so FOR vbak-vbeln OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-003.
    PARAMETERS:
    p_kunnr LIKE vbak-kunnr, " sold-to
    p_kunwe LIKE vbak-kunnr. " ship-to
    SELECTION-SCREEN END OF BLOCK b2.
    *Constants
    CONSTANTS: c_zor TYPE vbak-auart VALUE 'ZOR',
    c_we TYPE vbpa-parvw VALUE 'WE',
    c_ag TYPE vbpa-parvw VALUE 'AG'.
    * c_space TYPE space.
    *Ranges
    RANGES: ra_parvw FOR vbpa-parvw,
    ra_kunnr FOR vbpa-kunnr.
    *Tables
    DATA: BEGIN OF gt_output OCCURS 0,
    vbeln LIKE vbak-vbeln, " sales order number
    posnr LIKE vbap-posnr, " SO item number
    matnr LIKE vbap-matnr, " material number
    sh LIKE vbpa-kunnr, " Ship-to
    sp LIKE vbpa-kunnr, " Sold-to
    lifnr LIKE ekko-lifnr, " Vendor
    bstnk LIKE vbak-bstnk, " PO number
    banfn LIKE vbep-banfn, " Purchase requi
    po_st TYPE char30, " PO status text
    pstyv TYPE vbap-pstyv, " Item catagory
    aufnr LIKE afpo-aufnr, " Production Order
    prd_stat TYPE string, " Prd order status
    END OF gt_output.
    DATA: wa_output LIKE gt_output.
    FIELD-SYMBOLS: <fs_output> LIKE gt_output.
    *Table for sales order and PO
    TYPES : BEGIN OF gs_data,
    vbeln TYPE vbak-vbeln,
    posnr TYPE vbap-posnr,
    pstyv TYPE vbap-pstyv,
    matnr TYPE vbap-matnr,
    END OF gs_data.
    DATA: gt_data TYPE STANDARD TABLE OF gs_data,
    wa_data TYPE gs_data.
    *Table for Production Orders
    TYPES: BEGIN OF gs_prd,
    aufnr TYPE afpo-aufnr,
    posnr TYPE afpo-posnr,
    kdauf TYPE afpo-kdauf,
    kdpos TYPE afpo-kdpos,
    wepos TYPE afpo-wepos, "Goods Receipt Indicator
    elikz TYPE afpo-elikz, "Delivery Completed Indicator
    objnr TYPE aufk-objnr, "Object number
    * getri TYPE afko-getri, "Confirmed Order Finish Date
    * gltri TYPE afko-gltri, "Actual finish date
    END OF gs_prd.
    DATA: gt_prd TYPE STANDARD TABLE OF gs_prd,
    wa_prd TYPE gs_prd.
    *Table for partner data
    TYPES: BEGIN OF gs_partner,
    vbeln TYPE vbak-vbeln,
    posnr TYPE vbap-posnr,
    parvw TYPE vbpa-parvw,
    kunnr TYPE vbpa-kunnr,
    END OF gs_partner.
    DATA: gt_partner TYPE STANDARD TABLE OF gs_partner,
    wa_partner TYPE gs_partner.
    TYPES: BEGIN OF gs_po,
    ebeln TYPE ekkn-ebeln,
    ebelp TYPE ekkn-ebelp,
    vbeln TYPE ekkn-vbeln,
    vbelp TYPE ekkn-vbelp,
    END OF gs_po.
    DATA: gt_po TYPE STANDARD TABLE OF gs_po,
    wa_po TYPE gs_po.
    TYPES: BEGIN OF gs_preq,
    vbeln TYPE vbep-vbeln,
    posnr TYPE vbep-posnr,
    banfn TYPE vbep-banfn,
    END OF gs_preq.
    DATA: gt_preq TYPE STANDARD TABLE OF gs_preq,
    wa_preq TYPE gs_preq.
    TYPES: BEGIN OF gs_po_stat,
    ebeln TYPE ekko-ebeln,
    procstat TYPE ekko-procstat,
    lifnr TYPE ekko-lifnr,
    END OF gs_po_stat.
    DATA: gt_po_stat TYPE STANDARD TABLE OF gs_po_stat,
    wa_po_stat TYPE gs_po_stat.
    *Field symbols
    FIELD-SYMBOLS: <fs> TYPE tj02t-txt04,
    <fs_temp> TYPE tj02t-txt04,
    <fs_stat> TYPE char30.
    START-OF-SELECTION.
    PERFORM fr_build_range.
    PERFORM fr_get_data.
    PERFORM fr_build_fc.
    PERFORM fr_output.
    *& Form fr_get_data
    * text
    * --> p1 text
    * <-- p2 text
    FORM fr_get_data.
    *Get SO
    SELECT a~vbeln a~posnr a~pstyv a~matnr
    FROM vbap AS a
    JOIN vbak AS b
    ON a~vbeln = b~vbeln
    JOIN vbpa AS c
    ON b~vbeln = c~vbeln
    INTO TABLE gt_data
    WHERE b~vbeln IN so_so
    AND b~auart EQ c_zor "Only Sales Orders
    AND c~kunnr IN ra_kunnr. "from selection screen
    DELETE ADJACENT DUPLICATES FROM gt_data COMPARING vbeln posnr.
    *get data of the production order
    IF NOT gt_data[] IS INITIAL.
    SELECT a~aufnr a~posnr a~kdauf a~kdpos a~wepos a~elikz
    b~objnr
    FROM afpo AS a
    JOIN aufk AS b
    ON a~aufnr = b~aufnr
    INTO TABLE gt_prd
    FOR ALL ENTRIES IN gt_data
    WHERE a~kdauf EQ gt_data-vbeln
    AND a~kdpos EQ gt_data-posnr.
    ENDIF.
    *Get partner data
    IF NOT gt_data[] IS INITIAL.
    SELECT vbeln posnr parvw kunnr
    FROM vbpa
    INTO TABLE gt_partner
    FOR ALL ENTRIES IN gt_data
    WHERE vbeln EQ gt_data-vbeln.
    ENDIF.
    *Get Purchase Order
    IF NOT gt_data[] IS INITIAL.
    SELECT ebeln ebelp vbeln vbelp
    FROM ekkn
    INTO TABLE gt_po
    FOR ALL ENTRIES IN gt_data
    WHERE vbeln EQ gt_data-vbeln
    AND vbelp EQ gt_data-posnr.
    SELECT vbeln posnr banfn
    FROM vbep
    INTO TABLE gt_preq
    FOR ALL ENTRIES IN gt_data
    WHERE vbeln EQ gt_data-vbeln
    AND posnr EQ gt_data-posnr.
    ENDIF.
    IF NOT gt_po[] IS INITIAL.
    SELECT a~ebeln a~procstat a~lifnr
    FROM ekko AS a
    JOIN ekpo AS b
    ON a~ebeln = b~ebeln
    INTO TABLE gt_po_stat
    FOR ALL ENTRIES IN gt_po
    WHERE b~ebeln EQ gt_po-ebeln
    AND b~ebelp EQ gt_po-ebelp.
    ENDIF.
    *Move data to output table
    LOOP AT gt_data INTO wa_data.
    wa_output-vbeln = wa_data-vbeln.
    wa_output-posnr = wa_data-posnr.
    wa_output-pstyv = wa_data-pstyv.
    wa_output-matnr = wa_data-matnr.
    READ TABLE gt_po INTO wa_po WITH KEY vbeln = wa_data-vbeln
    vbelp = wa_data-posnr.
    IF sy-subrc EQ 0.
    wa_output-bstnk = wa_po-ebeln.
    READ TABLE gt_po_stat INTO wa_po_stat WITH KEY ebeln = wa_po-ebeln.
    IF sy-subrc EQ 0.
    wa_output-lifnr = wa_po_stat-lifnr.
    CASE wa_po_stat-procstat.
    WHEN '01'.
    wa_output-po_st = 'Version in process'.
    WHEN '02'.
    wa_output-po_st = 'Active'.
    WHEN '03'.
    wa_output-po_st = 'In release'.
    WHEN '04'.
    wa_output-po_st = 'Partially released'.
    WHEN '05'.
    wa_output-po_st = 'Released Completely'.
    WHEN '08'.
    wa_output-po_st = 'Rejected'.
    ENDCASE.
    ENDIF. "inner read subrc
    ENDIF. "outer read subrc
    READ TABLE gt_preq INTO wa_preq WITH KEY vbeln = wa_data-vbeln
    posnr = wa_data-posnr.
    IF sy-subrc EQ 0.
    wa_output-banfn = wa_preq-banfn.
    ENDIF.
    READ TABLE gt_prd INTO wa_prd WITH KEY kdauf = wa_data-vbeln
    kdpos = wa_data-posnr.
    IF sy-subrc EQ 0.
    wa_output-aufnr = wa_prd-aufnr.
    *get the purchase requisition for production order as well
    SELECT SINGLE banfn
    FROM ebkn
    INTO wa_output-banfn
    WHERE aufnr EQ wa_prd-aufnr.
    *Get the status of the production order
    PERFORM fr_get_prd_stat USING wa_prd-objnr
    CHANGING wa_output-prd_stat.
    ENDIF. " sy-subrc
    READ TABLE gt_partner INTO wa_partner WITH KEY vbeln = wa_data-vbeln
    parvw = c_we.
    IF sy-subrc EQ 0.
    wa_output-sh = wa_partner-kunnr.
    ENDIF.
    READ TABLE gt_partner INTO wa_partner WITH KEY vbeln = wa_data-vbeln
    parvw = c_ag.
    IF sy-subrc EQ 0.
    wa_output-sp = wa_partner-kunnr.
    ENDIF.
    APPEND wa_output TO gt_output.
    CLEAR: wa_data, wa_prd,wa_partner,wa_output.
    ENDLOOP.
    ENDFORM. " fr_get_data
    *& Form fr_build_range
    * text
    * --> p1 text
    * <-- p2 text
    FORM fr_build_range .
    *Range for partner function
    MOVE 'I' TO ra_parvw-sign.
    MOVE 'EQ' TO ra_parvw-option.
    MOVE 'SH' TO ra_parvw-low. " we
    APPEND ra_parvw.
    CLEAR ra_parvw.
    MOVE 'I' TO ra_parvw-sign.
    MOVE 'EQ' TO ra_parvw-option.
    MOVE 'SP' TO ra_parvw-low. " ag
    APPEND ra_parvw.
    CLEAR ra_parvw.
    *Range for ship-to and sold-to
    MOVE 'I' TO ra_kunnr-sign.
    MOVE 'EQ' TO ra_kunnr-option.
    MOVE p_kunnr TO ra_kunnr-low.
    APPEND ra_kunnr.
    CLEAR ra_kunnr.
    MOVE 'I' TO ra_kunnr-sign.
    MOVE 'EQ' TO ra_kunnr-option.
    MOVE p_kunwe TO ra_kunnr-low.
    APPEND ra_kunnr.
    CLEAR ra_kunnr.
    ENDFORM. " fr_build_range
    *& Form fr_build_fc
    * text
    * --> p1 text
    * <-- p2 text
    FORM fr_build_fc .
    * sales order number
    afield-fieldname = 'VBELN'.
    afield-seltext_s = 'Sales #'.
    afield-ref_tabname = 'VBAK'.
    APPEND afield TO xfield. CLEAR afield.
    * sales ITEM number
    afield-fieldname = 'POSNR'.
    afield-seltext_s = 'Item #'.
    afield-ref_tabname = 'VBAP'.
    APPEND afield TO xfield. CLEAR afield.
    * Material Number
    afield-fieldname = 'MATNR'.
    afield-seltext_s = 'Material #'.
    afield-ref_tabname = 'VBAP'.
    afield-outputlen = 10.
    APPEND afield TO xfield. CLEAR afield.
    *Vendor Number
    afield-fieldname = 'LIFNR'.
    afield-seltext_s = 'Vendor Num.'.
    afield-ref_tabname = 'EKKO'.
    APPEND afield TO xfield. CLEAR afield.
    * ship-to-party
    afield-fieldname = 'SH'.
    afield-seltext_s = 'Ship-to'.
    afield-ref_tabname = 'VBPA'.
    APPEND afield TO xfield. CLEAR afield.
    * sold-to-party
    afield-fieldname = 'SP'.
    afield-seltext_s = 'Sold-to'.
    afield-ref_tabname = 'VBPA'.
    APPEND afield TO xfield. CLEAR afield.
    *PO number
    afield-fieldname = 'BSTNK'.
    afield-seltext_s = 'PO NUM'.
    afield-ref_tabname = 'EKKO'.
    APPEND afield TO xfield. CLEAR afield.
    *PO status
    * afield-fieldname = 'PO_STAT'.
    * afield-seltext_s = 'Step'.
    * afield-ref_tabname = 'zbacklog_v2'.
    * APPEND afield TO xfield. CLEAR afield.
    *PO step status
    afield-fieldname = 'PO_ST'.
    afield-seltext_s = 'PO.Status'.
    afield-ref_tabname = 'zbacklog_v2'.
    APPEND afield TO xfield. CLEAR afield.
    *Purchase requisition
    afield-fieldname = 'BANFN'.
    afield-seltext_s = 'Pur. Req.'.
    afield-ref_tabname = 'VBEP'.
    APPEND afield TO xfield. CLEAR afield.
    *Item catagory
    afield-fieldname = 'PSTYV'.
    afield-seltext_s = 'Itm. Catg'.
    afield-ref_tabname = 'VBAP'.
    APPEND afield TO xfield. CLEAR afield.
    *Prodcution Order number
    afield-fieldname = 'AUFNR'.
    afield-seltext_m = 'Prod.Order'.
    afield-ref_tabname = 'AFKO'.
    APPEND afield TO xfield. CLEAR afield.
    *PRODCUTION status
    afield-fieldname = 'PRD_STAT'.
    afield-seltext_s = 'Prd. Step'.
    afield-ref_tabname = 'zbacklog_v2'.
    afield-outputlen = 20.
    APPEND afield TO xfield. CLEAR afield.
    *PRODUCTION step status
    * afield-fieldname = 'PRD_ST'.
    * afield-seltext_s = 'Prd. Status'.
    * afield-ref_tabname = 'zbacklog_v2'.
    * APPEND afield TO xfield. CLEAR afield.
    ENDFORM. " fr_build_fc
    *& Form fr_output
    * text
    * --> p1 text
    * <-- p2 text
    FORM fr_output .
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    i_callback_program = sy-repid
    * I_CALLBACK_PF_STATUS_SET = ' '
    * I_CALLBACK_USER_COMMAND = ' '
    * I_STRUCTURE_NAME =
    * IS_LAYOUT =
    it_fieldcat = xfield[]
    i_default = 'X'
    i_save = 'A'
    TABLES
    t_outtab = gt_output
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    ENDFORM. " fr_output
    *& Form fr_get_prd_stat
    * text
    * -->P_WA_PRD_OBJNR text
    FORM fr_get_prd_stat USING p_objnr CHANGING p_prd_stat.
    DATA: lt_status TYPE STANDARD TABLE OF jstat,
    wa_status TYPE jstat,
    lv_status TYPE tj02t-txt04,
    lv_temp2 TYPE char5,
    lv_buff TYPE string.
    CALL FUNCTION 'STATUS_READ'
    EXPORTING
    client = sy-mandt
    objnr = p_objnr
    only_active = 'X'
    TABLES
    status = lt_status
    EXCEPTIONS
    object_not_found = 1
    OTHERS = 2.
    LOOP AT lt_status INTO wa_status.
    IF wa_status-stat(1) EQ 'I'.
    SELECT txt04 FROM tj02t
    INTO lv_status
    WHERE istat EQ wa_status-stat
    AND spras EQ 'E'.
    ENDSELECT.
    lv_temp2 = lv_status.
    CONCATENATE lv_temp2 p_prd_stat INTO p_prd_stat
    SEPARATED BY ','.
    ENDIF.
    CLEAR: wa_status, lv_status, lv_temp2.
    ENDLOOP.
    lv_buff = p_prd_stat.
    *Status of Production Order
    IF lv_buff CS 'CRTD'.
    p_prd_stat = 'Not Active'.
    ENDIF.
    IF lv_buff CS 'REL'.
    IF lv_buff CS 'GMPS'.
    p_prd_stat = 'Printed In Prod'.
    ELSE.
    p_prd_stat = 'Printed'.
    ENDIF.
    ENDIF.
    IF lv_buff CS 'TECO'.
    p_prd_stat = 'Technically Compt.'.
    ENDIF.
    ENDFORM. " fr_get_prd_stat

  • Confirmation of the production order qty equal to sales order qty

    Hi Experts,
    I need to control the confirmation of the production order should be equal to sales order qty.
    I'm having the scenario as follows
    If sale order qty for X material = 3
    while running the MRP, system will plan the order qty as 8 because of we maintained rounding profile in the Material master and enhancement we used for this.
    Rounding Profile Qty=5
    Total Production Order Qty=8.
    But, finally they will do the GRN for sales order qty only, remaining will be used for testing purpose.
    So, the confirmation also has to happen for only sales order qty. There, we need to control the qty based on the sales order.
    Is there any exit or Enhancement is available for this.
    Please help me.
    Naren

    Hi,
    Exit for confirmation check is CONFPP04.
    However, opening orders for quantities higher than demand and leaving pieces undelivered and unconfirmed in production orders does not make sense. I could not get the requirement of incresing production quantity by adding rounding value? Moreover, if rounding is to be used for test purposes, why not do you receive them into stock? Why don't you receive 8 pieces into stock, deliver 3 pieces to sales order and transfer 5 pieces to related department?
    If it is because of MRP and you really do not want to produce extra 5 piece immediately, you may use material reservation or any other form of demand for 5 pieces, use EX for lot size calculation and have MRP create two planned orders for sales order and testing requirement, then you can convert planned order for sales order requirement into production order and continue processing.
    Regards.

  • How to check the Production order exits

    Hi Experts
    Modification to processing of Command Orders & Tickets
    We require a modification to the processing being performed on sales data originating from the Command Concrete system and potentially from other systems yet to come online (e.g. Pinkenba Cement plant).
    The Sap process involved is ZINT_INBOUND_POLLING and within that, ZINT_CSTPORD_ROUTINES.
    The problem
    Currently there is an assumption that every sales order (and its deliveries) will include a product which is made to order, i.e. for which a production order will be required.
    In ZINT_CSTPORD_ROUTINES, a check is made to identify the production order linked to the sales order. If there is no such production order (usually because of the customeru2019s credit status) then processing of the ticket is terminated.
    This assumption would fall down if an order was to be raised (in Command) on which there is no concrete material. For example, if we sold a bag of pigment or a screed to a customer. In this case the item would be sold from stock and there would be no need for a production order.
    The solution
    In the routine which checks for the existence of a production order, modify the code as follows:
    Inspect each item on the sales order
    If (and only if) there is at least one item with a category of u201CZTACu201D then check for a production order, otherwise process the order in the usual manner.
    ----  ZINT_CSTPORD_ROUTINES -
    *&      Form  process_inbound_data
          Create prod. orders from ticket data extracted from the COMMAND
          system. Note that large portions of the code in this routine
          have been copied from the retired ZPPU_COMMAND_PRODUCTION
          interface program. This was done (1) because the old code works
          and (2) to save development time.
         -->T_ZINT_IDATA  Internal table of interface data
         -->T_ZINT_PARAM  Internal table of interface parameters
         -->T_ZINT_MSLOG  Internal table of messages
         -->P_ZINT_ID     Interface ID
         -->P_ZINT_TY     Inteface type
         -->P_ZINT_IS     IDOC group for interface
         -->P_ZINT_DL     Flag: delete IDOC group when complete
         -->P_ZINT_AL     Flag: run in standalone mode
         -->P_ZINT_NW     Flag: do not log warning messages
         -->P_ZINT_SQ     Interface sequence number
         <--P_ZINT_RC     Return code (<>0=>error)
    form process_inbound_data  tables   t_zint_idata structure zint_idata
                                        t_zint_param structure zint_param
                                        t_zint_mslog structure zint_mslog
                               using    p_zint_id    type      zint_id
                                        p_zint_ty    type      zint_ty
                                        p_zint_is    type      zint_is
                                        p_zint_dl    type      zint_dl
                                        p_zint_al    type      zint_al
                                        p_zint_nw    type      zint_nw
                                        p_zint_sq    type      zint_sq
                               changing p_zint_rc    type      zint_rc.
    program is continuing .............
    I WANT TO WRITE A CODING HERE **********************
    CHECK IF PRODUCTION ORDER REQUIRED
              IF NOT THEN GO TO PERFORM UPDATE DATA
      if production order required then check
                    for each item on sales order item list
                          with item category = 'ZTAC' then
                                     return true
                                next
                                  end function
        if there is no production code
               these has to be check from VBAP TABLE field VBELN and PSTYV (ZTAC,ZTAN Etc)
      select * from Vbap WHERE VBELN = '00000269951' and VBAP.PSTYV = 'ZTAC','ZTAN' Etc
    No production order?
        elseif lva_prodord is initial.
          clear v_messg.
          call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
            exporting
              input  = lva_filemat
            importing
              output = lva_filemat.
        No production order found - log a warning message.
          concatenate 'Production Order not be found for'
                      'Command order' lva_cmdord
                      'Material'      lva_filemat
                      'Customer'      lwa_02-customer
            into v_messg separated by space.
          perform write_log_entry
            tables t_zint_mslog
            using  'E' 'ZINT_CSTPORD_ROUTINES'
                       'FIND_SAP_PRODORD'
                         v_messg
                         p_zint_nw
                         lwa_01-ticketnumber.                " RJS
          continue.
        endif.
    Production Order WAS found... Continue creating IDOCS
        lwa_hdrlevel-postg_date = lwa_01-ticketdate.
    Obtain the storage location parameter value.
        read table t_zint_param with key zint_fn = 'LGORT'.
        if sy-subrc ne c_noerr.
          perform write_log_entry
            tables t_zint_mslog
            using  'E' 'ZINT_CSTPORD_ROUTINES'
                       'PROCESS_INBOUND_DATA'
                       'Parameter LGORT is missing from ZINT_PARAM'
                       p_zint_nw
                       lwa_01-ticketnumber.                " RJS
          exit.
        endif.
        loop at l_it_05 into lwa_05
          where ticketnumber = lwa_01-ticketnumber.
          clear lwa_gm_item_create.
          lva_filemat = lwa_05-material.
          if lva_filemat eq lva_prodmat.
            concatenate 'Command ticket-' lwa_05-ticketnumber
              into lwa_hdrlevel-conf_text.
            lwa_hdrlevel-conf_quan_unit = lwa_05-unitofmeasure.
            lwa_hdrlevel-yield          = lwa_05-quantity.
    check whether the confirmed value + current delivery value is equal *
    the production order qty. If the production order value is less
    than the total delivered value, set final conf indicator  and clear
    reservations
            lva_wemng = lva_wemng + lwa_05-quantity.
            if lva_wemng < lva_psmng.
              lwa_hdrlevel-clear_res      = c_false.
              lwa_hdrlevel-fin_conf       = ' '.
            else.
              lwa_hdrlevel-clear_res      = c_true.
              lwa_hdrlevel-fin_conf       = 'X'.
            endif.
            move: 'Z1BP_PP_HDRLEVEL' to t_idoc_data-segnam,
                  lwa_hdrlevel       to t_idoc_data-sdata.
            append t_idoc_data.
            clear lva_formmat.
            lva_formmat                   = lwa_05-material.
            lwa_gm_item_create-material   = lva_formmat.
            lwa_gm_item_create-plant      = lwa_03-plant.
            lwa_gm_item_create-ref_date   = lwa_01-ticketdate.
            lwa_gm_item_create-prod_date  = lwa_01-ticketdate.
            lwa_gm_item_create-move_type  = '101'.
            lwa_gm_item_create-spec_stock = 'E'.
            lwa_gm_item_create-sales_ord  = lva_saleord.
            lwa_gm_item_create-entry_qnt  = lwa_05-quantity.
            lwa_gm_item_create-entry_uom  = lwa_05-unitofmeasure.
            lwa_gm_item_create-orderid    = lva_prodord.
            lwa_gm_item_create-move_mat   = lva_formmat.
            lwa_gm_item_create-move_plant = lwa_03-plant.
            lwa_gm_item_create-mvt_ind    = 'F'.
            clear t_idoc_data.
            move: 'E1BP2017_GM_ITEM_CREATE' to t_idoc_data-segnam,
                  lwa_gm_item_create        to t_idoc_data-sdata.
            append t_idoc_data.
          else.
            clear: lva_loggr,
                   lva_formmat.
            lva_formmat = lwa_05-material.
            select single loggr into lva_loggr from marc
              where matnr = lva_formmat
              and   werks = lwa_03-plant.
            if sy-subrc ne 0.
              clear v_messg.
              No logistics handling group - log a warning message.
              concatenate 'No logistics handling group for material'
                           lva_formmat
                          'in plant'
                           lwa_03-plant
                into v_messg separated by space.
              perform write_log_entry
                tables t_ldata
                using 'W' 'ZINT_CSTPORD_ROUTINES'
                          'PROCESS_INBOUND_DATA'
                          v_messg
                          p_zint_nw
                          lwa_01-ticketnumber.                " RJS
              clear lva_loggr.
            endif.
            if lwa_03-satsur eq 'T'.
              lwa_e1edl21-lprio = 30.
            else.
              lwa_e1edl21-lprio = 20.
            endif.
          else.
            if lwa_03-satsur eq 'T'.
              lwa_e1edl21-lprio = 10.
            else.
              lwa_e1edl21-lprio = '  '.
            endif.
          endif.
          lwa_e1edl21-berot = lwa_04-driver.
          move: 'E1EDL21'   to t_idoc_data-segnam,
                lwa_e1edl21 to t_idoc_data-sdata.
          append t_idoc_data.
          lwa_e1edl55-qualf = '001'.
          lwa_e1edl55-refnr = lva_saleord.
          move: 'E1EDL55'   to t_idoc_data-segnam,
                lwa_e1edl55 to t_idoc_data-sdata.
          append t_idoc_data.
    Loop at materials - create delivery entry for each
          loop at l_it_05 into lwa_05
            where ticketnumber = lwa_01-ticketnumber.
            clear t_idoc_data.
            lwa_e1edl24-matnr = lwa_05-material.
            lwa_e1edl24-werks = lwa_03-plant.
            lwa_e1edl24-vfdat = lwa_01-ticketdate.
            lwa_e1edl24-lfimg = lwa_05-quantity.
            lwa_e1edl24-vrkme = lwa_05-unitofmeasure.
            lwa_e1edl24-lgort = t_zint_param-zint_fv.
            clear lva_loggr.
            lva_formmat = lwa_05-material.
            clear lva_loggr.
            select single loggr into lva_loggr from marc
              where matnr = lva_formmat
              and   werks = lwa_03-plant.
            if sy-subrc ne 0.
            No logistics handling group - log a warning message.
              concatenate 'No logistics handling group for material'
                           lva_formmat
                          'in plant'
                           lwa_03-plant
                into v_messg separated by space.
              perform write_log_entry
                tables t_ldata
                using 'W' 'ZINT_CSTPORD_ROUTINES'
                          'PROCESS_INBOUND_DATA'
                          v_messg
                          p_zint_nw
                          lwa_01-ticketnumber.                " RJS
              lva_loggr = 'BBIN'.
            endif.
            if lva_loggr is initial.
              move: 'E1EDL24'   to t_idoc_data-segnam,
                    lwa_e1edl24 to t_idoc_data-sdata.
              append t_idoc_data.
            endif.
          endloop.
          clear: lva_xabln,
                 lva_vbeln,
                 l_vbfa.
    Matching ticket against a Delivery?
          select single xabln vbeln into (lva_xabln,lva_vbeln) from likp
              where xabln = lwa_01-ticketnumber.
          if sy-subrc = 0.
    If found, does this delivery match the sales order?
            select * from vbfa into l_vbfa
              where vbelv = lva_saleord
              and   vbeln = lva_vbeln.
              exit.
            endselect.
          endif.
    No matching delivery found, or Matching delivery, but for other Sls Ord
          if lva_xabln is initial
          or ( lva_vbeln <> space and l_vbfa is initial ).
            if not lva_saleord is initial.
              perform create_delivery_idocs tables t_zint_mslog
                                            using  s_idcgp
                                                   lwa_01-ticketnumber
                                                   p_zint_nw.
            else.
              concatenate 'Error finding a Sales Order for ticket "'
                          lwa_01-ticketnumber
                          '" reprocess the file AFTER'
                          ' the sales order issues have been fixed'
              into        lva_outtext.
              perform write_log_entry tables t_zint_mslog
                                      using  'E'
                                             'ZINT_CSTPORD_ROUTINES'
                                             'PROCESS_INBOUND_DATA'
                                             lva_outtext
                                             p_zint_nw
                                             lwa_01-ticketnumber. " RJS
            endif.
          else.
            concatenate 'Command Ticket "'
                        lwa_01-ticketnumber
                        '" has already been processed into delivery "'
                        lva_vbeln
            into        lva_outtext.
            perform write_log_entry tables t_zint_mslog
                                    using  'I'
                                           'ZINT_CSTPORD_ROUTINES'
                                           'PROCESS_INBOUND_DATA'
                                           lva_outtext
                                           p_zint_nw
                                           lwa_01-ticketnumber. " RJS
            refresh t_idoc_data.
          endif.
        endif.
        refresh t_idoc_data.
    Write out all messages collected so far
        perform update_data tables t_zint_mslog
                            using p_zint_id p_zint_ty.
      endloop.
    Write out all messages collected so far
      perform update_data tables t_zint_mslog
                          using p_zint_id p_zint_ty.
    endform.                    " process_inbound_data
    Thnaks
    Regards

    Thanks
    Thread closed

  • Production Order qty in Report Painter

    Can we get Production Order qty in Report Painter?
    I have tried and used couple of Libaries but the values are not getting updated in report.
    Can anybody please tell me which Library and Table combination to to get the result.
    Kami

    Hi
    Prod order qty (Target / Plan / Actual) is available in KKO0 reports
    To activate them:
    a. OKN0: Assign a cost comp str here and choose Product Group = Material Group.. Transport this setting
    b. Run KKRV every month after period end settlements are over...
    c. Finally execute KKO0 reports
    b and c you need to do every month... a is one time setting
    br, Ajay M

  • How to get the back order quantity for sales Order

    Hi Friends,
    I want to get the back order quantity for sales order . in MD04 t-code,
    there is a field(MDEZ-MNG01) for Received Qty/ Required qty.  But MDEZ is a structure.
    I tried from MDTB table, but the table is not updated with the values in MD04.
    Please guide me from which table I can get the back order Qty for sales Order
    (ref: t-code  MD04, MRP element = CusOrd).
    Thanks,
    Sagar

    >
    VIdya Sagar wrote:
    > Hi,
    >
    > Isn't  there any difference b/n Open Sales Order and Back order??
    Yes Quite Difference.
    Read:
    http://www.sap-img.com/sap-sd/explain-the-meaning-of-an-open-sales-order.htm
    http://help.sap.com/saphelp_sbo2005asp1/helpdata/en/b6/bdb9b2f02842348c9edbe78af863c4/content.htm

  • Traceability from customer invoice to initial production order

    Scenario :  We have activated  basic management for  Raw material, semi finished, Finished materials. (fert, halb, herb)  Semi finished material is sent from one plant to other plant  and finally
    invoice raised to customer at receiving plant.  We need to track the Initial production order for an invoice or for supplies made during a particular period. 
    In routing we have 22 operations both in house and external with separate semi-finished codes.
    Ex:  Material A u2013 Inhouse,  Material B u2013 External,  Material C u2013 Inhouse etc.,
    Bill of Material maintained respectively.  
    Ex: Semi-Finished code X
    .1            B     EXTERNAL
    ..2           A     IN HOUSE
    After doing in house operations A material is inwarded to a location and sent to subcontractor against 541 movement.  Here the Batches are entered manually.
    After receipt of Material B from subcontractor Again one more production order is released with purchase order as reference in batch .
    After In house operations Material X is moved to Location and Stock Transfer Invoice raised to
    other plant. By doing VL10B.
    Bill of material at receiving plant
    Receiving plant Finished code  Y
    .1         S     EXTERNAL
    .2         R     IN HOUSE
    .3         X       STOCK TRANSFERRED MATERIAL RECEIVED
    MIGO is done at receiving plant with reference to outbound delivery.
    Production order is released at receiving plant under R material and X will be issued.
    MIGO done against production order and  and R  material sent to Subcontractor with production order as reference in Batch.
    S material is received from subcontractor with Purchase order as reference in batch.
    Production order released on Y material and S material is issued.
    MIGO is done for Y material against production order with production order number as Batch.
    Invoice raised for Y material with reference as Production order as Batch.
    Here We need to track the Initial Production order.
    Advance thanks for suggetions/advice
    regards
    hari

    Hi,
    Use the batch where used list for the batch .T code MB56.It will give the entire history of that batch incuding in the prduction orders. You will be having the batch number of raw material , you cdan use this for the purpose.
    Also may this link will be useful for finding out the production order number.
    http://www.sap-img.com/production/table-of-the-order-production-operation.htm
    Regards,

  • Excess Qty confirmation than Production order qty

    Hi
    SAP Experts
    Is it possible to confirm excess qty of yield in co11n against Production order qty.
    pl. guide me the steps required.
    with Best Regards
    Yogesh

    Yes,
    If you do not waht to conform excess qty than the production order qty, then the following are the options
    - as our friend told in Work scheduling view the under/over delivery tolerance should be zero and unlimited delivery tick should not be active
    - In production order the under/over delivery tolerance should be zero and unlimited delivery tick should not be active.
    - In OPK4 fior the combintaion of plant and order type the following confirmation parameters are to be maintained
    Under delivery - X error if qty below under delivery tolarance
    Over delivery - X error if qty above over delivery tolarance.
    With this settings you can avoid what you wanted.

  • I need Checking in Production Order Qty

    Hi all,
    In our industry we are creating Production Order From Sales Order (MTO Scenario) by using T.Code CO08 or CO01 T.Code with out running MRP.Now if anybody intend to change the PO qty by using CO02 T.Code system allows and as a result the Sales Order Qty and Production Order qty mismatch.Now please give me solution so that anybody cannot change the production order qty and it must be same as sales order qty.
    I am waiting for your valuable suggestion.
    Thanks & Regards
    Nirmal Sharma

    Hi,
    1. I dont think this is possible in any standard configuration.
    2. You can utilise the exit   EXIT_SAPLCOBT_001 and write our logic inside that
    3. This exit is validated when ever we save the order,
    4. The abap code should be written such that each time it should check for the sales order / itme no and check the quanity to be matching if it fails it should give error
    note: in this case if you are trying to creat multiple production order for one single salesorder/item number then it will not be possible or another logic is to be incorporated.
    reg
    satheesh

  • In inprocess inspection lets say the production order qty is 20. i would want only 1 no. to be inspected while inprocess inspection is configured. kindly guide. Regards,Mathew

    In inprocess inspection lets say the production order qty is 20. i would want only 1 no. out of the 20 to be inspected while inprocess inspection is configured. kindly guide.
    Thanks in Advance
    Regards,
    Mat

    Hi Mathew,
    Create sampling procedure with fixed sample and give sample size = 1. Assign this sampling procedure for the characteristics of the in-process materials in Routing/Master Recipe etc. For sample size calculation at-least one characteristic should be required characteristic for the Material.
    Thanks&Regards,
    kumar

  • How can mass creating production orders???

    In SAP ,we can use CO01,CO09,CO07 to create production order. But by these TOCDES,we only can create one production order for one finished product once a time.
    But we now need to create more then one ,may be more then 50 production orders once a time?
    It is possible in SAP?
    I know we could conver the production orders from plan orders after MRP run.But sometimes
    for some reasons we must create produciton orders manually.And I also know in SAP some TCODE can process many production orders once a time ,like COHV,CORM, can release ,TECO many production orders once a time.
    But how can mass creating production orders once a time,not by mrp run?
    How can batch create produciton orders in SAP?
    Thanks for any reply!

    Hi,
    Use the BAPI - BAPI_PRODORD_CREATE or for internal orders BAPI_INTERNALORDER_CREATE
    Take the help of your abaper, he / she can use the above BAPI to write a custom program to mass create production order.
    Hope the above helps.
    Regards,
    Vivek
    Added
    You can also use the below BAPI's in your custom program:
    BAPI_PRODORD_RELEASE to release the orders
    BAPI_PRODORD_CHECK_MAT_AVAIL for carrying out material availability
    Edited by: Vivek on Mar 22, 2009 8:27 PM

  • Production Order Qty- Inspection Lot Qty

    Hi Guru's,
    When an  production order is relreased an inspection lot is creaetd with the production Qty. But later when we change Qty for  the released Prodction Order the inspection lot  Qty is not changes it remains the same as previous Order Qty.
    Say for Ex: intial Prod  order qty (MTS Scenario) is 200 (production order released). Inspection lot Qty is 200.
    Later  User changes the Qty to  100. Our problem is the inspection lot qty  does not change ramins the same as 200. Can inspection lot qty be changed automically on change of production order qty .
    What settings need to change? pls advise
    Regards,
    Sankaran
    Edited by: Sankaran M on Oct 10, 2008 9:41 AM

    Hi Sankaran,
    It is possible if the user not doing any result against existing lot.
    Follow the Below step.
    Your Existing order Qty = 200 Nos Inspection lot no 300000200.
    Now you want change the Qty as 200 to 100.
    Before change the qty, first you have to delete the Inspection lot Go to CO02 -> Got to menu Functions -> Inspection lot -> Delete.
    Now change the Qty 100.
    And Again go to Functions -> Inspection Lot -> Create. and save the order.
    Now system will delete the Old indpection lot and create the new inspection lot.
    Qty : 100 Inspection Lot 300000201.
    Revert further clarification.
    Regards,
    S.Babusingh

Maybe you are looking for

  • Passing values to sub VI and writing data to controls

    As part of a control interface for a VFD i am interfacing with using Modbus TCP I wanted to try and compartmentalise some of my code into a subVi However in doing so I am having a lot of trouble understanding how I can read the current drive settings

  • [CS3 JS] Working with two documents of the same name

    I work with sets of documents that use standardized names. I'm trying to write a script that compares two documents from different sets. Because the source and the target documents both have the same name, I've encountered some disturbing behavior th

  • How to master to a DVCPRO50 deck

    Help from the Forum I'm mastering to a DVCPRO50 deck, Panasonic SD-93 and my question is, do I need to have the timeline settings set to DV50? My usual timeline settings are DV/DVCPRO NTSC. I normally master to a Sony DSR40 onto DVCAM and when I used

  • Audit of Java Class, Resource, and Source

    We are currently at 10.1.0.5 on Win@K3 server, and are implementing DIACAP requirements. One of the finding states we need to add auditing of objects and they gave us the script to implement this: AUDIT ALL BY ACCESS; AUDIT ALL PRIVILEGES BY ACCESS;

  • Standalone program utlising 100 percent CPU time

    We are struck with a problem, our standalone program is occupying most of cpu time and limiting existing processes access to cpu. We need to bring down cpu utilization of the process. Java program when run polls to MQ, gets the xml message from mq, s