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

Similar Messages

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

  • 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

  • SD - Accounting document line items are generating for each item

    Hi all of you,
    We have done account determination for SD. Accounting documents are also generating, but with in the invoice accounting document, number of line items are generating for each item with in the sales order, standard invoice type is F2 like -
    Item 001 - X Material
    Item 002 - Y Material
    Item 003 - Z Material
    The accounting document is -
    Line Item 001 - Customer Ac Dr
    Line Item 002 - Discount A/c Dr
    Line Item 003 - Sales revenue
    Line Item 004 - Discount A/c Dr
    Line Item 005 - Sales Revenue
    Line Item 006 - Discount A/c Dr
    Line Item 007 - Sales revenue
    Line Item 008 - VAT
    Even, in my experience I did not find this type of entry and the sales revenue and discount accounts are same with in the COA and is posted with in the plant.
    Please give me your valuable suggestion to rectify the above issue.
    Regards,
    Ramki
    Edited by: Ramki on Nov 5, 2009 10:06 AM

    Dear Ramki,
    This is SAP Standard. System generates Accounting document line item for each Line items in Invoice.
    This is standard & also required bacuase say you have different Material types in single Invoice (e.g.Material & Service items, Trading Goods, etc). The valuation class assigned to these Material Types may be different & you might want to post revenues from these Line items in different GL Accounts.
    Hope this helps. .
    Thanks,
    Jignesh mehta

  • Function module for FI document change with G/L line items

    Hi!
    Does anybody know how to change FI document with G/L line items (fields like XREF3, SGTXT, ZUONR - generally speaking, all the fields can be changed with FB02)?
    FM FI_DOCUMENT_CHANGE has needed functionality and works well for account payables and account receivables line items, but it doesn't handle general ledger line items.
    Regards,
    Maxim.

    Hello!
    The function has some mandatory fields to use:
    I_AWTYP -> get value from BKPF-AWTYP for the specific document;
    I_AWREF -> number of the document to change;
    I_AWORG-> concatenate document's company with respective year;
    Then, only one of the following fields should be filled:
    i_lifnr,
    i_kunnr,
    i_obzei,
    i_buzei.
    You can find the relevant data for this fields in BSEG.
    The structure I_BSEGC should be filled with data you think appropriate. I didn't tested it, but i think the first fields are sufficient.
    Then, add lines (1 for each field you wish to change) in table T_ACCCHG.
    However, you should notice that you're not allowed to change all fields. For instance, KKBER is one of the fields that is forbidden to change in this FM.
    Hope that helps.
    Rui Delca Mendes

  • General Ledger Accounting (New): Line Items of the Leading Ledger

    Hello Guys,
    We are planning to implement
    General Ledger Accounting (New): Line Items of the Leading Ledger
    0FI_GL_14
    We are in ECC6 sap_appl 6.00 and BI 7.0 SP 14, BI Content 7.3 level 4.0
    The new GL line item is available
    Financial Accounting: General Ledger Accounting (FI-GL)
    Available as of Release - SAP Enhancement Package 3 for SAP ERP 6.0
    Shipment - SAP NetWeaver 7.0 BI Content Add-On 3 Support Package 08
    Content Versions- 1.0; 703
    Just we have  to install SAP NetWeaver 7.0 BI Content Add-On 3 Support Package 08  and on ECC side SAP Enhancement package 3 for ERP 6.0 --. Financial accounting - SAP APPL 603.
    Is it correct. Can you please confirm.
    Thanks
    Senthil

    Hello Senthil,
    Yes, thats engough, since SAP is recommending the same for that datasource 0FI_GL_14. I think you are already in that version.
    See this SAP help document
    [DataSource Transactional Data: 0FI_GL_14|http://help.sap.com/saphelp_nw04s/helpdata/en/45/4f8e8bbf3f4f63a5dd197ef7d53fa2/content.htm]
    Thanks
    Chandran

  • General Ledger Accounting (New): Line Items 0FIGL_O14  Performace issue

    Dear Forum,
    We are facing a performance issue while loading the data to 0FIGL_O14 General Ledger Accounting (New): Line Items from  CUBE ZMMPRC01 -> ODSO 0FIGL_O14 DSO.
    Please see my requirement below for updating the data to 0FIGL_O14 DSO.
    This report is generated to display Dry Dock and Running Repair expenses for the particular Purchase orders with respective G/L's.
    1) The G/L DSO will provide us the 0DEBIT_LC and    0DEB_CRE_DC Foreign currency amount with signs (+/-) amounts and.
    2) ZMMPRC01 Cube   will provide us the 0ORDER_VALUE  (Purchse order value)and    0INVCD_AMNT Invoice  amount.
    While we are loading the data from  CUBE ZMMPRC01 -> ODSO 0FIGL_O14 DSO ,we have created nearly 19 InfoObject  level routine to derive the below mentioned fields data for MM Purchase Order related records.
    0CHRT_ACCTS    Chart of accounts
    0ITEM_NUM      Number of line item within accounting documen
    0AC_DOC_NO     Accounting document number
    0GL_ACCOUNT    G/L Account
    0COMP_CODE     Company code
    0COSTCENTER    Cost Center
    0CO_AREA       Controlling area
    0COSTELMNT     Cost Element
    0SEGMENT       Segment for Segmental Reporting
    0BUS_AREA      Business area
    0FUNC_AREA     Functional area
    0AC_DOC_NR     Document Number (General Ledger View)
    0AC_DOC_TYP    Document type
    0POST_KEY      Posting key
    0PSTNG_DATE    Posting date in the document
    0DOC_CURRCY    Document currency
    0LOC_CURTP2    Currency Type of Second Local Currency
    0CALQUART1     Quarter
    0CALYEAR       Calendar year
    For reference Please see the below logic to derive the data for PO related record.
    DATA:
          MONITOR_REC    TYPE rsmonitor.
    $$ begin of routine - insert your code only below this line        -
        ... "insert your code here
        types : begin of ty_FIGL,
                    CHRT_ACCTS type /BI0/OICHRT_ACCTS,
                    ITEM_NUM type /BI0/OIITEM_NUM,
                    AC_DOC_NO type /BI0/OIAC_DOC_NO,
                    GL_ACCOUNT type /BI0/OIGL_ACCOUNT,
                end of ty_FIGL.
        data :it_figl type STANDARD TABLE OF ty_figl,
              wa_figl type ty_figl.
        SELECT single CHRT_ACCTS
                        ITEM_NUM
                        AC_DOC_NO
                        GL_ACCOUNT from /BI0/AFIGL_O1400
                          into wa_figl
                          where DOC_NUM = SOURCE_FIELDS-DOC_NUM and
                                DOC_ITEM = SOURCE_FIELDS-DOC_ITEM and
                                /BIC/Z_PCODE = SOURCE_FIELDS-/BIC/Z_PCODE
                                and
                                /BIC/Z_VOY_NO = SOURCE_FIELDS-/BIC/Z_VOY_NO
                                and
                                FISCYEAR = SOURCE_FIELDS-FISCYEAR.
        if sy-subrc = 0.
          RESULT = wa_figl-AC_DOC_NO.
        ENDIF.
        clear wa_figl.
    Please note the same kind of logic is applied for all the above mentioned fields.
    Here is my concerns and issue.
    For the all above all routines i am referring BI0/AFIGL_O1400
    DSO and finally loading to the Same DSO(BI0/AFIGL_O1400
    The worried part is my DSO  0FIGL_O1400 is currecnly having nearly 60 Lacks records and MM cube is having nearly 55 requests which are required to update to the Above DSO for PO related PO value and Invoice amount.
    The big issue here is while uploading data from MM cube to DSO say for example if the request is having  25,000 records from this  nearly 500-600 records will be updated to DSO.
    But here it is taking huge time ( nearly 3 days for request ) for updating  these records , like this i have to pull 50 more requests from Cube to DSO as per the requirement.
    Please note as of now i haven't created any indexes on DSO to improve this loads.
    Please note am facing this issue in Production environment and need your help ASAP.
    Thanks & Regards,
    Srinivas Padugula

    Hi,
    If selecting data from 0FIGL_O14 is taking long time then you can create secondary indexes on DSO.
    0FIGL_O14 would be huge as data volume directly corresponds to data volume in BSEG.
    But for you requirement, I think what you can do is,
    1. create multiprovider on top of DSO and Cube and create Bex report to give you the fields requried from both the infoproviders, you can then use open hub or APD approach to keep the data in the staging table or direct update DSO and then load the data to the DSO
    2. Create secondary indexes on DSO so that fetching would be faster.
    3. Do the enhancment at R/3 level to fetch fields from MM during load of G/L
    Regards,
    Pravin Karkhanis.

  • 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

  • Hey,i want to change icloud account and my old apple id is stolen what should i do ???!!!:S

    Hey,i want to change icloud account and my old apple id is stolen what should i do ???!!!:S.

    See Here > Apple ID: Contacting Apple for help with Apple ID account security
              Ask to speak with the Account Security Team...
    lmerchant wrote:
    My new phone has an old apple ID associated with iCloud only.  I cannot delete the account as it has "Find my iPhone" turned on. 
    Activation Lock in iOS 7  >  http://support.apple.com/kb/HT5818

  • I want to change my account payment method to none and I do not have a credit card yet.Plus, iTunes gave a message saying that I need to review my account and when I go there,the none payment method is hidden.

    I want to change my account payment method to none and I do not have a credit card yet.Plus, iTunes gave a message saying that I need to review my account and when I go there,the none payment method is hidden.

    Assuming that you want help and that you aren't just copying-and-pasting that thread's title and posting a link to it, then have you tried the steps on the post that I linked to in my first reply on that thread ?
    If you don't get the 'none' option when trying those instructions then you will need to enter credit card details before you will be able to use the account - when you've entered credit card details you should get the 'none' option and be able to remove your card details.
    Or you can create a new account, and follow, exactly, the steps on this page when creating it' : http://support.apple.com/kb/HT2534

  • I move to another country and I want to change my account setting

    I move to another country and I want to change my account setting. But when I try, Itunes says that I have an active Itunes Match subscription.  How can I deal with this. I don't want to pay again for space in the cloud.

    The telephone network doesn't support Face Time regardless of the country.
    There are some countries where FaceTime is not allowed because of local laws.
    Where are you?  If it's anywhere in the Middle East, you're out of luck.

  • I want to change my account in the AppStore from USA to Saudi , but there are some cents 0.04 $ prevent change to Saudi and I do not need these cents So what is the solution ?

    I want to change my account in the AppStore from USA to Saudi , but there are some cents 0.04 $ prevent change to Saudi and I do not need these cents So what is the solution ?

    Click here and request assistance.
    (88185)

  • 0FIGL_O14 General Ledger Accounting (New): Line Items Business Content

    Dear Experts,
    i am trying to install 0FIGL_O14 General Ledger Accounting (New): Line Items ODS, but it is not available in BI Content .
    we are using New G/L in ECC side.
    Please help.
    Regards
    B.Virupasan

    Hi
    Please go through the below threads
    0figl_o14 DSO connected to which cube
    New GL Upgrade
    Hope this will be useful
    Regards,
    Venkatesh

  • I want to change my  account country and rest my account balanc

    i want to change my  account country and rest my account balanc

    Try contacting iTunes Support as ask them to remove the balance from your account so that you can change countries : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page

Maybe you are looking for