04-20-2007 8:43 AM
Hi,
I have written a prg to change the netpr, quantity and delivery date.but my program changes only the netpr and shows 2 line items under delivery schedule
in me22n.
1) previous qty and delivery date ( 1, 15.04.2007).
2)qty and delivery date given via prg.(10, 20.04.2007).
I want to change the prevoius (qty delvry date,) values to values given via prg.
my code goes like this
*----
REPORT zsd_bapi_po_change.
PARAMETERS: p_ebeln LIKE ekko-ebeln.
DATA: t_poitem LIKE bapimepoitem OCCURS 0 WITH HEADER LINE.
DATA: t_poitemx LIKE bapimepoitemx OCCURS 0 WITH HEADER LINE.
DATA: t_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
DATA: t_poschedule LIKE bapimeposchedule OCCURS 0 WITH HEADER LINE.
DATA: t_poschedulex LIKE bapimeposchedulx OCCURS 0 WITH HEADER LINE.
*PO Item data
t_poitem-po_item = '00010'.
t_poitem-net_price = '2222'.
APPEND t_poitem.
t_poitemx-po_item = '00010'.
t_poitemx-net_price = 'X'.
t_poitemx-po_itemx = 'X'.
APPEND t_poitemx.
*PO schedule data
t_poschedule-po_item = '00010'.
t_poschedule-delivery_date = '19.04.2007'.
t_poschedule-quantity = '30'.
APPEND t_poschedule.
t_poschedulex-po_item = '00010'.
t_poschedulex-delivery_date = 'X'.
t_poschedulex-quantity = 'X'.
t_poschedulex-po_itemx = 'X'.
APPEND t_poschedulex.
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
purchaseorder = p_ebeln
TABLES
return = t_return
poitem = t_poitem
poitemx = t_poitemx
poschedule = t_poschedule
poschedulex = t_poschedulex.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.-
*----
04-20-2007 12:30 PM
Hi,
you are missing the parameters:
T_POSCHEDULE-SCHED_LINE = '0001'
T_POSCHEDULEX-SCHED_LINE = '0001'
T_POSCHEDULEX-SCHED_LINEX = 'X'.
This way, SAP will change the shedule line, instead of adding a new one!!!
Best Regards,
04-20-2007 12:30 PM
Hi,
you are missing the parameters:
T_POSCHEDULE-SCHED_LINE = '0001'
T_POSCHEDULEX-SCHED_LINE = '0001'
T_POSCHEDULEX-SCHED_LINEX = 'X'.
This way, SAP will change the shedule line, instead of adding a new one!!!
Best Regards,