Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Unable to Update the Net Price in ME32K using BAPI_CONTRACT_CHANGE

Dear Experts,

I need your help , I have a requirement where  I have to modify the existing Agreement in ME32K line item wise for Quantity and Price. I am using the BAPI:- BAPI_CONTRACT_CHANGE for doing the same.

I am able to modify the Target Quantity line Item wise and even add new materials & Qty to the existing Agreement, and my program is also displaying the SUCCESS message in the Output.

But My "Net Price" value is not getting changed... it is displaying the value that we have entered while creating the agreement. After the executing the BAPI I am getting a message of type "I" saying "Change NETPR could not be effected" in the RETURN table in the below format.

IME664Change NETPR could not be effected
0NETPRITEM4

Kindly Help...

Plz find the below code which I am using....

********BAPI Header Data
       PURCHASINGDOCUMENT = v_podoc.

       HEADER-NUMBER     = v_podoc.
       HEADER-COMP_CODE  = it_excel-COMP_CODE.
       HEADER-DOC_TYPE   = it_excel-DOC_TYPE.
       HEADER-CREAT_DATE = it_excel-CREAT_DATE.
       HEADER-PURCH_ORG  = it_excel-PURCH_ORG.
       HEADER-PUR_GROUP  = it_excel-PUR_GROUP.
       HEADER-CURRENCY   = it_excel-CURRENCY.
       HEADER-VENDOR     = it_excel-VENDOR.
       HEADER-VPER_START = it_excel-VPER_START.
       HEADER-VPER_END   = it_excel-VPER_END.
********Header Data Change Parameter Outline Agreement
       HEADERX-NUMBER     = 'X'.
       HEADERX-COMP_CODE  = 'X'.
       HEADERX-DOC_TYPE   = 'X'.
       HEADERX-CREAT_DATE = 'X'.
       HEADERX-PURCH_ORG  = 'X'.
       HEADERX-PUR_GROUP  = 'X'.
       HEADERX-CURRENCY   = 'X'.
       HEADERX-VENDOR     = 'X'.
       HEADERX-VPER_START = 'X'.
       HEADERX-VPER_END   = 'X'.

********BAPI Item data
       ITEM-ITEM_NO    = V_LIN.
       ITEM-MATERIAL   = IT_EXCEL-MATERIAL.
       ITEM-TARGET_QTY = IT_EXCEL-TARGET_QTY.
       ITEM-NET_PRICE  = IT_EXCEL-NET_PRICE.
       APPEND ITEM.
******ITEM DATA CHANGE PARAMETER FOR OUTLINE AGREEMENT
       ITEMX-ITEM_NO    = V_LIN .
       ITEMX-ITEM_NOX   = 'X'.
       ITEMX-MATERIAL   = 'X'.
       ITEMX-TARGET_QTY = 'X'.
       ITEMX-NET_PRICE  = 'X'.
       APPEND ITEMX.

*****Account Assignment Data
       ACCOUNT-ITEM_NO   = V_LIN .
       ACCOUNT-QUANTITY  = IT_EXCEL-TARGET_QTY.
       ACCOUNT-NET_VALUE = IT_EXCEL-NET_PRICE.
       append ACCOUNT.

****Change Parameter - Account Assignment Data
       ACCOUNTX-ITEM_NO   = V_LIN .
       ACCOUNTX-ITEM_NOX  = 'X'.
       ACCOUNTX-QUANTITY  = 'X'.
       ACCOUNTX-NET_VALUE = 'X'.
       append ACCOUNTX.

CALL FUNCTION 'BAPI_CONTRACT_CHANGE'
           EXPORTING
             PURCHASINGDOCUMENT    = PURCHASINGDOCUMENT
             HEADER                = HEADER
             HEADERX               = HEADERX
*           VENDOR_ADDRESS        =
*           TESTRUN               =
*           TECHNICAL_DATA        =
           IMPORTING
             EXP_HEADER            = EXP_HEADER
           TABLES
             ITEM                  = ITEM
             ITEMX                 = ITEMX
             ACCOUNT               = ACCOUNT
*           ACCOUNTPROFITSEGMENT  =
             ACCOUNTX              = ACCOUNTX
*           DELIVERY_ADDRESS      =
*           ITEM_COND_VALIDITY    =
*           ITEM_COND_VALIDITYX   =
*           ITEM_CONDITION        =
*           ITEM_CONDITIONX       =
*           ITEM_COND_SCALE_VALUE =
*           ITEM_COND_SCALE_QUAN  =
*           ITEM_TEXT             =
*           HEADER_TEXT           =
*           HEAD_COND_VALIDITY    =
*           HEAD_COND_VALIDITYX   =
*           HEAD_CONDITION        =
*           HEAD_CONDITIONX       =
*           HEAD_COND_SCALE_VAL   =
*           HEAD_COND_SCALE_QUAN  =
*           PARTNER               =
*           PARTNERX              =
             RETURN                = RETURN.

Tags:

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question