Changes in cash journal line item-fbcj

Hi SAP guru,
Cash journal was posted through fbcj , due to some reason text and assignment field of this cash journal was changed in fb03. But changes done in through fb03 has not been reflecting in fbcj. Please reply how to change the same.
thanks in advance
rajesh

Hi,
Have you save the document after the changes done ?
Regards
Partha

Similar Messages

  • How to find out Last Changed Fields for a line item of a PO

    Dear All,
    Pls let me know is there any FM or procedure to find the last changed fields for each line item of a PO. I should be able to get the details on the basis of Last changed Date. Can u pls guide me in this?

    Hello,
    Check the table CDHDR,CDPOS for PO items,
    Check this code:
    REPORT ZV_GET_LATEST_SO .
    DATA: BEGIN OF ITAB OCCURS 0,
            OBJECTCLAS TYPE CDHDR-OBJECTCLAS,
            OBJECTID TYPE CDHDR-OBJECTID,
            CHANGENR TYPE CDHDR-CHANGENR,
            USERNAME TYPE CDHDR-USERNAME,
            UDATE TYPE CDHDR-UDATE,
            UTIME TYPE CDHDR-UTIME,
            TCODE TYPE CDHDR-TCODE,
            TABNAME TYPE CDPOS-TABNAME,
            TABKEY TYPE CDPOS-TABKEY,
            FNAME TYPE CDPOS-FNAME,
            CHNGIND TYPE CDPOS-CHNGIND,
          END OF ITAB.
    TABLES: CDHDR,CDPOS.
    DATA: LT_CDHDR LIKE CDHDR OCCURS 0 WITH HEADER LINE,
    LT_CDPOS LIKE CDPOS OCCURS 0 WITH HEADER LINE.
    *REFRESH AUSG.
    CLEAR CDHDR.
    CLEAR CDPOS.
    CDHDR-OBJECTCLAS = 'EINKBELEG'.
    CDHDR-OBJECTID   = '0000001784'.  " Purchase order number
    **SELECT A~OBJECTCLASS A~OBJECTID A~CHANGENR A~USERNAME A~UDATE A~UNAME
    **B~TCODE
    **B~TABNAME B~TABKEY B~FNAME B~CHNGIND INTO TABLE ITAB FROM CDHDR AS A
    **INNER JOIN CDPOS AS B ON A~OBJECTCLASS = B~OBJECTCLASS
    **                         A~OBJECTID    = B~OBJECTID
    **                         A~CHANGENR    = B~CHANGENR
    **                    WHERE OBJECTCLAS = 'VERKBELEG'
    **                      AND OBJECTID = '0000001784'.
    *SELECT * FROM CDPOS INTO TABLE LT_CDPOS WHERE OBJECTCLAS = 'VERKBELEG'
    *                                    AND OBJECTID = '0000001784'.
    *IF NOT LT_CDPOS[] IS INITIAL.
    *  SELECT *
    *  INTO   TABLE LT_CDHDR
    *  FROM   CDHDR
    *  FOR    ALL ENTRIES IN LT_CDPOS
    *  WHERE  OBJECTCLAS = LT_CDPOS-OBJECTCLAS
    *  AND    OBJECTID = LT_CDPOS-OBJECTID
    *  AND    CHANGENR = LT_CDPOS-CHANGENR.
    *ENDIF.
    **  SORT ITAB BY OBJECTCLAS ODJECTID DESCENDING.
    *LOOP AT ITAB.
    *  WRITE: ITAB-UDATE."ITAB-UNAME.
    *ENDLOOP.
    *--- Interne Tabellen -------------------------------------------------
    DATA: BEGIN OF ICDSHW OCCURS 50.       "Ausgabeaufbereitung
            INCLUDE STRUCTURE CDSHW.       "Zwischendatei
    DATA: END OF ICDSHW.
    CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'
         EXPORTING
              DATE_OF_CHANGE    = CDHDR-UDATE
              OBJECTCLASS       = CDHDR-OBJECTCLAS
              OBJECTID          = CDHDR-OBJECTID
              TIME_OF_CHANGE    = CDHDR-UTIME
              USERNAME          = CDHDR-USERNAME
         TABLES
              I_CDHDR           = LT_CDHDR
         EXCEPTIONS
              NO_POSITION_FOUND = 1
              OTHERS            = 2.
    LOOP AT LT_CDHDR.
      CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'
        EXPORTING
    *   ARCHIVE_HANDLE                = 0
          CHANGENUMBER                  = LT_CDHDR-CHANGENR
    *   TABLEKEY                      = '00000000 '
    *   TABLENAME                     = ' '
    * IMPORTING
    *   HEADER                        =
       TABLES
         EDITPOS                       = ICDSHW
    *   EDITPOS_WITH_HEADER           =
    * EXCEPTIONS
    *   NO_POSITION_FOUND             = 1
    *   WRONG_ACCESS_TO_ARCHIVE       = 2
    *   OTHERS                        = 3
      IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      LOOP AT ICDSHW.
        IF ICDSHW-TABKEY+3(10) = '0000001784'
           AND ICDSHW-TABKEY+13(6) = '000001'.
        ENDIF.
      ENDLOOP.
    ENDLOOP.
    Vasanth

  • Price changes in Purchase order Line Items its displaying as"WF-BATCH"

    Hi Experts,
    I need some Information about Price changes in Purchase order Line Items,In PO Documents Price changes through this wf-batch has  changed the value of this row to xxx.xx USD, which does not correspond the invoice.
    If  i selected the Item changes in the Purchase Order its displaying as"WF-BATCH".
    So please try to clarify where this batch originates from.
    Brgds,
    RK

    Hi Jurgen,
    Thanks for your reply.
    But how i can check this in Purchase orders,on what basis this price changes information is recorded in PO Line Item level.
    can you pls guide me some steps to check the price changes through WF-BATCH.
    Brgds,
    RK

  • How to change the cash journal voucher

    Hi
    Pls advice how to change  the cash journal voucher lay out , that is auto generated in the system.
    I need to add some fields.
    Thanx

    Hi,
    U need to develop your own layout with the help of your ABAPer with the required fields.
    Then Go to the following path
    Display IMG --> Financial Accounting --> Bank Accounting --> Business Transactions --> Cash Journal --> Setup Print Parameters for Cash Journal.
    Hope you are clear.
    Cheers
    P O I N T S

  • User Exit to make changes in sales order line item data.

    Hi All,
    I need to know about user exit by whcih I can make changes in sales order line item details --> Account assignment tab --> Sales order no and line item no.
    I want to make changes so as to bring the active maintenance contract no and line item no here instead of sales order no and line item no. So whenever ( Va02 or Va03) we go to sales order line item and se the account assignment tab I should see the contract no there.
    Just let me know the USER EXIT to do the above changes.
    Points will be awarded.
    Regards,
    Satish.

    Hi,
    Please have a look at the following user exits...
    1. user exit_ save_document
    2. user exit_save_document_prepare
    Regards
    sankar

  • Can we change pricing date for line item in billing

    Hi Expert,
    Can we change pricing date , while raising inoice for particular line iteam

    Hi,
    We can not change the pricing date for perticular line item at billing document level, the only option is we can enter the required date at the time of invoice creation in VF01 screen.
    If your requirement is copying the same pricing date that is entered at sales order, then do the following.
    Go to T Code:VTFL and choose your DElivery Type and Billing Type, then choose your item category and then change the pricing type as 'D' .
    Regards,
    Pasapula.

  • Exit or Enchancement for changing amount in vendor line item in MIRO

    Dear All,
    I want to change the amount in vendor line item which get posted through MIRO.System generated 2 line item in case of payment terms of retention is used.
    Requirement is that, in one line item of vendor, amount should get changed based on the logic and adjust the amount in other line item of vendor.
    Request to please let me know, Where in Exit/ Badi or enhancement spot, we can write our coding, so that it should update the amount with new value at the time of posting the document.
    Thanks & Regards,
    Abhinav Jain

    Hi,
    Try with Badi   ACC_DOCUMENT
    Regards,
    Azeem

  • 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

  • Automatic posting of cash discount - line items in payment document

    SAP Guru's,
    I need your help to find out the reason why the system posting to few lines in some times, one line in some times of the cash discount taken on vendor payment i.e in payment document.. where is the configuration settings.
    Your help would be higly appreciated.
    rgds,

    Thanks Bharathi for the reply..
    Here payment document having the few cash discount lines, one bank line and one vendor line on payment of nearly 100 invoices in one day to one vendor.
    i.e
    Vendor A/c     Dr    100
      To Bank                    Cr 95
      To cash discount       Cr 02
      To cash discount       Cr 03
    I need to find out on what basis it is creating few line items though payment terms, base line and tax code are same.
    Thank you.

  • Not able to change the the Contract Line Item Payer

    Hi there,
    I am not able to change the Contract Line item Payer and giving an error message '' Credit limit customer differs from credit limit customer in header''.
    I checked the credit management assignment and the Business partner is assigned with the required Payer.
    Request your help.
    Thanks,
    Renjith

    Hi Renjith
    So first of all  check with which customer you have created Contract. So go to CMR data and check wheather you have maintained multiple Payers or not. If not maintained maintain multiple payers.
    As you are getting error  '' Credit limit customer differs from credit limit customer in header'' , so check the payer at header level and item level also. the payer at header level and item level should be different.
    Regards
    Srinath

  • How to change column heading in line item report

    Hello Experts,
    How to change the column heading in the line item report CJI4 or CJI3  ?
    for eg: The field WBS will show as Object in the heading. Here  I would like to change to WBS.
    Is there a way to do this without changing ABAP code
    FATMAN

    Not possible through standard I guess.
    Enhancement you should be looking is COOMEP01 which includes the component EXIT_SAPLKAEP_009
    i.e., Line Item Reports: Customer-specific Formatting of the Lists.You use this enhancement to modify column headings.
    Regards
    Sreenivas

  • Outgoing cash Payment line item account not printed

    Hi,
       In case any cash payment raised through outgoing payment, line item(account name, amount, etc..) table is printed. If check payment, we can get the print(Line item) out. If anybody knows the reason for not printing the table. please tell me.
    Thanx in advance,
    Suresh.

    Kevin,
            If it's one line, we can do as say, We have more than one line. we need repetative area.
    Scenario,
    Screen:    Outgoing Payment
    Select:       Account  ( not customer or not supplier)
    line table(Account) : Enter more than one line.
    Payment mode:  Cash.
    finally Check  the printout:   Line table which contains accounts are not coming in the printout.
    Created:  Own PLD.
    Suresh.

  • Make changes to auto generated line items when posting invoice thru MIRO?

    Hi All,
    My requirement is to make some changes in line items data when posting invoice through MIRO transaction.
    I have written a substitution for the same, The issue is that some line items get automaticaly created (i.e inter company posting). I need to make changes to these line items as well but substitution is not being triggered for these auto generated line items.Is there any way by which I can update in these line items as well ?
    further do we have any internal table which holds all the line items at runtime....to which I can refer and make the changes. I have searched but could not find one.
    Can anybody provide some inputs on this.
    Thanks,
    Lucky.

    Hi Kaushik,
    Thanks for your reply.
    I am using BADI INVOICE_UPDATE but here we will not be having line items which are auto generated.
    When we do inter company posting, line items are automatically created and these are not avaliable in the BADI. I am not sure if we can trap these line items any where.....the possible alternative which I can think of is to use memory reference and modify the internal table which holds all the items but unfortunately I am not able to find any such internal table to refer to at run time ...have u got any idea on this?
    Thanks,
    Lucky.

  • Mass change requisitioner in PR line items

    Hi, is it possible to do a mass change in PR line items? (specifically the Requisitioner column) One PR has like 50 line items.  How do we change the Requisitioner column easier and faster? thanks!

    Hi,
    Use T.Code MEMASSRQ
    Maruthi Reddy

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

