Skip to Content
0
Former Member
Nov 14, 2008 at 08:44 AM

Change limit item in PR

95 Views

Hello,

I need to change the value of a item in the Purchase Requsition .I am using BAPI_PR_CHANGE and in item table PREQ_PRICE field fill the new price

Note : the item is of TYPE B : Blanket item . I tried with qty items it works but it does not change price for limit (blanket items)

I am getting the following messages in return table.

Change PREIS could not be effected

Change MENGE could not be effected

Change BNFPO could not be effected

Change BADAT could not be effected

Code :

CALL FUNCTION 'BAPI_PR_GETDETAIL'

EXPORTING

number = w_prno

account_assignment = 'X'

  • ITEM_TEXT = ' '

  • HEADER_TEXT = ' '

  • DELIVERY_ADDRESS = ' '

  • VERSION = ' '

IMPORTING

prheader = e_prheader

TABLES

return = i_pr_return

pritem = i_pritem_details

praccount = i_praccount

  • PRADDRDELIVERY =

  • PRITEMTEXT =

  • PRHEADERTEXT =

  • EXTENSIONOUT =

  • ALLVERSIONS =

.

DATA : i_pritemexp TYPE bapimereqitem OCCURS 0 WITH HEADER LINE.

LOOP AT i_pritem_details INTO wa_pr.

CLEAR : i_chpr_item, i_chpr_itemx.

  • MOVE-CORRESPONDING i_pritem_details TO i_chpr_item.

MOVE-CORRESPONDING wa_pr TO i_chpr_item.

MOVE-CORRESPONDING wa_pr TO i_pritemexp.

READ TABLE t_chg_item INTO e_chg_item WITH KEY

be_obj_item = wa_pr-preq_item.

IF sy-subrc = 0.

IF e_chg_item-itm_type = 'LIMI'.

IF e_chg_item-cpo_accept = 'X'.

MOVE e_chg_item-delta_quantity TO net_value.

net_value = net_value + e_chg_item-price.

i_chpr_item-preq_price = net_value.

i_pritemexp-preq_price = net_value.

APPEND i_pritemexp.

ENDIF.

ELSE.

IF e_chg_item-cpo_accept = 'X'.

i_chpr_item-quantity = e_chg_item-old_quantity +

e_chg_item-delta_quantity.

ENDIF.

ENDIF.

i_chpr_item-deliv_date = e_chg_item-deliv_date .

i_chpr_itemx-deliv_date = 'X'.

i_chpr_itemx-preq_date = 'X'.

i_chpr_itemx-preq_item = wa_pr-preq_item.

i_chpr_itemx-quantity = 'X'.

i_chpr_itemx-preq_date = 'X'.

i_chpr_itemx-preq_price = 'X'.

i_chpr_itemx-preq_itemx = 'X'.

APPEND i_chpr_item.

APPEND i_chpr_itemx.

  • APPEND i_poitemx.

ENDIF.

ENDLOOP.

LOOP AT i_praccount .

MOVE-CORRESPONDING i_praccount TO i_ch_praccount.

i_ch_praccount-net_value = i_chpr_item-preq_price.

APPEND i_ch_praccount.

i_ch_praccountx-preq_item = wa_pr-preq_item.

i_ch_praccountx-net_value = 'X'.

APPEND i_ch_praccountx.

ENDLOOP.

CALL FUNCTION 'BAPI_PR_CHANGE'

EXPORTING

number = w_prno

  • PRHEADER =

  • PRHEADERX =

  • TESTRUN =

  • IMPORTING

  • PRHEADEREXP =

TABLES

return = i_chpr_return

pritem = i_chpr_item

pritemx = i_chpr_itemx

pritemexp = i_pritemexp

  • PRITEMSOURCE = i_PRITEMSOURCE

praccount = i_ch_praccount

  • PRACCOUNTPROITSEGMENT =

praccountx = i_ch_praccountx

  • PRADDRDELIVERY =

  • PRITEMTEXT =

  • PRHEADERTEXT =

  • EXTENSIONIN =

  • EXTENSIONOUT =

  • PRVERSION =

  • PRVERSIONX =

  • ALLVERSIONS =

.

Please reply asap..

Thanks a lot

Edited by: bijal parmar on Nov 14, 2008 9:45 AM