cancel
Showing results for 
Search instead for 
Did you mean: 

Update Sales Order pricing with G from Purchase Order

Former Member
0 Kudos

Hi All,

I am trying to update the sales order pricing with G from purchase order and then the relevant changes should be saved to the VBAP table.

I have used the methods POST and CLOSE of BAdI "ME_PROCESS_PO_CUST" trying to update the pricing with G but I couldn't trigger the pricing with G. Please see the below coding.

I have set a break point in USEREXIT_NEW_PRICING_VBKD to check if sales order change is getting triggered. with the below coding sales order is getting triggered but pricing is not updated. So I have set the new_pricing variable in the USEREXIT_NEW_PRICING_VBKD to 'G'. Now pricing is updated but data is not saved to the VBAP data base table.

Is it safe to call the function BAPI_TRANSACTION_COMMIT after the below coding? and will it update the data in VBAP table.

All your suggestions are highly appreciated and thanks a lot in advance.

ls_header_inx-updateflag = 'U'.
ls_logic_switch-pricing = 'G'.

ls_item_inx-updateflag = 'U'.
ls_item_inx-itm_number = lv_posnr.
APPEND ls_item_inx TO lt_item_inx.
CLEAR: ls_item_inx.

"Call the SAP FM to update the sales order
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
  EXPORTING
    salesdocument    = lv_vbeln
*   ORDER_HEADER_IN  =
    order_header_inx = ls_header_inx
*   SIMULATION       =
*   BEHAVE_WHEN_ERROR     = ' '
*   INT_NUMBER_ASSIGNMENT = ' '
*   LOGIC_SWITCH     =
*   NO_STATUS_BUF_INIT    = ' '
  TABLES
    return           = lt_return
*   ORDER_ITEM_IN    =
    order_item_inx   = lt_item_inx.

Accepted Solutions (0)

Answers (1)

Answers (1)

Lakshmipathi
Active Contributor
0 Kudos

Before making the code change, did you discuss with your Functional Consultant? What is the Business process. It seems, the requirement can be achieved via standard configuration

Former Member
0 Kudos

Hi Mr. Lakshmipathi,

Thank you for your reply.

Our requirement is that we are creating the purchase order based on the purchase requisition (created while creating the sales order). While creating the purchase order, corresponding sales order should be updated with pricing type 'G' and the sales order data should be saved to the database tables.

The reason why we want to execute the pricing with G is that we have a custom code in sales order where we get the purchase order number from EKKN table and then using the purchase order number we get the partner roles in purchase order. we fill our append fields in VBAP based on the partner roles.