2012 Jun 21 10:46 AM
hi
i m using bapi_po_change for bapi change.
but it adds up quantity in existing record instead of updating it
hi
i m using bapi_po_change for bapi change.
but it adds up quantity in existing record instead of updating it
2012 Jun 21 10:54 AM
2012 Jun 21 10:58 AM
item-po_item = w_ekpo-ebelp.
item-material = w_ekpo-matnr.
item-plant = w_ekpo-werks.
item-quantity = w_ekpo-menge.
item-net_price = w_ekpo-netpr.
* item-ir_ind = ' '.
* itemx-info_upd = 'U'.
APPEND item TO item1.
itemx-po_item = w_ekpo-ebelp .
itemx-po_itemx = 'X' .
itemx-material ='X' .
itemx-plant = 'X' .
itemx-quantity = 'X' .
itemx-net_price = 'X' .
2012 Jun 21 12:29 PM
Hi, I have tested with the below simple logic and it works for me.
CLEAR: item, itemx.
item-po_item = '00010'.
CLEAR MENGE.
MENGE = 150.
item-quantity = MENGE.
APPEND ITEM TO PO_ITEM.
itemx-po_item = '00010'.
itemx-po_itemx = 'X'.
itemx-quantity = 'X'.
APPEND ITEMX TO PO_ITEMX.
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
PURCHASEORDER = ebeln
TABLES
RETURN = bapiret2
POITEM = po_item
POITEMX = po_itemx.
IF sy-subrc is INITIAL.
commit WORK.
ENDIF.
2012 Jun 22 7:29 AM
2012 Jun 22 7:50 AM
Hi
Can you check the schedule line items as well ?? ?
ls_poschedule-po_item = .
ls_poschedule-sched_line =
ls_poschedule-quantity =
APPEND ls_poschedule TO lt_poschedule.
ls_poschedulex-sched_linex = 'X'.
APPEND ls_poschedulex TO lt_poschedule
2012 Jun 22 8:10 AM
ya i did this.
data is perfect before going into bapi.
bapi is adding up quantity value with existing quantity.it should update
2012 Jun 22 8:21 AM
Hi, I have tried with your logic aswell and it is working for me. May be you try to change the PO using ME22N with the same data and see what went wrong.
2012 Jun 22 8:26 AM
hi
check whether this happens for a particular PO or all the PO 's ....For the PO you are trying to update ensure that GR has not happened !!!!
2012 Jun 22 8:18 AM
Instead of giving the Quantity in Item ,
Give it in Schedule line item
wa_schedule-sched_line = '10'.
wa_schedule-req_qty = wa_upload-qty."'4.5'.
APPEND wa_schedule TO it_schedule.
wa_shedulex-itm_number = w_no.
wa_shedulex-updateflag = 'U'.
wa_shedulex-sched_line = '10'.
wa_shedulex-req_qty = 'X'.
Can you try this and respond
by the way,
I had faced thsi same issue, and it was definitely coz of this flag.
Regards,
Suzie
2012 Jun 22 10:19 AM
i cant see req_qty and updatefalg field in schedule table
and if i dont pass schedule table in bapi,quantity remains same means its not updating tha quantity.
2012 Jun 22 10:32 AM
O I am extremely sorry.. I mistook the bapi for Sales order change , not Po change..
In thsi case, try replacing 'X' with 'U' in schedulex.
2012 Jun 22 10:36 AM
'U' in which field of schedule
my code for schedule.
schedule-po_item = w_eket-ebelp.
schedule-sched_line = w_eket-etenr.
schedule-delivery_date = w_eket-eindt.
schedule-quantity = w_eket-menge.
APPEND schedule TO schedule1.
schedulex-po_item = w_ekpo-ebelp.
schedulex-sched_line = w_eket-etenr.
schedulex-sched_linex = 'X'.
schedulex-po_itemx = 'X'.
schedulex-sched_linex = 'X'.
schedulex-delivery_date = 'X'.
schedulex-quantity = 'X'.
APPEND schedulex TO schedulex1.
2012 Jun 22 12:29 PM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |