My Client wants to restrict appearing used PO Line items in MIRO

Hi Gurus
My client wants to restrict appearing blank line items agaisnt already used Purchase Order Items (Full Qty GR / IR happened, GR Based IV) in MIRO so that user can not book another invoice against the same PO with diffrent ref. no. and in date.
Is there any way (User Exit / Screen Variant) we can make it?
Please reply.
Thanks
Sanjib

Hi
Even if I set Final Invoice Indicator in MIRO and booked invoice against the PO systems is showing blank line items (Amt & Qty are blank) in MIRO agaisnt the PO.
Can you please run the scenario and tell me is there any way that we can restrict system showing blank line items against already processed PO items in MIRO. I have tried booking invoice agaisnt individual del note but blank line items are there.
Thanks
Sanjib

Similar Messages

  • I am using iplanet messaging 5.2. I want to send mail using command line. Anyone knows exact command line syntax.

    I am using iplanet messaging 5.2. I want to send mail using command line. Anyone knows exact command line syntax.
    Thanks
    -Vasu

    #telnet 0 25
    mail from: user1 #email source
    rcpt to: [email protected] #email destination
    data #begin email content
    Subject: Hi, This is a test mail #optional subject
    Hi, Please don't pay attention to this email, just a test
    . #end email content
    quit #Quit SMTP
    #

  • Restriction on number of line items in an automatically generated document

    Hi all,
    As per my info, an accounting document must have a minimum of 2 line items to complete the document. At the same time an accounting document can have a maximum of 999 line items.
    My observation:-
    When I am posting depreciation using t-code AFAB, system is posting depreciation document (document type AF). While checking, I found that the system has posted around 16 document for a period.
    On further checking, I observed that the each document contains a max 100 line items.
    I am using SAP 4.7
    My Query:-
    a> Is there any way / place wherein we can restrict the maximum number of line items possible for a given docuemnt type or for all document types in the client?
    b> In case it is not possible to restrict the number of line items per document, what could be possible reason for the system behaviour wherein it is posting about 100 line items per document & thereafter starts a new document.
    Thanking you in advance
    Santosh K Agarwal

    Hi,
    I have been reading CIN. There I came across with a statement i.e. "There is restriction on no of line items to be in an Excise Invoice".
    where you read this i dont know
    but yes for outgoing excise invoice we can put limitation in sap cin
    as per incoming excise invoice i think no  limitation
    in path SPRO-tax on goods movemnet-India-basic setting-maintain excise registration here you can maintain this
    and yes this for india only for other country they may have different
    Regards
    Kailas ugale

  • Restriction in Material Document Line item

    Dear SAP Gurus,
    I am new to SAP. Please let me know is there any way by which i able to restrict no of line item in Purchase order (for specific Purchase order type) document? Your help will be appreciated.

    Hi Soumen,
    You can only control the screen elements till "HDRO" (Hide, Display, Required, Optional) from Standard configurations, where as you cannot control /restrict the number of line items. You have to use a user exit for this. Check this Exit. "MM06E004  Control import data screens in purchase order".
    From a Standard Practice, it is always better to educate the user not create too many line items in a purchase order. A Manual and process oriented control is always better in this case than direct control from the system.
    Moreover, if you can also define the exact problem you are facing, SAP guru's can give you a better solution.
    Thanks & regards
    Hameed Parvez

  • REGARDING RESTRICT THE DELETION OF LINE ITEM FROM CONFIRMATION SCREEN

    Dear All,
    Plz let me know how can we restrict to delete the line item(components) from the goods movement screen of confirmation of order(Cor6n) screen.
    Thanks & Regards,
    Arvind S

    Hi Aravind
    i just want to restrict the deletion only for particular user id's.
    I know we can do through authorization by creating authorization object.. am i right??
    I am not sure bout any authorization object can help you. However you can have the transaction variant for COR6N with quantity field as output also note this can be user specific.
    So you have no need to have custom transaction or development.
    Regards,
    R.Brahmankar

  • Condition type not appearing in PO line item

    Dear All
    I made a condition type Y001 for agriculture tax with below mentioned config. and marked as both header and item condition.
    Cond. class   A Discount or surcharge
    Calculat.type A Percentage
    Cond.category B Delivery costs
    Manual entries      C Manual entry has priority
    Now problem is that when I am making contract in contract line item condition Y001 condition is appearing in dropdown and I am able to enter the same in contract and save it.But when I am trying to make a PO by referring the same contract with line item condition Y001, this same condition is not appearing in PO and also it is not appearing in dropdown also so that I can manually enter the same.
    Please let me know why system is behaving like this.
    Regards
    SK

    satish kumar wrote:
    In short condition type Y001 is appearing in contract line item condition tab while making contract but same condition is not appearing in PO line item condition tab while making PO.
    Hi Satish,
    Perhaps you have not assigned the pricing procedure to the Purchasing Orgn & Vendor in IMG Schema determination. Have a chk once and if you have assigned try maintaining a PIR and I hope it should populate the priceing procedure and your cond type Y001 in the PO also.
    Anything pls revert
    Regards
    Shiva

  • Restriction on number of line items in an Excise Invoice

    Hi SAP Gurus,
    I have been reading CIN. There I came across with a statement i.e. "There is restriction on no of line items to be in an Excise Invoice".
    I wanna know more about it. Besides, If this is true then is this applicable for India only or for every country who deals in it?
    Thanks a ton in advance.
    Regards,
    Prerna Garg

    Hi,
    I have been reading CIN. There I came across with a statement i.e. "There is restriction on no of line items to be in an Excise Invoice".
    where you read this i dont know
    but yes for outgoing excise invoice we can put limitation in sap cin
    as per incoming excise invoice i think no  limitation
    in path SPRO-tax on goods movemnet-India-basic setting-maintain excise registration here you can maintain this
    and yes this for india only for other country they may have different
    Regards
    Kailas ugale

  • Pack without using delivery line items

    Hello Abappers,
    Packing using function module WS_DELIVERY_UPDATE is used to pack a delivery and is working fine. However this function module packs by delivery line item so HU's cannot be packed more or less in quantity than the delivery line item. The client wants to pack the delivery as a whole balancing out the packing loads on the HU's as is done when packing manually so that each HU is loaded as close to capacity as possible. Has anybody had experience with using this FM or another where the delivery is packed as a whole and not by line item.
    Thanks

    Hello Chaithru.
    check include MV50AFZ1, form  USEREXIT_SAVE_DOCUMENT_PREPARE.
    If delivery number already given, you should be able to save text with function module SAVE_TEXT in this user exit.
    Best Regards, Dirk

  • Master Data Text Used as Line Items in ODS

    Hi Experts! </br></br>
    I would just like to know if I can use the text I loaded of master data Revenue Type from R/3 in BW? </br></br>
    What I have done already is that I have created a customized extractor in R/3 under the CO-PA-IO node in RSA6 (since I think this is where this data is coming from/should belong under. A consultant of ours (before I got here) have already set up the other individual extractors for Sub Product A & B, Product Line, others in the FS10N transaction, document line item details.</br>Hi Experts! </br></br>
    I would just like to know if I can use the text I loaded of master data Revenue Type from R/3 in BW? </br></br>
    What I have done already is that I have created a customized extractor in R/3 under the CO-PA-IO node in RSA6 (since I think this is where this data is coming from/should belong under. A consultant of ours (before I got here) have already set up the other individual extractors for Sub Product A & B, Product Line, others in the FS10N transaction, document line item details.</br></br>
    Once I have created it, I  already replicated it in BW and have already setup the infosource. I created a InfoObject as Master Data with text and I loaded data from infosource. After loading, when I maintain Master Data for the characteristic I created in BW, I can see the pulled data that I have loaded from R/3. It is correct. </br></br>
    Now this is where I am having a problem. I need to know how to be able to use this Master Data text when I load line items (0EC_PCA_3) to my PCA ODS. As it is right now, I have setup the EC_PCA datasource, replicated it and activated it as well, and I have already added a Revenue Type characteristic to this datasource already and have mapped it accordingly. However, I am unable to pull any data when i manage the contents of the ODS, but i can see the it in the maintain master data. </br></br>
    How can i set it up such that I am also able to match my line items with their corresponding Rev Type Text in the ODS results? It is important to note that for Sub Product A, B, and Product Line fields, the previous setup is able to do so, and I am able to see results for these in the ODS line items results. These are also setup as master data text in BW by our previous consultant and I followed the same procedure and setup. </br></br>
    I feel that I am just missing a step on how to tell BW that the master data text should also be matched to the Line Items in the ODS during loading.</br></br>
    Kindly seeking for your assistance and advance thanks!
    Once I have created it, I  already replicated it in BW and have already setup the infosource. I created a InfoObject as Master Data with text and I loaded data from infosource. After loading, when I maintain Master Data for the characteristic I created in BW, I can see the pulled data that I have loaded from R/3. It is correct. </br></br>
    Now this is where I am having a problem. I need to know how to be able to use this Master Data text when I load line items (0EC_PCA_3) to my PCA ODS. As it is right now, I have setup the EC_PCA datasource, replicated it and activated it as well, and I have already added a Revenue Type characteristic to this datasource already and have mapped it accordingly. However, I am unable to pull any data when i manage the contents of the ODS, but i can see the it in the maintain master data. </br></br>
    How can i set it up such that I am also able to match my line items with their corresponding Rev Type Text in the ODS results? It is important to note that for Sub Product A, B, and Product Line fields, the previous setup is able to do so, and I am able to see results for these in the ODS line items results. These are also setup as master data text in BW by our previous consultant and I followed the same procedure and setup. </br></br>
    I feel that I am just missing a step on how to tell BW that the master data text should also be matched to the Line Items in the ODS during loading.</br></br>
    Kindly seeking for your assistance and advance thanks!

    Hi Simon, </br></br>
    Thanks for the reply! </br></br>
    First of all, yes, I think we are on the same page regarding what I want to do... I have created a master data infoObject in BW, created a customized extractor in R/3 under CO-PA-IO node, and mapped them to each other in BW such that when i execute a package in InfoSource in BW, i am able to load master data text in InfoObject Rev Type in BW. </br></br>
    Kindly explain more on "you should have created the revenue type as a text datasource and loaded the data into the text and not the master data". Do you mean to say that I should have just created a regular datasource (i.e. Flexible Update in any Data Target InfoSource), rather than a direct update of Master Data datasource? </br></br>
    However, if this is what you meant, please remember that for other characteristics such as Sub Product A, B, Product Lines, Sales Region, Business Center etc. (as seen in FS10N tcode per GL), are reflected in ODS per line item, and they are setup as master data. So I was thinking maybe i just missed a step in mapping. </br></br>
    Is this what you meant? My main goal is to be able to have the line items i load in ODS be matched to the particular revenue type for that GL's profit center (seen in FS10N tcode in R/3)</br></br>
    Thanks again.

  • Restrict Number of Open line items selected for vendor payment in F-58

    Dear Experts,
    simply in F-58 i want the system to issue an error message if the user select more than 10 or maybe 15 open line items for payment, the reason is to make sure that the number of line items selcted will fitt in the From specified for printing.
    is there a way to do so ?
    i already got on but not sure how to use it.
    please advice
    Thanks and regards
    Mohamed Talaat

    hi,
    my restricition is regarding the form that the key user want only one cheque paper to be prininted and the space for that can hold only like 10 or 15 line items so he just want to define this number and cant exceed it in one paymnet.
    payment advice control i think can do this but am not sure its under t.code FBZP payment method in company code, haveyou try this before ?
    and how come we design the form for multiplie pages andthen accomidate in one page ?
    as they insert in the oprinter a seralized prinitng cheques paper sequincely.
    please clarify
    Regards
    M.Talaat

  • Restrict Availability check for Line item in sales order

    Hi Folks,
         My requirement is some what different than the usual,I want to stop availability check for a particular line item,while creating sales order on a particular condition (example when quantity is changed for that line item),please suggest if there is any way to do so.
    Thanks for your valuable support.

    Hi
    we need to maintain the username of the person who has triggered this process through XI .
    I BAPI we cannot instruct the BAPI to maintain a specific username.
    that is why i am using this FM because this will allow us to maintain the change history with the username we want
    Regards
    Nikhil

  • Purchase Document not appearing on GL Line item report

    Hi gurus: Please help me figure out why even though I have activated the purchase document field in the field status group I still cannot see it in the line item reports when I run FBL3n. Note the purchase document field is showing up as a field for selection but it comes thru blank.
    Please help me
    thanks
    Brian

    i wanted to get the same output, it doesnt work for some reason. I had to craete a query to achieve this

  • '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

  • Multiple line item not appearing in vendor line item in FB60

    Hi
    I am posting FB60 accounting entry. I am deducting WHT on the invoice.
    For ex: Expense amount - Rs. 100000, WHT - 10000
    Hence accounting entry is posted:
    Expenses A/c.. Dr 100000
       To TDS Payable 10000
       To Vendor A.c 90000
    Now when i see vendor line item in FBL1N there is only one credit line item for Rs.90000.
    But my requirement is that, vendor line item report should include two line item:
    One for vendor credit i.e. Rs.100000 and one debit for TDS payable for Rs. 10000 and not single line item for Rs.90000
    Please let me know how can i get this. Is there any standard report for the same?

    Hi friend,
    unfoortunately the system doesn't post debit for vendor in this case. You have no report to display line items that wasn't posted.
    would you like have it:
    31 - Vendor ... 10,000.00
    25 - Vendor............1,000.00 *
    40 - expense .......10,000.00
    50 - WHT ..........1,000.00
    The standard automatic WHT post directly the invoice amount to vendor account like this:
    31 - Vendor ... ...9,000.00
    40 - expense ........10,000.00
    50 - WHT ...........1,000.00
    Tell about your business process. What are you doing for ?
    regards

  • Want to Change GL Account in Line Item of KSV5

    Hi,
    In my requirement I need to change GL Account in one of Actual Line Items of transaction KSV5(Execute Actual Distribution).
    Can any one suggest the Userexits/BADi for this kind of change or any other way to do.
    Thanks.
    RP

    check this exits
    SAPLKAL1              Allocations: Authorization Check in Cycle Maintenance
    SAPMKAL1             Allocations: Authorization Check in Cycle Maintenance
    SAPMKGA2            Allocation: Execute Authorization Check for Cycle

Maybe you are looking for