Maybe you are looking for

  • Pdf availability in alv grid

    Hi gurus, I have a doubt . Does ALV GRID supports for PDF FILE dowmload of an alv report.I mean to say that is there any icon provided on alv grid to down load the report as pdf file to local disk.I know spread sheet down works. kindly reply << Remov

  • Tacacs+ authentication errors

    I am having problems getting TACACS+ AAA working with my 3560 switches. I have set up users, groups, and NDG on ACS SE as per the CS ACS course material and have triple checked my keys to make sure they match. I have attached debug from switch for au

  • X48C Strange efficiency issue with FAN

    Hello, I have a strange issue in Hardware Monitor Efficiency in BIOS.     When I connect a Fan (12 cm with 4 led) to Motherboard SYSFAN2 (or other SYSFAN)  efficiency of the system drops to 40%, but when I remove the FAN efficiency goes up to 90%. Wh

  • Call to super must be first statement

    I'm new to Java and I have a question regarding super(). I'm implementing a design where we have a custom exception which extends Exception. The design calls for null messages to lead to throwing an IllegalArgumentException, but Exception's construct

  • Visibility for a particular customized record.

    We are facing an issue of visibility for a particular customized record. As customized record costing is created automatically using web services, so by default it is picking the name of the Administrator.How can we remove admin by default and assign