Open orders,deliveries,

Hi
SD Gurus,
how to find out the open orders, opend deliveries and open billing documents plse explain on this
regards,
RAMU.G

Hi
Open Enquiries - VA15
Open Quotations - VA25
Open Sales Order - VA05
Open Deliveries - VL05
Oen Billing Docs - Vf05
Open Inv Lists - VF25
SE16 - TAble VBBE for open documents
Regards

Similar Messages

  • Expiring Lot-Controlled items and open orders/deliveries

    <h5> Hi,
    We are writing a custom program to block lot-controlled items which are near expiry. The custom program query LQUA-VERME (available stock) field to determine the qty it can block. However, the LQUA-VERME field does not take open orders and open deliveries into consideration. For example, for an item, the available stock in the warehouse (LQUA-VERME) is 20. But there are 5 open deliveries and 5 open sales orders. So in reality, the custom program should block only 10 units. Is there a SD table/field which has consolidated open deliveries and open orders qty we can look at? Or available stock in WM after considering open deliveries and open orders? <h5>
    Thank you.

    Hi,
    SAP does availability check based on IM stock and not on WM stock.
    So I dont think there are any such reports available that shows WM stock with considering delivery and sales order quantity.
    regards,

  • Open Orders data in Sales Overview Cube

    Hi All,
    I am using Sales Overview cube to store all the Orders(inclucing Open orders), Deliveries and billing data. I am using seperate ODSs(for all the infosources) to store both the header and item level data for some reporting requirements.
    But I am very confused how the cube gonna store the data of open orders i.e if we are loading data on monday and we got Order 100 as open order. But on tuesday the order was completley processed and it is no longer an open order. So what will happen when I load data on tuesday. How does the changes to Order 100 reflect in the cube?
    Any help would be highly appreciated and rewarded!!!
    Best Regards,
    Nene.

    hi Nene
    All orders where delivery qty is less than Order qty are open orders
    All the orders which appear in the transaction V.15 in R/3 are Backorders
    Execute the transaction after giving sales order, dist chan and division
    All orders with document type RE are returns
    Suggestion :
    1. Create a restriction in ur queries with document types = OR,,,, other order types( Not RE..see last )and and Order qty < dly qty for open orders
    2. You can extract data from V.15 into a BW customised table and check the entries to identify the backorders
    Routine in update rule may help to distinguish backorders
    3. You can use filter to identify the items returned from the customers
        For document type = RE
    Assign points if useful
    Regards
    N Ganesh

  • How to find open orders with amount and open deliveries?

    Hi All,
    I want to find out the open orders with open amount and open deliveries for a particular customer.
    We need this for credit check purpose.
    Kindly guide us for this.
    Regards,
    Satish.

    Hi,
    To find out open order:
    data: c_bef_pgi(1) TYPE c VALUE 'A',
    RANGES: rg_wbstk FOR vbuk-wbstk."range for wbstk
      rg_wbstk-sign = 'I'.
      rg_wbstk-option = 'EQ'.
      rg_wbstk-low = 'C'.
      APPEND rg_wbstk.
      rg_wbstk-low = 'A'.
      APPEND rg_wbstk.
    1.first put query on vbak table
    2.Put query on vbuk table as
          SELECT vbeln bestk lfstk gbstk FROM vbuk
                  INTO TABLE it_vbuk_open
                  FOR ALL ENTRIES IN it_vbak
                  WHERE vbeln = it_vbak-vbeln AND
                        bestk IN rg_wbstk AND
                        lfstk = c_bef_pgi.
    so this wil give u open orders.
    3. Then according to vbuk, get the details from vbap.
    To find open delivery
    1. First put query on vbak table
    2. Put query on vbfa as
      SELECT vbelv posnv vbeln posnn vbtyp_n vbtyp_v FROM vbfa
                 INTO TABLE it_vbfa
                 FOR ALL ENTRIES IN it_vbak
                 WHERE vbelv = it_vbak-vbeln AND
                       vbtyp_n = 'J' AND
                       vbtyp_v = 'C'.
    3.Then from VBfa,get the details from LIkp
    4.Then put entry on vbuk as
    *entries from vbuk
          SELECT vbeln wbstk fkstk gbstk FROM vbuk
                 INTO TABLE it_vbuk_del
                 FOR ALL ENTRIES IN it_likp
                 WHERE vbeln = it_likp-vbeln AND
                       wbstk IN rg_wbstk AND
                       fkstk = c_bef_pgi.
    Thanks & Regards,
    Anagha Deshmukh

  • Open Orders and blocked deliveries

    Hi,
    We have different blocks in Deliveries. The requirements is deliveries which are blocked i.e delivery created but no picking and PGI happened,should be visible as open orders as they will take the total quantity required for the open orders for  production planning and other reports.
    How to do this?
    If any customized report to be prepared, how can we check that the order will be going for a block due to credit?
    Regards,
    Ajit

    Dear Ajit
    You can see a standard report VL21 in which all deliveries created but not PGId will be displayed.  For the status of the delivery, you can check in LIKP table.
    thanks
    G. Lakshmipathi

  • Open orders,open deliveries againist material-urgent

    Hi
        My requirement is to find out open orders,open deliveries againist a material for a specific time period.
    wat is the process to get this data.
    and later on the quantity we get from open ordes,open deliveries should be deducted from total stock (as of today)
    So can anybody explain where and how this rqt can be achieved?
    Thanks in Advance
    Arpitha

    Dear arpita
    run T.Codes VA05 or VA05N and execute.  You will get order quantity and also open order quantity during that period. For open deliveries, run T.Code VL06 or VL06G
    Alternatively, you can also generate via SE16 and tables like VBBE, S001, S004 etc., for open quantity.
    thanks
    G. Lakshmipathi

  • Excluding open sales order & Deliveries in Credit management

    Hi All,
           I dont want to update all the open sales orders and deliveries in sales value in FD32. For this I have done the configuration and it is working fine. But after the configuration, system will delete the existing records in S066 & S067 and will not create records further even we create new sale order, del & inv.
    Now I want to know wether there will be any problem if the records in S066 & S067 were deleted and will not be created further. And I also want to know wether the data in these infostructures (S066 & S067) were used anywhere in the system or not?
    Kindly help me out in this.
    Ratna

    Hi,
        My requirement is while doing credit check system should consider only open invoices, not sales order or deliveries. For this I did the following.
        After running the program all my records in S066 & S067 will be deleted as I have deleted the update group under credit control area. Giving blank in update group under credit control area, will not update any open sales values or deliveries in FD32 for freshly created documents. But already there will be some existing open orders & del in the system which will show as sales value in FD32. This value will not be cleared for ever as there was no update group. So I want to clear these sales value in FD32. So I will run the program after deleting the update group and so the system will delete all the records in S066 & S067 and sales value will be zero in FD32 which is as per requirement.
    Now I want to know will there be any problem by deleting this records. Wethere these records are anywhere used in the system other than FD32???
    Kindly update
    Ratna

  • Open Order Quantity by partial deliveries in 2LIS_02_SGR/CGR/SCN/ITM

    members,
    One of our customers uses now in BW the following Datasources for Purchase Orders:
    2LIS_02_SGR
    2LIS_02_CGR
    2LIS_02_SCN
    2LIS_02_ITM
    This seems to be done via the standard way of working,
    These 4 Datasources go to the DSO 0PUR_O01
    The data of this DSO goes via another DSO (ZPUR_O01) to the purchase cube ZPUR_C07
    In the DSO all values are overwritten, so you have the latest values.
    I expected the field "Current goods receipt quantity in order unit" (= /BIC/OW_AKTWE_DA) to be the total.
    But it is the latest value
    What I need is the open quantity for an order/position:
    In case of partial deliveries I see that you have the value of the last delivery.
    As I want to have the open order quantity in reports, is it necessary to make an extra field in the DSO (based on Goods receipts), but then with a summation rule?
    Or are there better options to realize this?
    I also see the field OPNQTY(= Open Amount of Schedule Line (after Goods Mvmnt Assignment)) in the Datasources 2LIS_02_SGR
    2LIS_02_CGR which is not used currently.
    I might oversee something trivial as the open order quantity is an important keyfigure report about.
    If you have any idea, let me know.
    Thx in advance,
    Ben J.

    Dear Anand
    This might be happen, when your data sources is not active in LBWE .
    Ex: You have maintained your setup initialization, at the time all the DS might not be active. Hence those DS only have the data in RSA3. In Future if you want to go with some other DS, you delete the setup table once and once again you need to fill the setup.
    Hence i request you to delete & reload the setup table, and try in RSA3
    Regards
    Raju Saravanan

  • Massive Deletion of Open Sales Orders/Deliveries

    Hi, I was wondering if anyone knows a massive transaction to delete open sales orders and deliveries.
    I try using de MASS transaccion but here I can only reject the items (in sales orders) but the thing is that the customer wants the open orders and deliveries to be deleted.
    Could anyone help me please?
    Thanks and regards!
    Lore

    Hi,
    You can only delete a complete sales document or delivery if there are no subsequent documents. For example, you could not delete a complete sales document if items had already been delivered and therefore, delivery documents had been created.
    If you want to delete a sales document, you effectively remove it from the database which means that it is no longer possible to analyze it. Therefore, its recommend that you work with reasons for rejection. Being the case it can be considered to reject the items rather.
    Hope it helps.
    Thanks & Regards
    Sadhu Kishore

  • List of open sales order deliveries

    Hi Gurus
    I'm trying to fetch the list of open sales order relevant deliveries in the system. Is there any standard report to fetch the same?
    In the current requirement, we have tried the below logic:
    Join table VLPMA & VBUK at VBELN
    VLPMA u2013 Pass MATNR(Material) & LFART(Delivery Type) and fetch VBELN values
    VBUK u2013 VBELN values from above with WBSTK(Goods Movement status) Not Equal to C {open deliveries}
    LIPS u2013 Pass VBELN from above and MATNR & WERKS to fetch open sales order relevant deliveries for a material in a plant.
    The above logic takes a lot of time to execute and hence the report has performance issue. Is there any other means to link the multiple fields in the Deliveries to fetch, only sales order deliveries that are still open?
    Regards
    Deepak Prasanna S

    Hi
    You can also enhance tcode VA05 and create your variants to filter these SO. See these notes
    SAP Note 37871 - List display of open sales documents
    SAP Note 350068 - Additionl fields in VA05:Customer material number as example
    So, you'd have a list with the pending orders.
    I hope this helps you
    Regards
    Eduardo
    Edited by: E_Hinojosa on Mar 6, 2012 10:01 AM

  • Report showing Open Orders and Open deliveries

    Hi all,
    i need a report that shows open orders - whether with subsequent delivery or not.
    Is there such a report?
    regards
    RM

    Hi,
    Goto the T.Code VA05/VA05n T.Code.In this T.Code select the option as "Open orders".
    Execute.
    It will give you all the orders that are open means doesn't have any subsequent orders.
    Goto the T.Code "VF04".
    In this select the check box "Delivery related".
    Execute.
    It gives you all the orders which have delivery but doesn't have any billing document.
    Regards,
    Krishna.

  • How to get the open order quantity for a material

    Hi All,
    We need to get the open order quantity for materials. At present we are using the following logic...
    SELECT VBAKVBELN VBAPPOSNR VBAP~KWMENG                 
        INTO TABLE IT_VBAP                                     
      FROM VBAP
      INNER JOIN VBAK ON VBAKVBELN   = VBAPVBELN             
      INNER JOIN VAPMA ON VAPMAVBELN = VBAPVBELN
                      AND VAPMAPOSNR = VBAPPOSNR
      INNER JOIN VBUP ON VBUPVBELN = VBAPVBELN
                     AND VBUPPOSNR = VBAPPOSNR
    WHERE VAPMA~MATNR = IT_OUTPUT-MATNR
       AND VAPMA~WERKS = IT_OUTPUT-WERKS
        AND VBAK~AUART  IN S_AUART                        
         AND VBUP~GBSTA NE 'C'.     
    But the Query takes quite a long time as it does a full range scan on all the tables. Is there any way the query can be improved, may be by creating an index etc? Or is there anyother way by which i can get the required data?
    Any input is appreciated.
    Regards
    Brain.

    This could help.
    *& Report: zsdvr055                date written: 03/24/00              *
    *& Author: Brian Huntley           last update: 03/24/00               *
    *& Program Title: Open Order Report                                    *
    *& Description: This report will create a list of sales documents      *
    *&   that are open (contain at least one item that is not shipped).    *
    *&   The report will sort by ship-to customer name and by sales        *
    *&   document number.                                                  *
    *& Tables:                                                             *
    *& Files:                                                              *
    *& Transactions:                                                       *
    *& Changes:                                                            *
    REPORT ZSDVR055 LINE-SIZE 255.
    TABLES: VBPA,
            VBAP,
            VBUP,
            VBAK,
            VBKD,
            KNA1,
            VBEP,
            VBFA,
            LIKP,
            LIPS,
            EKET,
            T171T.
    define hashed table for selected ship-to and sold-to SO's
    TYPES: BEGIN OF TVBPA_TYPE,
             VBELN LIKE VBPA-VBELN,               "sales document
             POSNR LIKE VBPA-POSNR,               "item number
             PARVW LIKE VBPA-PARVW,               "partner function
             KUNNR LIKE VBPA-KUNNR,               "customer number
           END OF TVBPA_TYPE.
    DATA: TVBPA TYPE HASHED TABLE OF TVBPA_TYPE
            WITH UNIQUE KEY VBELN POSNR PARVW WITH HEADER LINE.
    define internal table for all selected SO's
    DATA: BEGIN OF ITAB0 OCCURS 0,
            VBELN LIKE VBPA-VBELN,                "sales document
          END OF ITAB0.
    define internal table for all selected SO items
    DATA: BEGIN OF ITAB OCCURS 0,
            VBELN LIKE VBAP-VBELN,                "document number
            POSNR LIKE VBAP-POSNR,                "item number
            MATNR LIKE VBAP-MATNR,                "material
            ARKTX LIKE VBAP-ARKTX,                "description
            PSTYV LIKE VBAP-PSTYV,                "item category
            KDMAT LIKE VBAP-KDMAT,                "customer material
            NETWR LIKE VBAP-NETWR,                "net value
            WAERK LIKE VBAP-WAERK,                "currency
            KWMENG LIKE VBAP-KWMENG,              "quantity
            ERDAT LIKE VBAP-ERDAT,                "entry date
            NETPR LIKE VBAP-NETPR,                "net price
            KPEIN LIKE VBAP-KPEIN,                "pricing unit
            PRCTR LIKE VBAP-PRCTR,                "profit center
            ERNAM LIKE VBAK-ERNAM,                "entered by
            AUART LIKE VBAK-AUART,                "order type
            VKORG LIKE VBAK-VKORG,                "sales organization
            VTWEG LIKE VBAK-VTWEG,                "distribution channel
            VDATU LIKE VBAK-VDATU,                "requested date (header)
            BNAME LIKE VBAK-BNAME,                "name of orderer
            KUNNR LIKE VBAK-KUNNR,                "sold-to customer
            BZIRK LIKE VBKD-BZIRK,                "sales district
            KURSK LIKE VBKD-KURSK,                "conversion rate
            BSTKD LIKE VBKD-BSTKD,                "customer PO
            LFGSA LIKE VBUP-LFGSA,                "overall delivery status
            FKSAA LIKE VBUP-FKSAA,                "overall billing status
            KUNWE LIKE VBPA-KUNNR,                "ship-to customer
            NAME1 LIKE KNA1-NAME1,                "ship-to customer name
            ORT01 LIKE KNA1-ORT01,                "ship-to address
            REGIO LIKE KNA1-REGIO,                "ship-to region (state)
            LAND1 LIKE KNA1-LAND1,                "ship-to country
          END OF ITAB.
    create internal table for open orders
    DATA: BEGIN OF ITAB1 OCCURS 0,
            KUNNR LIKE VBAK-KUNNR,                "sold-to customer
            KUNWE LIKE VBPA-KUNNR,                "ship-to customer
            VBELN LIKE VBAP-VBELN,                "document number
            POSNR LIKE VBAP-POSNR,                "item number
            ZDATE1 LIKE VBEP-EDATU,               "requested date
            ZDATE2 LIKE VBEP-EDATU,               "scheduled date (confirm)
            ZDATE3 LIKE VBEP-EDATU,               "committed date
            ZQTY1 LIKE VBAP-KWMENG,               "qty ordered
            ZQTY2 LIKE VBEP-BMENG,                "backlog qty
            ZEXTD LIKE VBAP-NETWR,                "backlog net value
            ZDESC(30) TYPE C,                     "backlog description
          END OF ITAB1.
    define internal table for SO schedule lines
    DATA: BEGIN OF ITAB2A OCCURS 0,
            WADAT LIKE VBEP-WADAT,                "planned goods issue date
            VBELN LIKE VBAP-VBELN,                "document number
            POSNR LIKE VBAP-POSNR,                "item number
            WMENG LIKE VBEP-WMENG,                "qty ordered
            BMENG LIKE VBEP-BMENG,                "qty confirmed
          END OF ITAB2A.
    define internal table for SO item request dates
    DATA: BEGIN OF ITAB2B OCCURS 0,
            EDATU LIKE VBEP-EDATU,                "delivery date
            VBELN LIKE VBAP-VBELN,                "document number
            POSNR LIKE VBAP-POSNR,                "item number
            WMENG LIKE VBEP-WMENG,                "qty ordered
          END OF ITAB2B.
    define internal table for SO item commit dates
    DATA: BEGIN OF ITAB2C OCCURS 0,
            EDATU LIKE VBEP-EDATU,                "delivery date
            VBELN LIKE VBAP-VBELN,                "document number
            POSNR LIKE VBAP-POSNR,                "item number
            ROMS1 LIKE VBEP-WMENG,                "committed qty
          END OF ITAB2C.
    define internal table for SO item deliveries
    DATA: BEGIN OF ITAB3 OCCURS 0,
            VGBEL LIKE LIPS-VGBEL,                "sales document
            VGPOS LIKE LIPS-VGPOS,                "sales document item
            VBELN LIKE LIKP-VBELN,                "delivery number
            POSNR LIKE LIPS-POSNR,                "delivery item number
            WADAT LIKE LIKP-WADAT,                "planned GI date
            WADAT_IST LIKE LIKP-WADAT_IST,        "actual GI date
            LFIMG LIKE LIPS-LFIMG,                "actual qty delivered
            ERDAT LIKE LIKP-ERDAT,                "date created
            ERZET LIKE LIKP-ERZET,                "time created
          END OF ITAB3.
    define internal table for SO item / delivery cross reference
    DATA: BEGIN OF ITAB4 OCCURS 0,
            VBELV LIKE VBFA-VBELV,                "sales document
            POSNV LIKE VBFA-POSNV,                "sales document item
            VBELN LIKE VBFA-VBELN,                "delivery number
            POSNN LIKE VBFA-POSNN,                "delivery item
            VBTYP_N LIKE VBFA-VBTYP_N,            "document category
            RFMNG LIKE VBFA-RFMNG,                "qty delivered
            PLMIN LIKE VBFA-PLMIN,                "plus/minus flag
          END OF ITAB4.
    define local variables
    DATA: ORDR_QTY LIKE VBEP-WMENG,          "order qty
          CONF_QTY LIKE VBEP-BMENG,          "confirmed qty
          NOCONF_QTY LIKE VBEP-BMENG,        "qty not confirmed
          DELV_QTY LIKE VBEP-WMENG,          "qty delivered
          NODELV_QTY LIKE VBEP-WMENG,        "qty not delivered
          REMAIN_QTY LIKE VBEP-WMENG,        "qty remain to get conf date
          REQ_DATE LIKE VBEP-EDATU,          "request date
          COM_DATE LIKE VBEP-EDATU,          "committed date
          DELV_QTY1 LIKE VBEP-WMENG,         "preceding delivery qty
          REMAIN_QTY1 LIKE VBEP-WMENG,       "qty remain to get reqest date
          REMAIN_QTY2 LIKE VBEP-WMENG,       "qty remain to get commit date
          THIRD_QTY LIKE VBEP-WMENG,         "3rd party no PO qty
          SO_STOCK LIKE MSKA-KALAB,          "sales order stock
          ZPRICE LIKE VBAP-NETPR,            "unit price USD
          ADRS1(40) TYPE C,                  "concatenated city and region
          ADRS2(45) TYPE C,                  "city, region and country
          ADRS3(80) TYPE C,                  "name, city, rgn, ctry
          ZCNTR TYPE I.                      "counter
    define select options
    SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS: S_VKORG FOR VBAK-VKORG DEFAULT '1000',
      S_VTWEG FOR VBAK-VTWEG DEFAULT '10' NO-DISPLAY,
      S_SPART FOR VBAK-SPART DEFAULT '00' NO-DISPLAY,
      S_KUNNR FOR VBPA-KUNNR MATCHCODE OBJECT DEBI,
      S_KUNWE FOR VBPA-KUNNR MATCHCODE OBJECT DEBI.
    SELECTION-SCREEN SKIP.
    SELECT-OPTIONS:
      S_BZIRK FOR VBKD-BZIRK,
      S_PRCTR FOR VBAP-PRCTR,
      S_MATNR FOR VBAP-MATNR MATCHCODE OBJECT MAT1,
      S_ERNAM FOR VBAK-ERNAM,
      S_ERDAT FOR VBAP-ERDAT.
    SELECTION-SCREEN END OF BLOCK BLK1.
    AT SELECTION-SCREEN.
      IF S_KUNNR IS INITIAL AND S_KUNWE IS INITIAL.
        MESSAGE E005(ZM) WITH TEXT-100.
      ENDIF.
    MAIN PROGRAM
    INITIALIZATION.
      INCLUDE ZSYHEADR.
    START-OF-SELECTION.
      PERFORM 100_GET_SO_ITEMS.
      PERFORM 200_GET_NO_DELIVERY.
      PERFORM 300_GET_NO_GOODS_ISSUE.
      PERFORM 400_GET_PARTIAL_DELIVERY.
      PERFORM 500_GET_THIRD_PARTY.
      PERFORM 900_CREATE_LIST.
    FORM 100_GET_SO_ITEMS
    FORM 100_GET_SO_ITEMS.
    get SO's for selected ship-to and sold-to customers
      REFRESH TVBPA.
      IF NOT S_KUNNR IS INITIAL.
        SELECT VBELN POSNR PARVW KUNNR
          FROM VBPA INTO TABLE TVBPA
         WHERE KUNNR IN S_KUNNR AND PARVW = 'AG' AND VBELN < '0080000000'.
      ENDIF.
      IF NOT S_KUNWE IS INITIAL.
        SELECT VBELN POSNR PARVW KUNNR
          FROM VBPA APPENDING TABLE TVBPA
          WHERE KUNNR IN S_KUNWE AND PARVW = 'WE' AND VBELN < '0080000000'.
      ENDIF.
      DESCRIBE TABLE TVBPA LINES ZCNTR.
      IF ZCNTR = 0.
        WRITE: /1 'No data found for selection'.
        STOP.
      ENDIF.
    eliminate duplicate SO's
      LOOP AT TVBPA.
        CLEAR ITAB0.
        MOVE TVBPA-VBELN TO ITAB0-VBELN.
        APPEND ITAB0.
      ENDLOOP.
      DELETE ADJACENT DUPLICATES FROM ITAB0.
    get SO detail
      SELECT VBAP~VBELN VBAP~POSNR VBAP~MATNR VBAP~ARKTX VBAP~PSTYV
          VBAP~KDMAT VBAP~NETWR VBAP~WAERK VBAP~KWMENG VBAP~ERDAT
          VBAP~NETPR VBAP~KPEIN VBAP~PRCTR VBAK~ERNAM VBAK~AUART
          VBAK~VKORG VBAK~VTWEG VBAK~VDATU VBAK~BNAME VBAK~KUNNR
          VBKD~BZIRK VBKD~KURSK VBKD~BSTKD VBUP~LFGSA VBUP~FKSAA
        FROM VBAP INNER JOIN VBUP ON VBUP~VBELN = VBAP~VBELN AND
            VBUP~POSNR = VBAP~POSNR
          INNER JOIN VBKD ON VBKD~VBELN = VBAP~VBELN AND
            VBKD~POSNR = VBAP~POSNR
          INNER JOIN VBAK ON VBAK~VBELN = VBAP~VBELN
        INTO TABLE ITAB FOR ALL ENTRIES IN ITAB0
        WHERE VBAP~VBELN = ITAB0-VBELN AND VBAP~MATNR IN S_MATNR AND
          VBAP~ERDAT IN S_ERDAT AND VBAP~PRCTR IN S_PRCTR AND
          VBAP~ABGRU = SPACE AND VBKD~BZIRK IN S_BZIRK AND
          VBAK~VKORG IN S_VKORG AND VBAK~VTWEG IN S_VTWEG AND
          VBAK~SPART IN S_SPART AND VBAK~KUNNR IN S_KUNNR AND
          VBAK~ERNAM IN S_ERNAM.
      IF SY-SUBRC <> 0.
        WRITE: /1 'No data found for selection'.
        STOP.
      ENDIF.
    loop thru SO items
      LOOP AT ITAB.
    get ship-to customer
        IF NOT S_KUNWE IS INITIAL.
          CLEAR TVBPA.
          READ TABLE TVBPA WITH TABLE KEY VBELN = ITAB-VBELN
            POSNR = ITAB-POSNR PARVW = 'WE'.
          IF SY-SUBRC <> 0.
            READ TABLE TVBPA WITH TABLE KEY VBELN = ITAB-VBELN
              POSNR = '000000' PARVW = 'WE'.
          ENDIF.
          MOVE TVBPA-KUNNR TO ITAB-KUNWE.
        ELSE.
          CLEAR ITAB-KUNWE.
          SELECT SINGLE KUNNR FROM VBPA INTO ITAB-KUNWE
            WHERE VBELN = ITAB-VBELN AND POSNR = ITAB-POSNR AND
              PARVW = 'WE'.
          IF SY-SUBRC <> 0.
            SELECT SINGLE KUNNR FROM VBPA INTO ITAB-KUNWE
              WHERE VBELN = ITAB-VBELN AND POSNR = '000000' AND
                PARVW = 'WE'.
          ENDIF.
        ENDIF.
        IF NOT ITAB-KUNWE IN S_KUNWE.
          DELETE ITAB.
          CONTINUE.
        ENDIF.
    get ship-to customer address info
        SELECT SINGLE NAME1 ORT01 REGIO LAND1 FROM KNA1
          INTO (ITAB-NAME1, ITAB-ORT01, ITAB-REGIO, ITAB-LAND1)
          WHERE KUNNR = ITAB-KUNWE.
        MODIFY ITAB.
      ENDLOOP.
      SORT ITAB BY VBELN POSNR.
    ENDFORM.
    FORM 200_GET_NO_DELIVERY
    get detail for SO items w/ no deliveries for order document types
      (ZZOR, ZZC1, ZZCO, ZZRP, ZZRW, KE, KR, ZCHP, ZPSO, ZZNC)
    FORM 200_GET_NO_DELIVERY.
      LOOP AT ITAB WHERE AUART = 'ZZOR' OR AUART = 'ZZC1' OR
        AUART = 'ZZCO' OR AUART = 'ZZRP' OR AUART = 'ZZRW' OR
        AUART = 'KE' OR AUART = 'KR' OR AUART = 'ZCHP' OR
        AUART = 'ZPSO' OR AUART = 'ZZNC'.
    select if delivery status = A (not delivered)
        IF ITAB-LFGSA = 'A'.
    assign values to detail fields
          CLEAR ITAB1.
          ITAB1-KUNNR = ITAB-KUNNR.
          ITAB1-KUNWE = ITAB-KUNWE.
          ITAB1-VBELN = ITAB-VBELN.
          ITAB1-POSNR = ITAB-POSNR.
          IF ITAB-KURSK = 0.
            ITAB-KURSK = 1.
          ENDIF.
          IF ITAB-KPEIN = 0.
            ITAB-KPEIN = 1.
          ENDIF.
    select schedule lines for SO item and write to internal table itab2a
          SELECT WADAT VBELN POSNR WMENG BMENG
            FROM VBEP INTO TABLE ITAB2A
            WHERE VBELN = ITAB-VBELN AND POSNR = ITAB-POSNR.
    select sched lines w/request date and write to internal table itab2b
          SELECT EDATU VBELN POSNR WMENG
            FROM VBEP INTO TABLE ITAB2B
            WHERE VBELN = ITAB-VBELN AND POSNR = ITAB-POSNR AND
              WMENG <> 0.
    select sched lines w/commit date and write to internal table itab2c
          SELECT EDATU VBELN POSNR ROMS1
            FROM VBEP INTO TABLE ITAB2C
            WHERE VBELN = ITAB-VBELN AND POSNR = ITAB-POSNR AND
              ROMS1 <> 0.
          SORT ITAB2A BY WADAT.
          SORT ITAB2B BY EDATU.
          SORT ITAB2C BY EDATU.
          ORDR_QTY = 0.
          CONF_QTY = 0.
          NOCONF_QTY = 0.
    calculate the unconfirmed qty for a SO item
          LOOP AT ITAB2A.
            CONF_QTY = CONF_QTY + ITAB2A-BMENG.
            ORDR_QTY = ORDR_QTY + ITAB2A-WMENG.
          ENDLOOP.
          NOCONF_QTY = ORDR_QTY - CONF_QTY.
          LOOP AT ITAB2A WHERE BMENG <> 0.
            PERFORM GET_REQUEST_DATE TABLES ITAB2B
              USING ITAB2A-BMENG REQ_DATE.
            PERFORM GET_COMMIT_DATE TABLES ITAB2C
              USING ITAB2A-BMENG COM_DATE.
            ITAB1-ZDATE1 = REQ_DATE.
            ITAB1-ZDATE2 = ITAB2A-WADAT.
            ITAB1-ZDATE3 = COM_DATE.
            ITAB1-ZQTY1 = ITAB-KWMENG.
            ITAB1-ZQTY2 = ITAB2A-BMENG.
            ITAB1-ZDESC = 'no delivery, confirmed'.
    calculate net value for backlog qty
            ZPRICE = ( ITAB-NETPR / ITAB-KPEIN ) * ITAB-KURSK.
            ITAB1-ZEXTD = ITAB1-ZQTY2 * ZPRICE.
    if order type is consignment return (KR), reverse sign
            IF ITAB-AUART = 'KR'.
              ITAB1-ZQTY1 = ITAB1-ZQTY1 * -1.
              ITAB1-ZQTY2 = ITAB1-ZQTY2 * -1.
              ITAB1-ZEXTD = ITAB1-ZEXTD * -1.
            ENDIF.
            APPEND ITAB1.
          ENDLOOP.
    get request date for SO item
          IF NOCONF_QTY <> 0.
            PERFORM GET_REQUEST_DATE TABLES ITAB2B
              USING NOCONF_QTY REQ_DATE.
            PERFORM GET_COMMIT_DATE TABLES ITAB2C
              USING NOCONF_QTY COM_DATE.
            ITAB1-ZDATE1 = REQ_DATE.
            ITAB1-ZDATE2 = '99991231'.
            ITAB1-ZDATE3 = COM_DATE.
            ITAB1-ZQTY1 = ITAB-KWMENG.
            ITAB1-ZQTY2 = NOCONF_QTY.
            ITAB1-ZDESC = 'no delivery, not confirmed'.
    calculate net value for backlog qty
            ZPRICE = ( ITAB-NETPR / ITAB-KPEIN ) * ITAB-KURSK.
            ITAB1-ZEXTD = ITAB1-ZQTY2 * ZPRICE.
    if order type is consignment return (KR), reverse sign
            IF ITAB-AUART = 'KR'.
              ITAB1-ZQTY1 = ITAB1-ZQTY1 * -1.
              ITAB1-ZQTY2 = ITAB1-ZQTY2 * -1.
              ITAB1-ZEXTD = ITAB1-ZEXTD * -1.
            ENDIF.
            APPEND ITAB1.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDFORM.
    FORM 300_GET_NO_GOODS_ISSUE
    get detail for SO items w/deliveries and no goods issue for
      doc types (ZZOR, ZZC1, ZZCO, ZZRP, ZZRW, KE, KR, ZCHP, ZPSO, ZZNC)
    FORM 300_GET_NO_GOODS_ISSUE.
    get detail for deliveries w/no goods issue
      SELECT VBELN WADAT WADAT_IST ERDAT ERZET
        FROM LIKP INTO (LIKP-VBELN, LIKP-WADAT, LIKP-WADAT_IST,
          LIKP-ERDAT, LIKP-ERZET)
        WHERE WADAT_IST = 0.
    select if actual qty delivered <> 0
        CLEAR LIPS.
        SELECT POSNR VGBEL VGPOS LFIMG
          FROM LIPS INTO (LIPS-POSNR, LIPS-VGBEL, LIPS-VGPOS, LIPS-LFIMG)
          WHERE VBELN = LIKP-VBELN AND LFIMG <> 0.
    select if goods movement status on delivery = A (no goods issue)
          CLEAR VBUP.
          SELECT SINGLE WBSTA FROM VBUP INTO VBUP-WBSTA
            WHERE VBELN = LIKP-VBELN AND POSNR = LIPS-POSNR.
          IF VBUP-WBSTA = 'A'.
            CLEAR ITAB3.
            ITAB3-VGBEL = LIPS-VGBEL.
            ITAB3-VGPOS = LIPS-VGPOS.
            ITAB3-VBELN = LIKP-VBELN.
            ITAB3-POSNR = LIPS-POSNR.
            ITAB3-WADAT = LIKP-WADAT.
            ITAB3-WADAT_IST = LIKP-WADAT_IST.
            ITAB3-LFIMG = LIPS-LFIMG.
            ITAB3-ERDAT = LIKP-ERDAT.
            ITAB3-ERZET = LIKP-ERZET.
            APPEND ITAB3.
          ENDIF.
        ENDSELECT.
      ENDSELECT.
      SORT ITAB3 BY VGBEL VGPOS VBELN POSNR.
    loop thru deliveries w/no goods issue and get SO item detail
      LOOP AT ITAB3.
        CLEAR ITAB.
        READ TABLE ITAB WITH KEY VBELN = ITAB3-VGBEL POSNR = ITAB3-VGPOS.
        IF SY-SUBRC <> 0.
          IF ITAB-AUART = 'ZZOR' OR ITAB-AUART = 'ZZC1' OR
            ITAB-AUART = 'ZZCO' OR ITAB-AUART = 'ZZRP' OR
            ITAB-AUART = 'ZZRW' OR ITAB-AUART = 'KE' OR
            ITAB-AUART = 'KR' OR ITAB-AUART = 'ZCHP' OR
            ITAB-AUART = 'ZPSO' OR ITAB-AUART = 'ZZNC'.
    assign values to detail fields
            CLEAR ITAB1.
            ITAB1-KUNNR = ITAB-KUNNR.
            ITAB1-KUNWE = ITAB-KUNWE.
            ITAB1-VBELN = ITAB-VBELN.
            ITAB1-POSNR = ITAB-POSNR.
            IF ITAB-KURSK = 0.
              ITAB-KURSK = 1.
            ENDIF.
            IF ITAB-KPEIN = 0.
              ITAB-KPEIN = 1.
            ENDIF.
    select delivery qty for SO item and write to internal table
            SELECT VBELV POSNV VBELN POSNN VBTYP_N RFMNG PLMIN
              FROM VBFA INTO TABLE ITAB4
              WHERE VBELV = ITAB-VBELN AND POSNV = ITAB-POSNR AND
                ( VBTYP_N = 'J' OR VBTYP_N = 'T' ).
    calculate total delivery qty for SO item
            DELV_QTY = 0.
            DELV_QTY1 = 0.
            LOOP AT ITAB4.
              IF ITAB4-VBTYP_N = 'J' OR ( ITAB4-VBTYP_N = 'T' AND
                  ITAB-AUART = 'KR').
                IF ITAB4-PLMIN = '-'.
                  ITAB4-RFMNG = ITAB4-RFMNG * -1.
                ENDIF.
    determine if delivery for SO item precedes delivery w/no goods
      issue (to determine request date and qty)
                CLEAR LIKP.
                SELECT SINGLE ERDAT ERZET
                  FROM LIKP INTO (LIKP-ERDAT, LIKP-ERZET)
                  WHERE VBELN = ITAB4-VBELN.
                IF LIKP-ERDAT < ITAB3-ERDAT OR ( LIKP-ERDAT = ITAB3-ERDAT
                    AND LIKP-ERZET < ITAB3-ERZET ).
                  DELV_QTY1 = DELV_QTY1 + ITAB4-RFMNG.
                ENDIF.
                DELV_QTY = DELV_QTY + ITAB4-RFMNG.
              ENDIF.
            ENDLOOP.
    get request dates for SO item
            REFRESH ITAB2B.
            SELECT EDATU VBELN POSNR WMENG
              FROM VBEP INTO TABLE ITAB2B
              WHERE VBELN = ITAB-VBELN AND POSNR = ITAB-POSNR AND
                WMENG <> 0.
    select sched lines w/commit date and write to itab2c
            REFRESH ITAB2C.
            SELECT EDATU VBELN POSNR ROMS1
              FROM VBEP INTO TABLE ITAB2C
              WHERE VBELN = ITAB-VBELN AND POSNR = ITAB-POSNR AND
                ROMS1 <> 0.
            SORT ITAB2B BY EDATU.
            SORT ITAB2C BY EDATU.
    loop thru request dates and delete request date entries for
      quantity(s) for preceding deliveries
            REMAIN_QTY1 = DELV_QTY1.
            LOOP AT ITAB2B.
              IF ITAB2B-WMENG > REMAIN_QTY1.
                ITAB2B-WMENG = ITAB2B-WMENG - REMAIN_QTY1.
                MODIFY ITAB2B.
                EXIT.
              ELSEIF ITAB2B-WMENG = REMAIN_QTY1.
                DELETE ITAB2B.
                EXIT.
              ELSE.
                REMAIN_QTY1 = REMAIN_QTY1 - ITAB2B-WMENG.
                DELETE ITAB2B.
              ENDIF.
            ENDLOOP.
    loop thru commit dates and delete commit date entries for
      quantity(s) for preceding deliveries
            REMAIN_QTY2 = DELV_QTY1.
            LOOP AT ITAB2C.
              IF ITAB2C-ROMS1 > REMAIN_QTY2.
                ITAB2C-ROMS1 = ITAB2C-ROMS1 - REMAIN_QTY2.
                MODIFY ITAB2C.
                EXIT.
              ELSEIF ITAB2C-ROMS1 = REMAIN_QTY2.
                DELETE ITAB2C.
                EXIT.
              ELSE.
                REMAIN_QTY2 = REMAIN_QTY2 - ITAB2C-ROMS1.
                DELETE ITAB2C.
              ENDIF.
            ENDLOOP.
    if planned goods issue date is 0, put qty in non-confirmed
    get request date for SO item
            IF ITAB3-WADAT <> 0.
              PERFORM GET_REQUEST_DATE TABLES ITAB2B
                USING ITAB3-LFIMG REQ_DATE.
              PERFORM GET_COMMIT_DATE TABLES ITAB2C
                USING ITAB3-LFIMG COM_DATE.
              ITAB1-ZDATE1 = REQ_DATE.
              ITAB1-ZDATE2 = ITAB3-WADAT.
              ITAB1-ZDATE3 = COM_DATE.
              ITAB1-ZQTY1 = ITAB-KWMENG.
              ITAB1-ZQTY2 = ITAB3-LFIMG.
              ITAB1-ZDESC = 'delivery, no goods issue'.
            ELSE.
              PERFORM GET_REQUEST_DATE TABLES ITAB2B
                USING ITAB3-LFIMG REQ_DATE.
              PERFORM GET_COMMIT_DATE TABLES ITAB2C
                USING ITAB3-LFIMG COM_DATE.
              ITAB1-ZDATE1 = REQ_DATE.
              ITAB1-ZDATE2 = '99991231'.
              ITAB1-ZDATE3 = COM_DATE.
              ITAB1-ZQTY1 = ITAB-KWMENG.
              ITAB1-ZQTY2 = ITAB3-LFIMG.
              ITAB1-ZDESC = 'delivery, no goods issue date'.
            ENDIF.
    calculate net value for backlog qty
            ZPRICE = ( ITAB-NETPR / ITAB-KPEIN ) * ITAB-KURSK.
            ITAB1-ZEXTD = ITAB1-ZQTY2 * ZPRICE.
    if order type is consignment return (KR), reverse sign
            IF ITAB-AUART = 'KR'.
              ITAB1-ZQTY1 = ITAB1-ZQTY1 * -1.
              ITAB1-ZQTY2 = ITAB1-ZQTY2 * -1.
              ITAB1-ZEXTD = ITAB1-ZEXTD * -1.
            ENDIF.
            APPEND ITAB1.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDFORM.
    FORM 400_GET_PARTIAL_DELIVERY
    get detail for SO items w/partial deliveries for document types
      (ZZOR, ZZC1, ZZCO, ZZRP, ZZRW, KE, KR, ZCHP, ZPSO, ZZNC)
    FORM 400_GET_PARTIAL_DELIVERY.
    process SO items for selected order types
      LOOP AT ITAB WHERE AUART = 'ZZOR' OR AUART = 'ZZC1' OR
          AUART = 'ZZCO' OR AUART = 'ZZRP' OR AUART = 'ZZRW' OR
          AUART = 'KE' OR AUART = 'KR' OR AUART = 'ZCHP' OR
          AUART = 'ZPSO' OR AUART = 'ZZNC'.
    select if delivery status = B (partially delivered)
        IF ITAB-LFGSA = 'B'.
    assign values to detail fields
          CLEAR ITAB1.
          ITAB1-KUNNR = ITAB-KUNNR.
          ITAB1-KUNWE = ITAB-KUNWE.
          ITAB1-VBELN = ITAB-VBELN.
          ITAB1-POSNR = ITAB-POSNR.
          IF ITAB-KURSK = 0.
            ITAB-KURSK = 1.
          ENDIF.
          IF ITAB-KPEIN = 0.
            ITAB-KPEIN = 1.
          ENDIF.
    select delivery qty for SO item and write to internal table
          SELECT VBELV POSNV VBELN POSNN VBTYP_N RFMNG PLMIN
            FROM VBFA INTO TABLE ITAB4
            WHERE VBELV = ITAB-VBELN AND POSNV = ITAB-POSNR AND
              ( VBTYP_N = 'J' OR VBTYP_N = 'T' ).
    calculate total delivery qty for SO item
          DELV_QTY = 0.
          LOOP AT ITAB4.
            IF ITAB4-VBTYP_N = 'J' OR ( ITAB4-VBTYP_N = 'T' AND
                ITAB-AUART = 'KR').
              IF ITAB4-PLMIN = '-'.
                ITAB4-RFMNG = ITAB4-RFMNG * -1.
              ENDIF.
              DELV_QTY = DELV_QTY + ITAB4-RFMNG.
            ENDIF.
          ENDLOOP.
    select schedule lines for SO item and write to internal table
          REFRESH ITAB2A.
          SELECT WADAT VBELN POSNR WMENG BMENG
            FROM VBEP INTO TABLE ITAB2A
            WHERE VBELN = ITAB-VBELN AND POSNR = ITAB-POSNR.
    get request dates from schedule line table
          REFRESH ITAB2B.
          SELECT EDATU VBELN POSNR WMENG
            FROM VBEP INTO TABLE ITAB2B
            WHERE VBELN = ITAB-VBELN AND POSNR = ITAB-POSNR AND
              WMENG <> 0.
    get commit dates from schedule line table
          REFRESH ITAB2C.
          SELECT EDATU VBELN POSNR ROMS1
            FROM VBEP INTO TABLE ITAB2C
            WHERE VBELN = ITAB-VBELN AND POSNR = ITAB-POSNR AND
              ROMS1 <> 0.
          SORT ITAB2B BY EDATU.
          SORT ITAB2C BY EDATU.
          SORT ITAB2A BY WADAT.
    loop thru request dates and delete request date entries for
      quantity(s) already delivered
          REMAIN_QTY1 = DELV_QTY.
          LOOP AT ITAB2B.
            IF ITAB2B-WMENG > REMAIN_QTY1.
              ITAB2B-WMENG = ITAB2B-WMENG - REMAIN_QTY1.
              MODIFY ITAB2B.
              EXIT.
            ELSEIF ITAB2B-WMENG = REMAIN_QTY1.
              DELETE ITAB2B.
              EXIT.
            ELSE.
              REMAIN_QTY1 = REMAIN_QTY1 - ITAB2B-WMENG.
              DELETE ITAB2B.
            ENDIF.
          ENDLOOP.
    loop thru commit dates and delete request date entries for
      quantity(s) already delivered
          REMAIN_QTY2 = DELV_QTY.
          LOOP AT ITAB2C.
            IF ITAB2C-ROMS1 > REMAIN_QTY2.
              ITAB2C-ROMS1 = ITAB2C-ROMS1 - REMAIN_QTY2.
              MODIFY ITAB2C.
              EXIT.
            ELSEIF ITAB2C-ROMS1 = REMAIN_QTY2.
              DELETE ITAB2C.
              EXIT.
            ELSE.
              REMAIN_QTY2 = REMAIN_QTY2 - ITAB2C-ROMS1.
              DELETE ITAB2C.
            ENDIF.
          ENDLOOP.
           ORDR_QTY = 0.
           CONF_QTY = 0.
           NOCONF_QTY = 0.
    calculate the unconfirmed qty for SO item
          LOOP AT ITAB2A.
            ORDR_QTY = ORDR_QTY + ITAB2A-WMENG.
            CONF_QTY = CONF_QTY + ITAB2A-BMENG.
          ENDLOOP.
          NOCONF_QTY = ORDR_QTY - CONF_QTY.
          NODELV_QTY = ORDR_QTY - DELV_QTY.
    loop thru schedule lines and process entries with no related
      delivery(s)
          REMAIN_QTY = DELV_QTY.
          LOOP AT ITAB2A.
            IF ITAB2A-BMENG <> 0.
              IF ITAB2A-BMENG <= REMAIN_QTY.
                REMAIN_QTY = REMAIN_QTY - ITAB2A-BMENG.
              ELSE.
                ITAB2A-BMENG = ITAB2A-BMENG - REMAIN_QTY.
                PERFORM GET_REQUEST_DATE TABLES ITAB2B
                  USING ITAB2A-BMENG REQ_DATE.
                PERFORM GET_COMMIT_DATE TABLES ITAB2C
                  USING ITAB2A-BMENG COM_DATE.
                ITAB1-ZDATE1 = REQ_DATE.
                ITAB1-ZDATE2 = ITAB2A-WADAT.
                ITAB1-ZDATE3 = COM_DATE.
                ITAB1-ZQTY1 = ITAB-KWMENG.
                ITAB1-ZQTY2 = ITAB2A-BMENG.
                ITAB1-ZDESC = 'partial delivery'.
    calculate net value for backlog qty
                ZPRICE = ( ITAB-NETPR / ITAB-KPEIN ) * ITAB-KURSK.
                ITAB1-ZEXTD = ITAB1-ZQTY2 * ZPRICE.
    if order type is consignment return (KR), reverse sign
                IF ITAB-AUART = 'KR'.
                  ITAB1-ZQTY1 = ITAB1-ZQTY1 * -1.
                  ITAB1-ZQTY2 = ITAB1-ZQTY2 * -1.
                  ITAB1-ZEXTD = ITAB1-ZEXTD * -1.
                ENDIF.
                APPEND ITAB1.
                REMAIN_QTY = 0.
              ENDIF.
            ENDIF.
          ENDLOOP.
    if total unconfirmed >= total not delivered, qty is unconfirmed
          IF NOCONF_QTY >= NODELV_QTY.
            PERFORM GET_REQUEST_DATE TABLES ITAB2B
              USING NODELV_QTY REQ_DATE.
            PERFORM GET_COMMIT_DATE TABLES ITAB2C
              USING NODELV_QTY COM_DATE.
            ITAB1-ZDATE1 = REQ_DATE.
            ITAB1-ZDATE2 = '99991231'.
            ITAB1-ZDATE3 = COM_DATE.
            ITAB1-ZQTY1 = ITAB-KWMENG.
            ITAB1-ZQTY2 = NODELV_QTY.
            ITAB1-ZDESC = 'partial delv, not confirmed'.
    calculate net value for backlog qty
            ZPRICE = ( ITAB-NETPR / ITAB-KPEIN ) * ITAB-KURSK.
            ITAB1-ZEXTD = ITAB1-ZQTY2 * ZPRICE.
    if order type is consignment return (KR), reverse sign
            IF ITAB-AUART = 'KR'.
              ITAB1-ZQTY1 = ITAB1-ZQTY1 * -1.
              ITAB1-ZQTY2 = ITAB1-ZQTY2 * -1.
              ITAB1-ZEXTD = ITAB1-ZEXTD * -1.
            ENDIF.
            APPEND ITAB1.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDFORM.
    FORM 500_GET_THIRD_PARTY
    get detail for third party SO items
    FORM 500_GET_THIRD_PARTY.
    process SO items for selected order types
      LOOP AT ITAB WHERE PSTYV = 'TAS' AND ( AUART = 'ZZOR' OR
        AUART = 'ZZC1' OR AUART = 'ZZCO' OR AUART = 'ZZRP' OR
        AUART = 'ZZRW' OR AUART = 'KE' OR AUART = 'KR' OR
        AUART = 'ZCHP' OR AUART = 'ZPSO' OR AUART = 'ZZNC' ).
    select if billing status <> C (billed)
        IF ITAB-FKSAA <> 'C'.
    assign values to detail fields
          CLEAR ITAB1.
          ITAB1-KUNNR = ITAB-KUNNR.
          ITAB1-KUNWE = ITAB-KUNWE.
          ITAB1-VBELN = ITAB-VBELN.
          ITAB1-POSNR = ITAB-POSNR.
          IF ITAB-KURSK = 0.
            ITAB-KURSK = 1.
          ENDIF.
          IF ITAB-KPEIN = 0.
            ITAB-KPEIN = 1.
          ENDIF.
    get request dates from schedule line table
          REFRESH ITAB2B.
          SELECT EDATU VBELN POSNR WMENG
            FROM VBEP INTO TABLE ITAB2B
            WHERE VBELN = ITAB-VBELN AND POSNR = ITAB-POSNR AND
              WMENG <> 0.
    get commit dates from schedule line table
          REFRESH ITAB2C.
          SELECT EDATU VBELN POSNR ROMS1
            FROM VBEP INTO TABLE ITAB2C
            WHERE VBELN = ITAB-VBELN AND POSNR = ITAB-POSNR AND
              ROMS1 <> 0.
          SORT ITAB2B BY EDATU.
          SORT ITAB2C BY EDATU.
    get PO number(s) for SO item and write to internal table
          REFRESH ITAB4.
          SELECT VBELV POSNV VBELN POSNN VBTYP_N RFMNG PLMIN
            FROM VBFA INTO TABLE ITAB4
            WHERE VBELV = ITAB-VBELN AND POSNV = ITAB-POSNR AND
              VBTYP_N = 'V' AND RFMNG <> 0.
    calculate total delivery qty for PO item
          DELV_QTY = 0.
          LOOP AT ITAB4.
            IF ITAB4-PLMIN = '-'.
              ITAB4-RFMNG = ITAB4-RFMNG * -1.
            ENDIF.
            DELV_QTY = DELV_QTY + ITAB4-RFMNG.
          ENDLOOP.
    loop thru PO's for SO item
          LOOP AT ITAB4.
    select delivery lines for PO item
            SELECT EINDT EBELN EBELP MENGE FROM EKET
              INTO (EKET-EINDT, EKET-EBELN, EKET-EBELP, EKET-MENGE)
              WHERE EBELN = ITAB4-VBELN AND EBELP = ITAB4-POSNN.
              PERFORM GET_REQUEST_DATE TABLES ITAB2B
                USING EKET-MENGE REQ_DATE.
              PERFORM GET_COMMIT_DATE TABLES ITAB2C
                USING EKET-MENGE COM_DATE.
              ITAB1-ZDATE1 = REQ_DATE.
              ITAB1-ZDATE2 = EKET-EINDT.
              ITAB1-ZDATE3 = COM_DATE.
              ITAB1-ZQTY1 = ITAB-KWMENG.
              ITAB1-ZQTY2 = EKET-MENGE.
              ITAB1-ZDESC = '3rd party item'.
    calculate net value for backlog qty
              ZPRICE = ( ITAB-NETPR / ITAB-KPEIN ) * ITAB-KURSK.
              ITAB1-ZEXTD = ITAB1-ZQTY2 * ZPRICE.
              APPEND ITAB1.
            ENDSELECT.
          ENDLOOP.
    if total delivery qty < order qty, put remaining in non-confirmed
          IF DELV_QTY < ITAB-KWMENG.
            THIRD_QTY = ITAB-KWMENG - DELV_QTY.
            PERFORM GET_REQUEST_DATE TABLES ITAB2B
              USING THIRD_QTY REQ_DATE.
            PERFORM GET_COMMIT_DATE TABLES ITAB2C
              USING THIRD_QTY COM_DATE.
            ITAB1-ZDATE1 = REQ_DATE.
            ITAB1-ZDATE2 = '99991231'.
            ITAB1-ZDATE2 = COM_DATE.
            ITAB1-ZQTY1 = ITAB-KWMENG.
            ITAB1-ZQTY2 = THIRD_QTY.
            ITAB1-ZDESC = '3rd party item, no PO'.
    calculate net value for backlog qty
            ZPRICE = ( ITAB-NETPR / ITAB-KPEIN ) * ITAB-KURSK.
            ITAB1-ZEXTD = ITAB1-ZQTY2 * ZPRICE.
            APPEND ITAB1.
            CONTINUE.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDFORM.
    FORM 900_CREATE_LIST
    process open business detail and create list
    FORM 900_CREATE_LIST.
    if internal table is empty, write message and exit
        DESCRIBE TABLE ITAB1 LINES ZCNTR.
        IF ZCNTR = 0.
          WRITE: / 'No Data Found for Selection'.
          STOP.
        ENDIF.
        SORT ITAB1 BY KUNNR KUNWE VBELN POSNR.
    loop thru sorted table and create list
        LOOP AT ITAB1.
          IF ITAB1-ZDATE1 = SPACE.
            ITAB1-ZDATE1 = '99991231'.
          ENDIF.
          IF ITAB1-ZDATE3 = SPACE.
            ITAB1-ZDATE3 = '99991231'.
          ENDIF.
    get SO item detail
          CLEAR ITAB.
          READ TABLE ITAB WITH KEY VBELN = ITAB1-VBELN
                                   POSNR = ITAB1-POSNR BINARY SEARCH.
    print sold-to and ship-to customer header info
          AT NEW KUNWE.
            CLEAR KNA1.
            SELECT SINGLE NAME1 FROM KNA1 INTO KNA1-NAME1
              WHERE KUNNR = ITAB1-KUNNR.
            CONCATENATE ITAB-ORT01 ITAB-REGIO INTO ADRS1 SEPARATED BY ', '.
            CONCATENATE ADRS1 ITAB-LAND1 INTO ADRS2 SEPARATED BY '   '.
            CONCATENATE ITAB-NAME1 ADRS2 INTO ADRS3 SEPARATED BY '   '.
            FORMAT COLOR 1 INTENSIFIED OFF.
            WRITE: /1 'Sold-to:', 10 ITAB1-KUNNR, 18 KNA1-NAME1,
              56 'Ship-to:', 65 ITAB1-KUNWE, 73 ADRS3.
            FORMAT RESET.
            SKIP.
          ENDAT.
    print out backlog detail
          CLEAR T171T.
          SELECT SINGLE BZTXT FROM T171T INTO T171T-BZTXT
            WHERE SPRAS = SY-LANGU AND BZIRK = ITAB-BZIRK.
          WRITE: /1 ITAB1-VBELN,
            13(6) ITAB1-POSNR NO-ZERO,
            21 ITAB-MATNR,
            41 ITAB-ARKTX,
            83 ITAB1-ZDATE1,
            95 ITAB1-ZDATE3,
            107 ITAB1-ZDATE2,
            119 ITAB-ERNAM,
            129 ITAB-BZIRK, 135 T171T-BZTXT,
            157(20) ITAB-BSTKD,
            179(12) ITAB1-ZQTY1 DECIMALS 0,
            193(12) ITAB1-ZQTY2 DECIMALS 0,
            207(16) ITAB1-ZEXTD DECIMALS 2,
            225 ITAB1-ZDESC.
          AT END OF VBELN.
            SKIP.
          ENDAT.
    print footing at ship-to customer
          AT END OF KUNWE.
            SUM.
            ULINE: /193(12), 207(16).
            FORMAT COLOR 1 INTENSIFIED OFF.
            WRITE: /1 'Total:  Sold-to:', 18 ITAB1-KUNNR,
              25 '/', 27 'Ship-to:', 36 ITAB1-KUNWE,
              193(12) ITAB1-ZQTY2 DECIMALS 0,
              207(16) ITAB1-ZEXTD DECIMALS 2.
            FORMAT RESET.
            SKIP 2.
          ENDAT.
          AT LAST.
            SUM.
            ULINE: /193(12), 207(16).
            FORMAT COLOR 1 INTENSIFIED ON.
            WRITE: /1 'Report Total:',
              193(12) ITAB1-ZQTY2 DECIMALS 0,
              207(16) ITAB1-ZEXTD DECIMALS 2.
            FORMAT RESET.
          ENDAT.
        ENDLOOP.
    ENDFORM.
    FORM GET_REQUEST_DATE
    subroutine to get request date for SO item
    FORM GET_REQUEST_DATE TABLES FTAB STRUCTURE ITAB2B
                          USING CONF_QTY REQ_DATE.
    DATA: REMAIN LIKE VBEP-WMENG,                 "qty remaining
          CNTR TYPE I,                            "loop counter
          TAB_INDEX TYPE I.                       "table index
    initialize
      REMAIN = 0.
      REQ_DATE = SPACE.
    get first request date from table
      TAB_INDEX = 1.
      READ TABLE FTAB INDEX TAB_INDEX.
    if request date not found, set request date to blank
      IF SY-SUBRC <> 0.
        REQ_DATE = SPACE.
        EXIT.
      ELSE.
        REQ_DATE =  FTAB-EDATU.
      ENDIF.
    calculate quantity remaining for request date
      REMAIN = FTAB-WMENG - CONF_QTY.
    if qty remaining > 0, update request date with qty remaining
      IF REMAIN > 0.
        FTAB-WMENG = REMAIN.
        MODIFY FTAB INDEX TAB_INDEX.
    if qty remaining = 0, delete request date (so next request
      date will be used for next confirmed qty)
      ELSEIF REMAIN = 0.
        DELETE FTAB INDEX TAB_INDEX.
    if qty remaining < 0, find next request date and update
      ELSE.
        CNTR = 0.
        WHILE REMAIN < 0 OR CNTR < 10.
          DELETE FTAB INDEX TAB_INDEX.
          TAB_INDEX = TAB_INDEX + 1.
          READ TABLE FTAB INDEX TAB_INDEX.
          REMAIN = REMAIN + FTAB-WMENG.
          CNTR = CNTR + 1.
        ENDWHILE.
        IF REMAIN = 0.
          DELETE FTAB INDEX TAB_INDEX.
        ELSEIF REMAIN > 0.
          FTAB-WMENG = REMAIN.
          MODIFY FTAB INDEX TAB_INDEX.
        ENDIF.
      ENDIF.
    ENDFORM.
    FORM GET_COMMIT_DATE
    subroutine to get commit date for SO item
    FORM GET_COMMIT_DATE TABLES CTAB STRUCTURE ITAB2C
                          USING CONF_QTY COM_DATE.
    DATA: REMAIN LIKE VBEP-WMENG,                 "qty remaining
          CNTR TYPE I,                            "loop counter
          TAB_INDEX TYPE I.                       "table index
    initialize
      REMAIN = 0.
      COM_DATE = SPACE.
    get first commit date from table
      TAB_INDEX = 1.
      READ TABLE CTAB INDEX TAB_INDEX.
    if request date not found, set request date to blank
      IF SY-SUBRC <> 0.
        COM_DATE = SPACE.
        EXIT.
      ELSE.
        COM_DATE =  CTAB-EDATU.
      ENDIF.
    calculate quantity remaining for request date
      REMAIN = CTAB-ROMS1 - CONF_QTY.
    if qty remaining > 0, update request date with qty remaining
      IF REMAIN > 0.
        CTAB-ROMS1 = REMAIN.
        MODIFY CTAB INDEX TAB_INDEX.
    if qty remaining = 0, delete request date (so next request
      date will be used for next confirmed qty)
      ELSEIF REMAIN = 0.
        DELETE CTAB INDEX TAB_INDEX.
    if qty remaining < 0, find next request date and update
      ELSE.
        CNTR = 0.
        WHILE REMAIN < 0 OR CNTR < 10.
          DELETE CTAB INDEX TAB_INDEX.
          TAB_INDEX = TAB_INDEX + 1.
          READ TABLE CTAB INDEX TAB_INDEX.
          REMAIN = REMAIN + CTAB-ROMS1.
          CNTR = CNTR + 1.
        ENDWHILE.
        IF REMAIN = 0.
          DELETE CTAB INDEX TAB_INDEX.
        ELSEIF REMAIN > 0.
          CTAB-ROMS1 = REMAIN.
          MODIFY CTAB INDEX TAB_INDEX.
        ENDIF.
      ENDIF.
    ENDFORM.
    END-OF-REPORT.

  • Open order returns

    Hi All,
    A report is needed for open return orders that do not have a credit memo issued or a goods receipt processed against the delivery
    The Validation requires      
    Credit not issued (may be default because of billing block)  orders.
    can anyone help in the following
    1)what are open return orders
    2)open return orders that do not have a credit memo
    3)goods receipts processed against the delivery
    what are the transaction codes and fields related to it

    hi for open orders ,
    Transaction Code: VA05
    Select Open Orders.
    first get the sd flow  ...
    SD FLOW
    SD Flow Cycle:
    INQUIRY ( VA11)
    QUOTATION (VA21)
    PURCHASE ORDER (ME21)
    ORDER CONFIRMATION (VA01)
    PICKING LIST – (VL36)
    PACKING LIST - (VL02, VL01)
    SHIPPING – (VT01)
    INVOICE – (VF21, VF01)
    AR
    Enquiry - Customer enquires about the Products services that were sold by a company - VA11
    Quotation - Company Gives a Quotation for the products and Services to a Customer
    Sales Order - Customer gives a Purchase order to the company agaionst which a Sales order will be raised to Customer in SAP.
    VBAK: Sales Document(Header Data) (VBELN)
    VBAP: Sales Document(Item Data) (VBELN,POSNR,MATNR,ARKTX,CHARG)
    Enquiry, Quotation, Sales Order are differentiated based on Doc.
    Type(VBTYP field) in VBAK,VBAP Tables( for Enquiry VBTYP = A,
    for Quotation 'B' & for Order it is 'C'.)
    Delivery(Picking, Packing, Post Goods Issue and Shipment)->
    Company sends the material after picking it from Godown and Packing it in a Handling Unit(box) and Issues the goods
    LIKP: Delivery Table (Header Data)(VBELN,LFART,KUNNR,WADAT,INCO1)
    LIPS: Delivery Table (Item Data)(VBELN,POSNR,WERKS,LGORT,MATNR,VGBEL)
    (LIPS-VGBEL = VBAK-VBELN, LIPS-VGPOS = VBAP-POSNR)
    Billing - Also company bills to the customer for those deliveries
    And in FI against this billing Accounting doc is created.
    VBRK: Billing Table(Header Data)(VBELN,FKART,BELNR)
    VBRP: Billing Table(Item Data)(VBELN,POSNR,FKIMG,NETWR,VGBEL,VGPOS)
    (VBRP-AUBEL = VBAK-VBELN, VBRP-VGBEL = LIKP-VBELN)
    Apart from these tables there are lot of other tables which starts with
    ‘V’, but we use the following tables frequently.
    VBUK: All Sales Documents status & Admn. Data(Header)(VBELN,VBTYP)
    VBTYP= ‘C’(Sales Order) VBTYP=’J’(Delivery) VBTYP=’M’(Invoice)
    VBUP: Sales Documents status & Admn. Data(Item)(VBELN,POSNR)
    VBEP: Sales Doc. Schedule Lines Data(VBELN,POSNR,EDATU,WMENG)
    VBKD: To get sales related Business data like Payment terms etc.(VBELN,ZTERM)
    VBFA: sales document flow data(VBELV,VBELN,POSNV,VBTYP)
    VBPA: Partner functions Data(VBELN,PARVW,KUNNR,LIFNR)
    VEDA: Contract Data(VBELN,VPOSN)
    VEDAPO: Contract Data(VBELN,VPOSN)
    KONA: Rebate Agreements (KNUMA,VKORG,VTWEG,SPART)
    http://www.sapgenie.com/abap/tables_sd.htm
    Please check this SD online documents.
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CAARCSD/CAARCSD.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/MYSAP/SR_SD.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCBMTWFMSD/BCBMTWFMSD.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/LOLISPLN/LOLISPLN.pdf
    Also please check this SD links as well.
    http://help.sap.com/saphelp_47x200/helpdata/en/92/df293581dc1f79e10000009b38f889/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/dd/55f33e545a11d1a7020000e829fd11/frameset.htm
    http://www.sap-basis-abap.com/sapsd.htm
    http://www.sap-img.com/sap-sd.htm
    http://www.sapgenie.com/abap/tables_sd.htm
    http://searchsap.techtarget.com/featuredTopic/0,290042,sid21_gci961718,00.html
    http://www.sapbrain.com/TUTORIALS/FUNCTIONAL/SD_tutorial.html
    All help ebooks are in PDF format here
    http://www.easymarketplace.de/online-pdfs.php
    regards,
    venkat.

  • Open Order value for Customer in Credit Master

    Hi All,
    For ABC customer, if I check for Credit master(F.35), credit management(FD33) & Sales Summary, the Open order value(sales Value) is 10, 30,000.00 EUR.
    If I calculate adding
    Back orders - 83681.98
    Open orders - 196763.43
    Open Contract - 9,669.79
    Open Delivers u2013 9,245.23
    Receivables - 37,938.77.
    Total will be 3, 37, 299.20
    Please any one can tell where I can find the difference value(mean which tcode or report).
    Thanks & Regards
    Sunil

    Hi,
    Check with transaction code VKM1 or VKM4 or FCV3. The columns will show the details.
    Regards

  • Does Simple Credit Limit Check Include Checking for Open Orders

    Hi all,
    I have this issue here where I have configured the system to use simple credit limit check with error message. I did not use the standard/common automatic credit limit check since user insist on a pop-up warning and that the order could not be saved. But, I realized that it does not take open orders into account too although I have set the risk categories. Is it true and what solution is there for this issue then.
    Thank you for all your help in inputs.
    Regards,
    Yvonne

    Hi,
    Please follow the below configuration settings for Simple credit check process.
    Simple credit check: In simple credit check the system compares the credit exposure with payers credit limit. The
    credit exposure results from the total of the net document value and the value of the open items.
    We can set the following system responses at when the credit limit has been reached.
    A u2013Warning message
    B u2013 Error message
    C u2013 Delivery block
    Specify in VOV8  Credit limit [C]
    Configuration settings:
    Sales documents types u2013 Credit limit check: Transaction code: OVAK
    Path:
     IMG
     Sales and Distribution
     Basic functions
     Credit management/Risk management
     Simple credit limit check
     Choose sales document type OR
     Specify value
    [ ] = No credit limit check
    [A] = Run simple credit limit check and warning message
    <b> = Run simple credit limit check and error message
    [C] = Run simple credit limit check and delivery block
     Save and Exit
    Define credit control area: Transaction code: OB45
    Credit control area is an organizational unit that specifies and checks the credit limit for customers. A credit control
    area can include one or more company codes. It means we can assign one credit control area to number of company
    codes.
    NOTE: Within credit control area the credit limit must be specified in the same currency.
    Path:
     IMG
     Enterprise structure
     Definition
     Financial accounting
     Define credit control area
     Go to new entries
    (OR)
     Choose existing credit control area
     Select it and click on copy icon
     Rename it and click on details icon
    Specify currency [INR]
    257
    Data for updating SD fields
    Update [000012]: Open order value on time axis, delivery and billing document value. This field value controls
    when the values are open sales orders, deliveries, billing documents are updated in LIS. We can specify the
    following update groups for updating credit related statistics.
     Update group 000012:
    Sales order: Increase open order value from delivery relevant schedule lines.
    Delivery: Reduces open order value from delivery relevant schedule lines.
    Increases open delivery value
    Billing document: Reduces the open delivery value, increases open billing document value.
    Financial accounting document: Reduces open billing document value
    Increases open items.
     Update group 000015:
    Delivery: Increases open delivery value.
    Increases open billing document value.
    Financial accounting document: Reduces open billing document value
    Increases open items.
     Update group 000018:
    Sales order: Increases open delivery value
    Billing document: Reduces open delivery value.
    Increases open billing document value.
    Financial accounting document: Reduces open billing document value.
    Increases open items.
    Fiscal year variant [K4]: It indicates specific fiscal year variant for particular credit control area. The fiscal year
    variant is essential when a credit control area covers multiple company codes whose fiscal years are different. Then
    the values of the open orders are updated by posting period.
    Specify risk category [001]: 001 = High risk
    002 = Medium risk
    003 = Low risk
    This risk category entered in the related control area of the customeru2019s credit master record, which is automatically
    created when a customer is created in a company code.
    The credit master record is automatically maintained when at least one of the below fields is maintained for the
    corresponding control area.
    (A) Risk category
    (B) Credit representative group
    (C) Credit limit
    Credit limit: The credit limit that we enter here in the specific credit control area of the customeru2019s credit master
    record. This is automatically created when a customer is created in a company code (in XD01).
    NOTE: This credit limit is not a total credit limit for the control area.
    Representative group [001]: Define credit representative group in IMG.
     All company codes: If we want to tell to the system that, this credit control area is permitted for
    postings in every company code we have defined.
     Save and Exit
    NOTE: After this create Risk categories and Credit representative groups and come back to this step and assign
    these values to our credit control area.
    Risk category and Representative group defined and maintained by FI/CO consultants in IMG.
    258
    Assign company code to credit control area: Transaction code: OB38
    Path:
     IMG
     Enterprise structure
     Assignment
     Financial accounting
     Assign company code to credit control area
     Choose our company code from position button
     Click on assign button on the application tool bar
     Select our credit control area from the list and assign it
     Save and Exit
     Go to FD32 and check whether system created customeru2019s credit master data automatically or not.
    System creates customers credit master data automatically when we (FI/CO) people) configure credit control area in
    IMG.
    So as to perform simple credit check we have to specify customer master payers limit in the credit control area, and
    create customer master in XD01 transaction code.
     Specify reconciliation account number (GL account number)
     Payment history record: Check payment history record control in payment transaction tab. It is the
    control parameter to update the payment details that are made by customers and system will show the
    payment details in the FD32.
     Specify the credit control area in credit control area field in billing document tab.
     Save and Exit
     Go to VA01 and raise the sales order
    Check the system responses in each and every level of sales document processing and check whether the system
    blocked the delivery document (due to the setting in VOV8 of OR in check credit limit field [C] = Blocked for
    delivery).
     To release the delivery go to VKM4 and release the delivery document.

