Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem using BAPI_PR_CHANGE

Former Member
0 Likes
2,220

Hi All,

I am trying to update valuation price field using FM 'BAPI_PR_CHANGE'.

But the field is not gettign updated. I am using 'BAPI_TRANSACTION_COMMIT' also after calling the above BAPI.

Could you please help me. I found out that SAP Note 1062000 has to be implemented.

But when i try to do that in SNOTE i am getting a message that it cannot be implmented.

Regards,

Indira.

11 REPLIES 11
Read only

Former Member
0 Likes
1,523

which version you are using

Read only

0 Likes
1,523

Hi Karthik,

We use ECC 6.0

Read only

0 Likes
1,523

I think it may be already implemented.So check it.

Read only

0 Likes
1,523

Hi Karthik,

Ya it is implemented. Checked. But then too the valuation price field is not getting updated. Could you please give us an alternative.

Regards,

Indira

Read only

0 Likes
1,523

Can u please put your code

Read only

0 Likes
1,523

Hi Karthik,

I am callin the below BAPI by filling in the internal tables. In my case the internal tables gt_item, gt)itemx, gt_accassgn and gt_accassgnx are filled and remaining are empty.

  

*-->Call BAPI for changing the current PR
          CALL FUNCTION 'BAPI_PR_CHANGE'
            EXPORTING
              number          = f_eban-banfn
            TABLES
              return          = gt_return
              pritem          = gt_item
              pritemx         = gt_itemx
              praccount       = gt_accassgn
              praccountx      = gt_accassgnx
              pritemtext      = gt_item_text
              extensionin     = gt_extnin
              serviceoutline  = gt_service_outline
              serviceoutlinex = gt_service_outlinex
              servicelimit    = gt_service_limit
              servicelimitx   = gt_service_limitx
              serviceaccount  = gt_service_account
              serviceaccountx = gt_service_accountx.

After this i am callign the FM

              CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
              EXPORTING
                wait = gc_x.

Regards,

Indira.

Read only

0 Likes
1,523

Did u debug and see the code

Read only

0 Likes
1,523

- Are there message (even not-error ones) in return parameter after first call.

- Don't post the call FM code but the code to fill parameters related to price

Regards,

Raymond

Read only

0 Likes
1,523

Hi Karthik and Raymond,

Yes i did debug the code and see.

yes in the return parameter in gt_retun table there were entries. I could see messages in there saying that none of the fields were changed.

Below are the code lines to fill the price field

gf_itemx-preq_price     = 'X'.

gf_item-preq_price     = gf_eban-preis.

gf_accassgn-net_value   = f_item-preq_price.

gf_accassgnx-net_value   = 'X'.

The above lines fill the amount field with the correct amount. But once the BAPI is called the amount is not modified.

Reagards,

Indira

Read only

0 Likes
1,523

- Does the PR carry an info-record (INFO_REC, EBAN-INFNR)

- Does you check with Common Issues and Hints MM-PUR

Regards,

Raymond

Read only

0 Likes
1,523

Hi Raymond,

PLease fidn the below code used to fill the internal tables sent to the BAPI.

for gt_itemx the fields are given below.

  gf_itemx-preq_itemx     = 'X'.
  gf_itemx-material       = 'X'.
  gf_itemx-plant          = 'X'.
  gf_itemx-pur_group      = 'X'.
  gf_itemx-store_loc      = 'X'.
  gf_itemx-quantity       = 'X'.
  gf_itemx-po_unit        = 'X'.
  gf_itemx-del_datcat_ext = 'X'.
  gf_itemx-deliv_date     = 'X'.
  gf_itemx-fixed_vend     = 'X'.
  gf_itemx-des_vendor     = 'X'.
  gf_itemx-price_unit     = 'X'.
  gf_itemx-purch_org      = 'X'.
  gf_itemx-vend_mat       = 'X'.
  gf_itemx-mrp_ctrler     = 'X'.
  gf_itemx-matl_group     = 'X'.
  gf_itemx-acctasscat     = 'X'.
  gf_itemx-trackingno     = 'X'.
  gf_itemx-preq_price     = 'X'.
  gf_itemx-unit           = 'X'.
  gf_itemx-short_text     = 'X'.
  gf_itemx-preq_name      = 'X'.

For gt_item the fields are given below:

   * Fill Line Item Data of ZEC PR with ZAM PR data.
  gf_item-material       = gf_eban-matnr.
  gf_item-short_text     = gf_eban-txz01.
  gf_item-plant          = gf_eban-werks.
  gf_item-pur_group      = gf_eban-ekgrp.
  gf_item-store_loc      = gf_eban-lgort.
  gf_item-mrp_ctrler     = gf_eban-dispo.
  gf_item-matl_group     = gf_eban-matkl.
  gf_item-acctasscat     = gf_eban-knttp.
  gf_item-trackingno     = gf_eban-bednr.
  gf_item-quantity       = gf_eban-menge.
  gf_item-preq_price     = gf_eban-preis.
  gf_item-po_unit        = gf_eban-meins.
  gf_item-unit           = gf_eban-meins.
  gf_item-del_datcat_ext = gf_eban-lpein.
  gf_item-deliv_date     = gf_eban-lfdat.
  gf_item-fixed_vend     = gf_eban-flief.
  gf_item-price_unit     = gf_eban-peinh.
  gf_item-purch_org      = gf_eban-ekorg.
  gf_item-vend_mat       = gf_eban-idnlf.
  gf_item-preq_name      = gf_eban-afnam.

For tables gt_accassgn and gt_accassgnx, the below fields

        gf_accassgn-preq_item   = w_bnfpo + '00010'.
      gf_accassgn-serial_no   = gf_zam_ebkn-zebkn.
      gf_accassgn-gl_account  = gf_zam_ebkn-sakto.
      gf_accassgn-costcenter  = gf_zam_ebkn-kostl.
      gf_accassgn-orderid     = gf_zam_ebkn-aufnr.
      gf_accassgn-co_area     = gf_zam_ebkn-kokrs.
      gf_accassgn-quantity    = gf_eban-menge.
      gf_accassgn-net_value   = gf_eban-preis.

      gf_accassgnx-preq_item   = w_bnfpo + '00010'.
      gf_accassgnx-serial_no   = gf_zam_ebkn-zebkn.
      gf_accassgnx-gl_account  = 'X'.
      gf_accassgnx-costcenter  = 'X'.
      gf_accassgnx-orderid     = 'X'.
      gf_accassgnx-co_area     = 'X'.