Application Development 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: 

bapi_po_change

Former Member
0 Kudos

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'.-

*----


1 ACCEPTED SOLUTION

Former Member
0 Kudos

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,

1 REPLY 1

Former Member
0 Kudos

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,