Maybe you are looking for

  • Using currentTarget.label as variable in path?

    I have the following code: <s:FormItem label="First" click="onItemFocus(event)">       <s:TextInput id="First" enabled="false" text="some text here..."/> </s:FormItem> Which when you click the FormItem it fires this function: protected function onIte

  • Slow/lag perfomance 13'' late 2011 macbook pro

    im experiencing slow-ish and lag-ish performance from my macbook pro.. but when i plugged my magsafe, its running smooth and fast. what should i do to fix this kind of problem reply asap!! im using OS X 10.9.3

  • To fetch 2 fileds of table TRFCQIN (abap schema table ) through OPEN SQL

    Hi Experts, My basis team wants me to write a OPEN sql statement in DB2 . T The Open SQL statement for reading data from database tables is: SELECT      <result>   INTO      <target>   FROM      <source>   [WHERE    <condition>]   [GROUP BY <fields>]

  • Export current project to FCP v6, Motion 3

    Hi, I recently completed a project using v7. I used ProRes 444 and handled all the animated text in the sequence via templates created in Motion 4 and updated in FCP. So, to give this project to an editor using v6 seems very difficult. First, I would

  • How to export from iMovie HD without losing quality?

    I created a movie in iMovie HD made from clips from my camera which records great quality HD video, and now I want to export it and save as a movie file so that I can import it into iMovie '09 as part of a larger project. However, every time I try to