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

BAPI_PO_CHANGE quantity field is adding with old valu, it should be replace

Former Member
0 Likes
1,702

Hi,

i am using BAPI_PO_CHANGE for for PO change, in this the quantity field is adding the old value with the new value, but it should be replaced with new one,

any other parameters are required for this, i am passing the quantity in POITEM table and POSCHEDULE tables.

any other parameter is there to indicate the quantity should be replaced?

Thanks & Regards

Ram

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,441

Hi Ram,

see the sample code to update ...


* Clear the net price & Inv Rcpt indicator
  wa_poitem-po_item   = w_item.
  wa_poitem-net_price = w_netpr.                  "here we are going to mention the Net price..
  wa_poitem-ir_ind    = ' '.
  APPEND wa_poitem TO t_poitem.

  wa_poitemx-po_item   = w_item.
  wa_poitemx-po_itemx  = 'X'.
  wa_poitemx-net_price = 'X'.                    "Keep X as to update..
  wa_poitemx-ir_ind    = 'X'.
  APPEND wa_poitemx TO t_poitemx.

  CALL FUNCTION 'BAPI_PO_CHANGE'
    EXPORTING
      purchaseorder = w_exppurchaseorder
    TABLES
      return        = t_return
      poitem        = t_poitem
      poitemx       = t_poitemx.

Regards,

Prabhudas

Hi,

i am using BAPI_PO_CHANGE for for PO change, in this the quantity field is adding the old value with the new value, but it should be replaced with new one,

any other parameters are required for this, i am passing the quantity in POITEM table and POSCHEDULE tables.

any other parameter is there to indicate the quantity should be replaced?

Thanks & Regards

Ram

8 REPLIES 8
Read only

Former Member
0 Likes
1,442

Hi Ram,

see the sample code to update ...


* Clear the net price & Inv Rcpt indicator
  wa_poitem-po_item   = w_item.
  wa_poitem-net_price = w_netpr.                  "here we are going to mention the Net price..
  wa_poitem-ir_ind    = ' '.
  APPEND wa_poitem TO t_poitem.

  wa_poitemx-po_item   = w_item.
  wa_poitemx-po_itemx  = 'X'.
  wa_poitemx-net_price = 'X'.                    "Keep X as to update..
  wa_poitemx-ir_ind    = 'X'.
  APPEND wa_poitemx TO t_poitemx.

  CALL FUNCTION 'BAPI_PO_CHANGE'
    EXPORTING
      purchaseorder = w_exppurchaseorder
    TABLES
      return        = t_return
      poitem        = t_poitem
      poitemx       = t_poitemx.

Regards,

Prabhudas

Read only

0 Likes
1,441

hey,

here the net_price is becomming ZERO and the quantity field is again adding with new valu,

but i want to replace the old values with the new values,

preeviously the price field was updating successfully.

Read only

0 Likes
1,441

Hi,

Try adding the field PO_PRICE = '2' to the PO_ITEM and check the corresponding field in PO_ITEMX.

...
w_poitem-po_price = '2'
APPEND w_poitem to PO_ITEM.

...
w_poitemx-po_price = 'X'
APPEND w_poitemx to PO_ITEMX.

Hope it helps.

Regards,

Gilberto Li

Read only

0 Likes
1,441

po_price field is not available in ITEM table,

i don't think that the picing related fields effects the quantity updation.

does it works?

Regards

Ram

Read only

0 Likes
1,441

Sorry,

I miss read the issue. I read your replay that the net_price was being replaced by zero and I thought you were having some trouble with the net price also.

What are you using as a reference for the quantities?

Are you using the Purchase Requisition only, or you're using a Quotation also?

Regards,

Gilberto Li

Read only

0 Likes
1,441

actually i am passing the values as below

in HEADER level

W_POHEADER-PO_NUMBER,

W_POHEADER-CREAT_DATE,

W_POHEADER-PUR_GROUP,

W_POHEADER-DOC_TYPE,

W_POHEADER-PURCH_ORG

W_POHEADER-CURRENCY

in ITEM level

W_POITEM-MATERIAL

W_POITEM-NET_PRICE

W_POITEM-QUANTITY

W_POITEM-PLANT

W_POITEM-DELETE_IND

W_POITEM-PO_ITEM

W_POITEM-STGE_LOC

W_POITEM-SEASON

W_POITEM-SEASON_YR

in schedule level

W_POSCHEDULE-QUANTITY

W_POSCHEDULE-PO_ITEM

W_POSCHEDULE-DELIVERY_DATE

and corresponding update indicator POHEADERX, POITEMX, POSCHEDULEX

only these tables i am passing to BAPI

CALL FUNCTION 'BAPI_PO_CHANGE'

EXPORTING

PURCHASEORDER = V_EBELN

POHEADER = W_POHEADER

POHEADERX = W_POHEADERX

  • IMPORTING

  • EXPHEADER =

TABLES

RETURN = T_RETURN

POITEM = T_POITEM

POITEMX = T_POITEMX

POSCHEDULE = T_POSCHEDULE

POSCHEDULEX = T_POSCHEDULEX

please suggest any thing need to be passed

Thanks&Regards

Ram

Read only

0 Likes
1,441

even delivery date also not updating

Regards

Ram.

Read only

0 Likes
1,441

hi

I tried with different combinatios,

here i haven't passed the Schedule_line in W_SCHEDULE table

now the delivery date and Quantity fields are updating,

but net_price is not updating,

if i run same BAPI for second time with same values,

its working.

please help me

regards

Ram