Deleting The Open STO Line Items...........

Dear Friends,
I am having one requirement as follows.
The program is to build in such a fashion , that if there are any open items in STO
ie. In one STO there are 3 items having 100 , 200 , 300 quantities...
<b>First item</b>     10 .. quantity 100..... PGI Done for 100 ( balance Nill )
<b>Second Item</b> 20... quantity 200..... PGI Done for 100 ( Open Deliv / Shipment ) -  (100 ).. Then system has to mark for deletion for ( open deliveries and  Shipment cost , Handling unit ).........
<b>Third item</b> 30  -
  quantity 300...( Open Deliveries 300 ) ..Then system has to mark for deletion  for ( open deliveries , and PO line item  )
How we can approach to this solution...
Is there anyBAPI available or LSMW for each phase we have to consider or BDC..
Thanx and Regards,
Amitav

Hi Rajesh,
I think SAP help says that the period for which you are planning to delete or archive data may have to be locked.
Check the following links:
For Archiving
http://help.sap.com/saphelp_47x200/helpdata/en/8d/3e55ec462a11d189000000e8323d3a/frameset.htm

Similar Messages

  • How to delete the Cost center line item data

    How to delete the cost center line item data of particular cost center and only one cost center is exisiting for that company code.
    Is there any way to delete the line items in that cost center.
    Can data archiving & deleting can help us..........
    does it have any effect over other cost center data....
    any input needed.........
    regards
    rajesh

    Hi,
    i found 2 reports for you:
    1) CO_TOTAL_WRI - Archiving CO Totals Records   
    2) RKCOITW1     - Archiving CO Line Items: Write Program        
    from 2) is a linlk to customize archiv-parameters
    -> start it with transaction se38 / sa38
    A.

  • How to find the open po line item by using EKKO &EKPO tables

    Hi Gurus,
        what i am doing is finding out the OPEN PO line item from EKPO table. I know it has to check the ELIKZ field from the EKPO table.Can you please clarify me on the same in more detail.I has to use the ELIKZ  EREKZ fields from EKPO table.

    Use the field ELIKZ in EKPO. If the field is Blank its an OPEN PO Line Item
    refer this link.
    How to open PO line item

  • Archiving  & Deleting the Cost center line items

    My requirement is to delete the line items in the cost cneter as of today, but when i tried to archive & delete the Cost center line items using CO_item,i aam sucesfull in deleteing the past data, but the data of the last month and currenct month i was unable to ........
    when i tried in the spro>img>controlling>general ontrolling>archiving>prepare archiving for co line items
    i set the resident time to 0,but i was unable to delete the line items.what colud be the reason and what is the way to delete the currenct data also from the system.
    your earlier reply surely appreciated .......

    Hi Rajesh,
    I think SAP help says that the period for which you are planning to delete or archive data may have to be locked.
    Check the following links:
    For Archiving
    http://help.sap.com/saphelp_47x200/helpdata/en/8d/3e55ec462a11d189000000e8323d3a/frameset.htm

  • Unable to delete the Purchase Requisition line item

    Hello MM sapperu2019s,
    I am unable to delete one of the line item in Purchase Requisition. Please let me know how to delete this Purchase Requisition line item.
    When I tried to delete the line item in ME52N the delete button is gryed out hence I could not able to do it.
    The purchase requirement has reference of network in the account assignment.
    Please let me know if you need more clarification.
    Cheers,
    Kumar.S

    Hi,
    You are experiencing the stnadrad behavior
    When the Preq is automatically created from either
    a production, plant maintenance, or network, order, what you can change
    in the PReq is very limited.
    This is to ensure no conflicts arises between the PReq and the source
    application of the PReq (be it PP, PM/CS or PS).
    The technical explanation is due to the recorded value in EBAN-ESTKZ
    (Creation indicator).  The value stored here (automatically by the
    system) controls what you can or can't change in ME52/N.
    We cannot delete the line item in this case
    regards,
    Lalita

  • Open AUC Line Items

    Hi
    My requirement is to upload the legacy open AUC line items into the new system. For this we are writing a ABAP program. I could find all the AUC line items in the Table ANEP. But my requirement is to extract only the open AUC line items and not all.
    Can any suggest the Table in which I could find the open AUC line items ?
    Requirement is critical and thank you in advance.
    Gemini

    My requirement is not to find whether the given AUC is deactivated or not. I would like to extract the line items which are open in all the AUCs for uploading this as cut over data into the new system.
    As I have mentioned in my question I could find all the line items (settled + not settled) of AUC in ANEP table, but I want to know  if there is any Table which stores only the unsettled AUC line items.
    Thank you
    Gemini

  • With holding tax amount exceeds the cutomer/vendor line item amount 001

    Hi Guru's,
      I have an issue, is there any impact to change the withholding tax base amount 20% instead of 10%.When I change the base amount to 20% and post a document system return error message
    "With holding tax amount exceeds the cutomer/vendor line item amount 001".Guide me on this issue.
    And tell me the impact of previous open item documents.
    Regards
    Maruthi.

    Thanks for all,
      MY problem solved.
    Regards
    Maruthi

  • How to identify open schedule line item?

    Hi,
    I have a requirement for identifying open schedule line items. I want to identify any indicator or any field in any table which will tell me that the schedule line item is complete. Can anyone tell me how can I know that?
    Ex. Sales Order 1 has 3 materials (line items) in it A, B & C.
           For A the quantity is 10 and for which 3 schedule line have been created.
           Out of the 3 schedule lines, 1 schedule line item is complete that is the delivery has been done and the rest 2 are open.
    For B and C there are 4 & 5 schedule lines created and all are open.
    How can i identify that total 12 schedule line 1 is completed and 11 are open.
    Please suggest tables, field names / indicators.
    Regards,
    Vishal

    Hi Vishal,
    You can not identify the open line items directly, rather you have to calculate the delivered quantity and copmare it with the ordered qty for each line item. The ordered qty can be idenitfy from the table VBEP and the deliverd qty can be found out by calling the function RV_SCHEDULE_CHECK_DELIVERIES.
    Follow the link for more details to calculate the delvierd qty.
    http://scn.sap.com/thread/279862
    Rgards,
    Rutvik.

  • Restrict deletion of sales order line items

    Hi,
    I need to restrict deleting of sales order line item, I think we can use the user exit, MV45AFZB, USEREXIT_CHECK_XVBAP_FOR_DELE.
    But when i set the flag to 'X', even though it does not delete at tht instance when the sales order save is clicked again the line item gets deleted.
    ANy idea , to prevent that?
    Thanks
    Keshi

    Hi Keshi,
    That is the correct exit, we are using the same without any problem. Just set US_EXIT  = CHARX.
    Regards,
    John.

  • Create delivery for STO line item

    Hi All,
    My requirement is to allow creating delivery for Stock transfer Order(STO) line items which are
    not in blocked status even though some line items are in blocked status.
    Right now the logic checks if entire PO is in blocked Status using FM-- /SAPSLL/CD_STATUS_GET in method CHANGE_DELIVERY_ITEM of interface IF_EX_LE_SHP_DELIVERY_PROC
    But this FM does not contain PO item parameters. I need to incorporate item level checking logic.
    Are there any SAP notes available to fix this problem?

    Hi All,
    Any clues on this?

  • Not able to re-atp 1of the sales order line item

    Hi SAP PP Gurus,
    When I tried to re-atp 1 of the sales order line item it is giving error as mentioned below. Please let me know where this fix qty indicator in the sales order and how can I de-activate the same.  Thanks in advance....
    Item has no open quantity - Check fixed quantity ID
         Message no. V1 601
    Diagnosis
         The item does not have any open, confirmed quantities and the "fix
         quantity" indicator is activated. This means that the customer has
         agreed on a zero quantity and nothing is delivered.
    System Response
         The system issues a corresponding message.
    Procedure
         If you want the item to receive a confirmed quantity after all which can
         be delivered later, you should de-activate the fix quantity indicator.

    Hi Ritish,
    Strategy is MTO..
    I have triied to perform atp by using fix qty/date but still system in not proposing MAD. And it is giving below error screen.
    No. of components checked:                1
    Missing parts:                            1
    Overall confirmation date could not be determined
    Order : 1104739992
      Material           Plnt SLoc Reqmts q     Requirements  ATP/avai     Committ. d Material description M Bl
      NH524AA@@          32F2 F2WH   1.000      03.08.2009      0.000      99.99.9999 HP gt7725 PCI Expres X
    Thanks and Regards,
    SHARAN.

  • 'BAPI_SALESORDER_CHANGE - Want to change the Quantity on Line Item in SO

    Hi
    I am facing a problem. The requirement is to change the Sales Order Item Quantity. I basically planned to update the quantity of Schedule Item which needs to be changed. When I run the below code, it works and says the Sales Order changed succesfully. However I get an express message saying the Database update failure. I don't get any sort of technical information.
    Appreciate if you could help me finding the error.
    Thanks
    regards
    girish
    Note --> I am trying to change the Quantity for 2 line item in SO '56' to 40 Units.
    REPORT ZBAPI_SALESORD_CHANGE.
    data : zBAPISDHD type /AFS/BAPISDHD,
    zORDER_HEADER_INX TYPE /AFS/BAPISDHDX,
    zSALESDOCUMENT type BAPIVBELN-VBELN.
    data : zORDER_ITEMS_IN like /AFS/BAPISDITM occurs 0 with header line,
    zORDER_ITEM_INX like /AFS/BAPISDITMX occurs 0 with header line,
    zORDER_SCHEDULES_IN like /AFS/BAPISDSCHD occurs 0 with header line,
    ZSCHEDULE_LINESX LIKE /AFS/BAPISDSCHDX occurs 0 with header line,
    zORDER_PARTNERS like BAPIPARNR occurs 0 with header line,
    zRETURN like BAPIRET2 occurs 0 with header line,
    so_no type BAPIVBELN-VBELN,
    zPARTNERCHANGES like BAPIPARNRC occurs 0 with header line.
    data : l_comp_qty like zORDER_ITEMS_IN-COMP_QUANT.
    data : g_qty like /AFS/BAPISDSCHD-REQ_QTY.
    g_qty = 40.
    l_comp_qty = 40.
    clear : zBAPISDHD.
    so_no = '0000000056'.
    zBAPISDHD-REFOBJTYPE = '/AFS/ORDER'.
    zBAPISDHD-SALES_ORG = 'BP01'.
    zBAPISDHD-DISTR_CHAN = '02'.
    zBAPISDHD-DIVISION = '01'.
    zBAPISDHD-PMNTTRMS = '0001'.
    zORDER_HEADER_INX-UPDATEFLAG = 'U'.
    zORDER_HEADER_INX-SALES_ORG = 'X'.
    zORDER_HEADER_INX-DISTR_CHAN = 'X'.
    zORDER_HEADER_INX-DIVISION = 'X'.
    zORDER_HEADER_INX-PMNTTRMS = 'X'.
    **********ITEM ***************************************
    zORDER_ITEMS_IN-ITM_NUMBER = '00020'.
    zORDER_ITEMS_IN-MATERIAL = 'F1202'.
    zORDER_ITEMS_IN-PLANT = 'BP01'.
    zORDER_ITEMS_IN-ITEM_CATEG = 'TAS'.
    zORDER_ITEMS_IN-SHIP_POINT = 'BP01'.
    zORDER_ITEMS_IN-COMP_QUANT = l_comp_qty.
    zORDER_ITEMS_IN-TARGET_QTY = l_comp_qty.
    zORDER_ITEMS_IN-TARGET_QU = 'ST'.
    append zORDER_ITEMS_IN.
    zORDER_ITEM_INX-ITM_NUMBER = '00020'.
    zORDER_ITEM_INX-UPDATEFLAG = 'U'.
    zORDER_ITEM_INX-MATERIAL = 'X'.
    zORDER_ITEM_INX-PLANT = 'X'.
    zORDER_ITEM_INX-ITEM_CATEG = 'X'.
    zORDER_ITEM_INX-SHIP_POINT = 'X'.
    zORDER_ITEM_INX-COMP_QUANT = 'X'.
    zORDER_ITEM_INX-TARGET_QTY = 'X'.
    zORDER_ITEM_INX-TARGET_QU = 'X'.
    append zORDER_ITEM_INX.
    *********SCHEDULE LINE******************************
    refresh zORDER_SCHEDULES_IN.
    clear zORDER_SCHEDULES_IN.
    zORDER_SCHEDULES_IN-ITM_NUMBER = '000020'.
    zORDER_SCHEDULES_IN-SCHED_LINE = '0001'.
    zORDER_SCHEDULES_IN-REQ_DATE = '20070525'.
    zORDER_SCHEDULES_IN-DATE_TYPE = '1'.
    zORDER_SCHEDULES_IN-SCHED_TYPE = 'CS'.
    zORDER_SCHEDULES_IN-GRID_VALUE = 'BLK2728'.
    zORDER_SCHEDULES_IN-REQ_CATEGORY = '1DE'.
    zORDER_SCHEDULES_IN-REFOBJTYPE = '/AFS/ORDER'.
    zORDER_SCHEDULES_IN-REQ_QTY = g_qty.
    append zORDER_SCHEDULES_IN.
    refresh ZSCHEDULE_LINESX.
    clear ZSCHEDULE_LINESX.
    ZSCHEDULE_LINESX-ITM_NUMBER = '000020'.
    ZSCHEDULE_LINESX-SCHED_LINE = '0001'.
    ZSCHEDULE_LINESX-UPDATEFLAG = 'U'.
    ZSCHEDULE_LINESX-REQ_DATE = 'X'.
    ZSCHEDULE_LINESX-DATE_TYPE = 'X'.
    ZSCHEDULE_LINESX-SCHED_TYPE = 'X'.
    ZSCHEDULE_LINESX-GRID_VALUE = 'X'.
    ZSCHEDULE_LINESX-REQ_CATEGORY = 'X'.
    ZSCHEDULE_LINESX-REFOBJTYPE = 'X'.
    ZSCHEDULE_LINESX-REQ_QTY = 'X'.
    append ZSCHEDULE_LINESX.
    CALL FUNCTION '/AFS/BAPI_SALESORD_CHANGE'
    EXPORTING
    SALESDOCUMENT = so_no
    ORDER_HEADER_IN = zBAPISDHD
    ORDER_HEADER_INX = zORDER_HEADER_INX
    SIMULATION =
    BEHAVE_WHEN_ERROR = ' '
    INT_NUMBER_ASSIGNMENT = ' '
    LOGIC_SWITCH =
    TABLES
    RETURN = zRETURN
    ORDER_ITEM_IN = zORDER_ITEMS_IN
    ORDER_ITEM_INX = zORDER_ITEM_INX
    ORDER_SCHEDULE_LINES = zORDER_SCHEDULES_IN
    ORDER_SCHEDULE_LINESX = ZSCHEDULE_LINESX.
    PARTNERS =
    PARTNERCHANGES = zPARTNERCHANGES
    PARTNERADDRESSES =
    ORDER_CFGS_REF =
    ORDER_CFGS_INST =
    ORDER_CFGS_PART_OF =
    ORDER_CFGS_VALUE =
    ORDER_CFGS_BLOB =
    ORDER_CFGS_VK =
    ORDER_CFGS_REFINST =
    ORDER_TEXT =
    ORDER_KEYS =
    CONDITIONS_IN =
    CONDITIONS_INX =
    EXTENSIONIN =
    *CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
    SALESDOCUMENT = so_no
    ORDER_HEADER_IN = zBAPISDHD
    ORDER_HEADER_INX = zORDER_HEADER_INX
    TABLES
    RETURN = zRETURN
    ORDER_ITEM_IN = zORDER_ITEMS_IN
    ORDER_ITEM_INX = zORDER_ITEM_INX
    PARTNERS = zORDER_PARTNERS
    PARTNERCHANGES = zPARTNERCHANGES
    PARTNERADDRESSES =
    ORDER_CFGS_REF =
    ORDER_CFGS_INST =
    ORDER_CFGS_PART_OF =
    ORDER_CFGS_VALUE =
    ORDER_CFGS_BLOB =
    ORDER_CFGS_VK =
    ORDER_CFGS_REFINST =
    SCHEDULE_LINES = zORDER_SCHEDULES_IN
    SCHEDULE_LINESX = ZSCHEDULE_LINESX.
    ORDER_TEXT =
    ORDER_KEYS =
    CONDITIONS_IN =
    CONDITIONS_INX =
    EXTENSIONIN =
    data : s_BAPIRET2 like BAPIRET2.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    importing
    return = s_bapiret2.

    Hi,
    Refer this code: Marked in bold
    Get Line Item Details which are to be deleted
    The line items fetched but not matching with ALV data
    are the one which are copied from Reference Order
    and should be deleted from our Sales Order
      PERFORM get_line_item_details.
    To get all the uploaded data
      i_upload_2[] = i_upload[].
    This is to be executed only if the SALES ORDER
    IS CREATED WITH REFERENCE & User has selected
    the record in ALV for Order Creation
      LOOP AT i_upload INTO wa_upload_1
                        WHERE chkbx = 'X'
                          AND vbeln NE space.
        MOVE wa_upload_1 TO wa_upload.
    Clear Work Area/Local variables & Internal tables
        CLEAR : l_sales_no,
                l_item_number,
                wa_header_in,
                wa_header_inx,
                wa_curr,
                l_currency,
                l_count,
                l_counter.
        REFRESH : i_cond,
                  i_cond_inx,
                  i_sch_in,
                  i_sch_inx,
                  i_items_in,
                  i_items_inx,
                  i_return,
                  i_partner_inx.
        AT NEW seqno.
    Get the Sales Order Number for corresponding record
          READ TABLE i_result_all INTO wa_result_all WITH KEY
                                          ref_no = wa_upload-vbeln
                                          seqno  = wa_upload-seqno.
          IF sy-subrc EQ 0.
            IF NOT wa_result_all-vbeln IS INITIAL.
              l_sales_no = wa_result_all-vbeln.
            ENDIF.
          ELSE.
            CONTINUE.
          ENDIF.
          READ TABLE i_curr INTO wa_curr
                            WITH KEY vbeln = l_sales_no.
    Header Data
          CLEAR wa_header_in.
          wa_header_in-sales_org  = wa_upload-vkorg.
          wa_header_in-distr_chan = wa_upload-vtweg.
          wa_header_in-division   = wa_upload-spart.
         wa_header_in-ref_doc    = wa_upload-vbeln.
         wa_header_in-ref_doc_l  = wa_upload-vbeln.
          wa_header_in-purch_no_c = wa_upload-bstnk.
          CLEAR : wa_header_inx.
          wa_header_inx-updateflag = 'U'.
          wa_header_inx-sales_org  = 'X'.
          wa_header_inx-distr_chan = 'X'.
          wa_header_inx-division   = 'X'.
          wa_header_inx-purch_no_c = 'X'.
    Check Business Object
          CLEAR : l_bus_object.
          IF wa_upload-auart = 'ZY01' OR
             wa_upload-auart = 'ZY07' OR
             wa_upload-auart = 'ZY08' OR
             wa_upload-auart = 'ZY09' OR
             wa_upload-auart = 'ZY18' OR
             wa_upload-auart = 'ZY94' .
            l_bus_object = 'BUS2032'.
          ELSEIF
            wa_upload-auart = 'ZY10' OR
            wa_upload-auart = 'ZY11' OR
            wa_upload-auart = 'ZY27' OR
            wa_upload-auart = 'ZY28' OR
            wa_upload-auart = 'ZY92' OR
            wa_upload-auart = 'ZY93'.
            l_bus_object = 'BUS2102'.
          ELSEIF
            wa_upload-auart = 'ZY16' OR
            wa_upload-auart = 'ZY30'.
            l_bus_object = 'BUS2094'.
          ELSEIF
            wa_upload-auart = 'ZY17' OR
            wa_upload-auart = 'ZY31'.
            l_bus_object = 'BUS2096'.
          ELSEIF
            wa_upload-auart = 'ZY06' OR
            wa_upload-auart = 'ZY26'.
            l_bus_object = 'BUS2032'.
          ENDIF.
    *Populate Ship-to-party
          IF NOT wa_upload-scode IS INITIAL.
            CLEAR wa_partner_inx.
            wa_partner_inx-document    = l_sales_no.
            wa_partner_inx-itm_number  = '000000'.
            wa_partner_inx-updateflag  = 'U'.
            wa_partner_inx-partn_role  = c_we.
            wa_partner_inx-p_numb_new  = wa_upload-scode.
            wa_partner_inx-refobjtype  = l_bus_object.
            APPEND wa_partner_inx TO i_partner_inx.
          ENDIF.
    Bill to Party
          IF NOT wa_upload-bparty IS INITIAL.
            CLEAR wa_partner_inx.
            wa_partner_inx-document    = l_sales_no.
            wa_partner_inx-itm_number  = '000000'.
            wa_partner_inx-updateflag  = 'U'.
            wa_partner_inx-partn_role  = c_re.
            wa_partner_inx-p_numb_new  = wa_upload-bparty.
            wa_partner_inx-refobjtype  = l_bus_object.
            APPEND wa_partner_inx TO i_partner_inx.
          ENDIF.
    Payer
          IF NOT wa_upload-payer IS INITIAL.
            CLEAR wa_partner_inx.
            wa_partner_inx-document    = l_sales_no.
            wa_partner_inx-itm_number  = '000000'.
            wa_partner_inx-updateflag  = 'U'.
            wa_partner_inx-partn_role  = c_rg.
            wa_partner_inx-p_numb_new  = wa_upload-payer.
            wa_partner_inx-refobjtype  = l_bus_object.
            APPEND wa_partner_inx TO i_partner_inx.
          ENDIF.
    Sales Rep
          IF NOT wa_upload-salesrep IS INITIAL.
            CLEAR wa_partner_inx.
            wa_partner_inx-document    = l_sales_no.
            wa_partner_inx-itm_number  = '000000'.
            wa_partner_inx-updateflag  = 'U'.
            wa_partner_inx-partn_role  = c_ys.
            wa_partner_inx-p_numb_new  = wa_upload-salesrep.
            wa_partner_inx-refobjtype  = l_bus_object.
            APPEND wa_partner_inx TO i_partner_inx.
          ENDIF.
    Check condition type & unit price
    For the following Document Types,
    Condition Type & Unit Price are mandatory
          CLEAR : l_item_number,
                  wa_upload_2.
          LOOP AT i_upload_2 INTO wa_upload_2
                        WHERE seqno =  wa_upload-seqno
                          AND chkbx = 'X'.
            CLEAR : wa_cond,
                    wa_result.
    Get the POSNR
            PERFORM conv_alpha_input USING  wa_upload_2-matnr
                                  CHANGING  wa_upload_2-matnr.
            CLEAR : wa_items.
            READ TABLE i_items INTO wa_items
                                WITH KEY vbeln = l_sales_no
                                         matnr = wa_upload_2-matnr.
    Check condition types
            IF wa_upload_2-auart = 'ZY16' OR
               wa_upload_2-auart = 'ZY17' OR
               wa_upload_2-auart = 'ZY30' OR
               wa_upload_2-auart = 'ZY31'.
    If error, then update the output table
              IF wa_upload_2-kschl IS INITIAL OR
                 wa_upload_2-kbetr IS INITIAL.
                CLEAR : wa_result_all.
                READ TABLE i_result_all INTO wa_result_all WITH KEY
                                            ref_no = wa_upload_2-vbeln
                                            mat_no = wa_upload_2-matnr
                                            kwmeng = wa_upload_2-kwmeng
                                            charg  = wa_upload_2-charg
                                            seqno  = wa_upload_2-seqno
                                            vbeln  = l_sales_no.
                IF sy-subrc EQ 0.
                  wa_result_all-status  = 'E'. " E
                  wa_result_all-remarks = text-007. " Condition Type & Unit
                                                  Price is mandatory
                  MODIFY i_result_all FROM wa_result_all INDEX sy-tabix.
                ENDIF.
                CLEAR : wa_result_all.
                CONTINUE.
    Else update the condition type & unit price
              ELSE.
                wa_cond-itm_number  = wa_items-posnr.    " ITEM NO.
                wa_cond-cond_type   = wa_upload_2-kschl. " CNDTION TYPE
                wa_cond-cond_value  = wa_upload_2-kbetr. " UNIT PRICE
                wa_cond-currency    = wa_curr-waerk.     " Currency
                APPEND wa_cond TO i_cond.
                CLEAR : wa_cond,
                        wa_upload_2.
              ENDIF.
            ELSE.
    For other document type, fill Condition type & Unit Price
              wa_cond-itm_number  = wa_items-posnr.    " ITEM NO.
              wa_cond-cond_type   = wa_upload_2-kschl. " CNDTION TYPE
              wa_cond-cond_value  = wa_upload_2-kbetr. " UNIT PRICE
              wa_cond-currency    = wa_curr-waerk.
              APPEND wa_cond TO i_cond.
              CLEAR : wa_cond,
                      wa_upload_2.
            ENDIF.
            CLEAR : wa_cond_inx.
            wa_cond_inx-itm_number = wa_items-posnr.
            wa_cond_inx-cond_type  = wa_upload_2-kschl.
            wa_cond_inx-cond_value = 'X'.
            wa_cond_inx-currency   = 'X'.
            APPEND wa_cond_inx TO i_cond_inx.
            CLEAR : wa_upload_2.
          ENDLOOP.
    DELETE Item Data from VBAP which has no matching entires in ALV
    if SAME Material occurs more than once in ALV for same key then
    count the no. of times the material occurs
          CLEAR : wa_upload_3,
                  l_counter.
          l_counter = 0.
          LOOP AT i_upload_2 INTO wa_upload_3
                                WHERE seqno = wa_upload-seqno
                                  AND chkbx = 'X'
                                  AND matnr = wa_upload-matnr.
            l_counter = l_counter + 1.
            CLEAR : wa_upload_3.
          ENDLOOP.
          PERFORM conv_alpha_input USING  wa_upload-matnr
                                CHANGING  wa_upload-matnr.
    check the corresponding no. of line items
    for the above material
          CLEAR : l_count,
                  wa_items.
          LOOP AT i_items INTO wa_items
                        WHERE matnr = wa_upload-matnr
                          AND vbeln = l_sales_no.
            CLEAR : wa_items_in,
                    wa_items_inx.
            IF l_count GE l_counter.
              wa_items_in-itm_number  = wa_items-posnr.
              wa_items_in-material    = wa_items-matnr.
              APPEND wa_items_in TO i_items_in.
              CLEAR wa_items_inx.
              wa_items_inx-itm_number    = wa_items-posnr.
              wa_items_inx-updateflag    = 'D'. " Delete Record
              wa_items_inx-material      = 'X'.
              APPEND wa_items_inx TO i_items_inx.
            ENDIF.
            l_count = l_count + 1.
          ENDLOOP.
    Convert material nos. to 18 digit no.
          REFRESH : i_upload_3.
          CLEAR   : wa_upload_3.
          i_upload_3[] = i_upload_2[].
          LOOP AT i_upload_3 INTO wa_upload_3
                                        WHERE seqno = wa_upload-seqno
                                          AND chkbx = c_x.
            PERFORM conv_alpha_input USING wa_upload_3-matnr
                                  CHANGING  wa_upload_3-matnr.
            MODIFY i_upload_3 FROM wa_upload_3.
            CLEAR : wa_upload_3.
          ENDLOOP.
    Delete materials which are not in ALV but are in line items
    for that sales order
          CLEAR : wa_upload_3,
                  wa_items_in,
                  wa_items.
          LOOP AT i_items INTO wa_items WHERE vbeln = l_sales_no.
            PERFORM conv_alpha_input USING  wa_items-matnr
                                  CHANGING  wa_items-matnr.
            READ TABLE i_upload_3 INTO wa_upload_3
                              WITH KEY matnr = wa_items-matnr.
            IF sy-subrc NE 0.
              wa_items_in-itm_number  = wa_items-posnr.
              wa_items_in-material    = wa_items-matnr.
              APPEND wa_items_in TO i_items_in.
              CLEAR wa_items_inx.
              wa_items_inx-itm_number    = wa_items-posnr.
              wa_items_inx-updateflag    = 'D'. " Delete Record
              wa_items_inx-material      = 'X'.
              APPEND wa_items_inx TO i_items_inx.
            ENDIF.
            CLEAR : wa_items,
                    wa_items_in,
                    wa_items_inx,
                    wa_upload_3.
          ENDLOOP.
    UPDATE Item Data RECORDS
          CLEAR : wa_upload_2,
                  wa_items_in,
                  wa_items,
                  wa_items_inx,
                  wa_sch_in,
                  wa_sch_inx,
                  l_item_number.
          LOOP AT i_upload_2 INTO wa_upload_2 WHERE
                                              seqno = wa_upload-seqno
                                              AND chkbx = 'X'.
    Read the Material no. from ALV & check whether the
    corresponding material exists in VBAP, if YES, then
    Update the line item data
            PERFORM conv_alpha_input USING  wa_upload_2-matnr
                                  CHANGING  wa_items_in-material.
    POPULATE ITEM NO -- Update the record
    If line item has same material twice,
    then appropriate POSNR should be assigned
            READ TABLE i_items INTO wa_items
                              WITH KEY vbeln = l_sales_no
                                       matnr = wa_items_in-material.
            IF sy-subrc EQ 0.
    If Reference is not contract then the process to assign
    POSNR is as follows :- Check the corresponding material
    from ALV with data from ITEMS, the record which matches
    the data is selected & POSNR is assigned to it
              IF wa_upload_2-oreason NE 'C'.
                CLEAR : wa_items_in1.
                READ TABLE i_items_in INTO wa_items_in1
                                  WITH KEY material = wa_items_in-material
                                         itm_number = wa_items-posnr.
                IF sy-subrc EQ 0.
                  CLEAR : wa_items1.
                  LOOP AT i_items INTO wa_items1
                                WHERE  vbeln = l_sales_no
                                  AND  matnr = wa_items_in-material.
                    IF wa_items1-posnr GT wa_items-posnr.
                      wa_items-posnr = wa_items1-posnr.
                      CLEAR : wa_items_in1.
                      READ TABLE i_items_in INTO wa_items_in1
                                  WITH KEY material = wa_items_in-material
                                         itm_number = wa_items-posnr.
                      IF sy-subrc NE 0.
                        EXIT.
                      ENDIF.
                    ENDIF.
                    CLEAR : wa_items1.
                  ENDLOOP.
                ENDIF.
              ELSE.
    If Reference is CONTRACT then the process to assign
    POSNR is different. Here if ALV has same material
    twice & ITEMS has it once, then the second occurrence
    of material of ALV is assigned a new POSNR
                CLEAR : wa_items_in1,
                        l_insert.
                READ TABLE i_items_in INTO wa_items_in1
                                  WITH KEY material = wa_items_in-material
                                         itm_number = wa_items-posnr.
                IF sy-subrc EQ 0.
                  CLEAR : l_lines,
                          l_insert,
                          wa_items_in1.
                  DESCRIBE TABLE i_items_in LINES l_lines.
                  READ TABLE i_items_in INTO wa_items_in1 INDEX l_lines.
                  wa_items-posnr = wa_items_in1-itm_number + 10.
                  l_insert = 'X'.
                  CLEAR : wa_items_in1.
                ENDIF.
              ENDIF.
    <b>          wa_items_in-itm_number  = wa_items-posnr.
              wa_items_in-target_qty  = wa_upload_2-kwmeng.
              wa_items_in-target_qu   = wa_items-zieme.
              wa_items_in-store_loc   = wa_upload_2-lgort.
              wa_items_in-plant       = wa_upload_2-werks.
              wa_items_in-batch       = wa_upload_2-charg.
              wa_items_in-route       = wa_upload_2-route.
              wa_items_in-sales_unit  = wa_upload_2-vrkme.
              wa_items_in-short_text  = wa_upload_2-maktx.
              APPEND wa_items_in TO i_items_in.</b>
              CLEAR wa_items_inx.
              wa_items_inx-itm_number    = wa_items-posnr.
              IF l_insert EQ c_x.
                wa_items_inx-updateflag    = c_i. " Insert Record
              ELSE.
                wa_items_inx-updateflag    = 'U'. " Update Record
              ENDIF.
              wa_items_inx-material      = 'X'.
              wa_items_inx-target_qty    = 'X'.
              wa_items_in-target_qu      = 'X'.
              wa_items_inx-store_loc     = 'X'.
              wa_items_inx-plant         = 'X'.
              wa_items_inx-batch         = 'X'.
              wa_items_inx-route         = 'X'.
              wa_items_inx-short_text    = 'X'.
              APPEND wa_items_inx TO i_items_inx.
            ENDIF.
    *Populate Ship-to-party
            IF NOT wa_upload_2-scode IS INITIAL
               AND l_insert IS INITIAL.
              CLEAR wa_partner_inx.
              wa_partner_inx-document    = l_sales_no.
              wa_partner_inx-itm_number  = wa_items-posnr.
              wa_partner_inx-updateflag  = 'U'.
              wa_partner_inx-partn_role  = c_we.
              wa_partner_inx-p_numb_new  = wa_upload_2-scode.
              wa_partner_inx-refobjtype  = l_bus_object.
              APPEND wa_partner_inx TO i_partner_inx.
            ENDIF.
    Bill to Party
            IF NOT wa_upload_2-bparty IS INITIAL
               AND l_insert IS INITIAL.
              CLEAR wa_partner_inx.
              wa_partner_inx-document    = l_sales_no.
              wa_partner_inx-itm_number  = wa_items-posnr.
              wa_partner_inx-updateflag = 'U'.
              wa_partner_inx-partn_role  = c_re.
              wa_partner_inx-p_numb_new  = wa_upload_2-bparty.
              wa_partner_inx-refobjtype  = l_bus_object.
              APPEND wa_partner_inx TO i_partner_inx.
            ENDIF.
    Payer
            IF NOT wa_upload_2-payer IS INITIAL
               AND l_insert IS INITIAL.
              CLEAR wa_partner_inx.
              wa_partner_inx-document    = l_sales_no.
              wa_partner_inx-itm_number  = wa_items-posnr.
              wa_partner_inx-updateflag  = 'U'.
              wa_partner_inx-partn_role  = c_rg.
              wa_partner_inx-p_numb_new  = wa_upload_2-payer.
              wa_partner_inx-refobjtype  = l_bus_object.
              APPEND wa_partner_inx TO i_partner_inx.
            ENDIF.
    Sales Rep
            IF NOT wa_upload_2-salesrep IS INITIAL
               AND l_insert IS INITIAL.
              CLEAR wa_partner_inx.
              wa_partner_inx-document    = l_sales_no.
              wa_partner_inx-itm_number  = wa_items-posnr.
              wa_partner_inx-updateflag  = 'U'.
              wa_partner_inx-partn_role  = c_ys.
              wa_partner_inx-p_numb_new  = wa_upload_2-salesrep.
              wa_partner_inx-refobjtype  = l_bus_object.
              APPEND wa_partner_inx TO i_partner_inx.
            ENDIF.
    Populate schedule Line
            CLEAR : l_datum,
                    wa_sch_in.
    For following condition types, schedule lines not required
            IF wa_upload_2-auart EQ 'ZY16' OR
               wa_upload_2-auart EQ 'ZY17' OR
               wa_upload_2-auart EQ 'ZY30' OR
               wa_upload_2-auart EQ 'ZY31'.
            ELSE.
              wa_sch_in-itm_number =  wa_items-posnr.
              wa_sch_in-sched_line =  '0001'.
              wa_sch_in-req_qty    =  wa_upload_2-kwmeng.
              IF NOT wa_upload_2-vdatu IS INITIAL.
               REPLACE ALL OCCURRENCES OF '.' IN wa_upload_2-vdatu WITH ' '.
                CONDENSE wa_upload_2-vdatu NO-GAPS.
                CLEAR : l_datum.
                l_datum =  wa_upload_2-vdatu.
                wa_sch_in-req_date = l_datum.
              ENDIF.
              APPEND wa_sch_in TO i_sch_in.
              CLEAR wa_sch_inx.
              wa_sch_inx-itm_number    = wa_items-posnr.
              wa_sch_inx-sched_line    = '0001'.
             IF wa_upload_2-oreason = 'C'.
               wa_sch_inx-updateflag    = c_i.
             ELSE.
              wa_sch_inx-updateflag    = 'U'.
             ENDIF.
              wa_sch_inx-req_qty       = 'X'.
              wa_sch_inx-req_date      = 'X'.
              APPEND wa_sch_inx TO i_sch_inx.
            ENDIF.
            CLEAR : wa_upload_2,
                    wa_items_in,
                    wa_items,
                    wa_items_inx,
                    wa_sch_in,
                    wa_sch_inx.
          ENDLOOP.    "LOOP AT i_upload to wa_UPLOAD_2
    Change Sales Order
          CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
            EXPORTING
              salesdocument               = l_sales_no
              order_header_in             = wa_header_in
              order_header_inx            = wa_header_inx
              SIMULATION                  =
              BEHAVE_WHEN_ERROR           = ' '
              INT_NUMBER_ASSIGNMENT       = ' '
              LOGIC_SWITCH                =
              TABLES
              return                      = i_return
              order_item_in               = i_items_in
              order_item_inx              = i_items_inx
             partners                    = i_partner
              partnerchanges              = i_partner_inx
              PARTNERADDRESSES            =
              ORDER_CFGS_REF              =
              ORDER_CFGS_INST             =
              ORDER_CFGS_PART_OF          =
              ORDER_CFGS_VALUE            =
              ORDER_CFGS_BLOB             =
              ORDER_CFGS_VK               =
              ORDER_CFGS_REFINST          =
              schedule_lines              = i_sch_in
              schedule_linesx             = i_sch_inx
              ORDER_TEXT                  =
              ORDER_KEYS                  =
              conditions_in               = i_cond
              conditions_inx              = i_cond_inx
              EXTENSIONIN                 =
    COMMIT
          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
             EXPORTING
               wait   = ' '
            IMPORTING
              return = wa_commit.
          WAIT UP TO 5 SECONDS.
    Best regards,
    Prashant

  • Creating inbound delivery for the purchase order line items

    Hi Experts,
    Please let me know how can I create inbound delivery for the purchase order line items?  Say, I have a purchase order with 5 line items in it.  I wanted to create an inbound delivery for only 2 line items at this point of time.  Which SAP Standard transaction I have to use and what all  data I need to populate?  I would appreciate any help on this and will reward the right answer.  Please let me know.
    Thank you in advance.
    with regards,
    Muthu Ganapathy.

    Hi,
    While creating the inbound delivery (VL31N), intially all the items will be shown, see the advance shipping notfication - from the vendor for which he has send confirmation & rest items you can delete simply & save. & next time when the vendor sends rest advance shipping notifcation (confirmation), you can receive them.
    Hope this answers your query.
    Regards
    Irfan.

  • Error when posting Open AR Line Items

    hello iam posting Open AR Line Items for contract account using message type
    CTRACDOCUMENT_CREATE using lsmw idoc method .iam getting error as Document type not defined but actually when iam creating document manually item is created with out any error that means it is defined and my functional consultant is also saying he defined document type.can some body explain me what is the problem.
    Regards
    priya

    Hi Priya,
    As you are using the Idoc method, is the Partner profile correctly defined.
    Please could you elaborate your error in a bit more detail.

  • Dreamweaver CS4  Clear the "Open a Recent Item"  window

    Dreamweaver CS4  Clear the "Open a Recent Item"  window
    *****  But you must be in the user profile that you created the website with or you will not see the Recent list folder in the registry !!!!!
    ***** you will have registry rights to Delete files that user created.
    ****  If you do not have authority, you must find the user profile as an Administrator.
    Click Start
    then RUN
    type REGEDIT  in the run box
    then in the registry got to,
    HKEY_CURRENT_USER
        Software
         Adobe
         Dreamweaver CS4
    There will be a "Recent File List" you can delete all the files inside of it.

    Why eliminate it? It doesn't require any extra clicks.
    The Startup page can be handy to return to documents you have
    been working
    on, creating new documents and many other features. If you
    don't need it
    just click on what you do need; .
    If you insist, you can put a checkmark in "Don't show again"
    "Feadel" <[email protected]> wrote in
    message
    news:goejan$nrk$[email protected]..
    > When we are open Dreamweaver. The dreamweaver have
    default pop up start
    > up. It saw
    Open a Recent Item. How To clear it.

Maybe you are looking for