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

Help required regarding ME22N t-code

Former Member
0 Likes
467

Hi Experts,

I have a requirement where in I need to change the P.O quantity of a line item and the new quantity should create another line item of the existinng P.O.

For ex: EBELN :450000000

EBELP:0010 qty :10

0020 qty:20

If I change ebelp 0010 qty 10 to 20 a new line item should be created.

0030 qty:10.

Can anyone help me in achieving this.

Thanks,

Swarna..

3 REPLIES 3
Read only

Former Member
0 Likes
444

You can use BAPI_PO_CHANGE.

For example

i_poitem-po_item = <item_number1>

i_poitem-quantity = <item_quantity>

i_poitemx-po_item = <item_number1> "this should be the same as the one you filled in table i_poitem-po_item

i_poitemx-quantity = 'X'.

APPEND i_poitem.

APPEND i_poitemx.

i_poitem-po_item = <item_number2>

i_poitem-quantity = <item_quantity>

i_poitemx-po_item = <item_number2> "this should be the same as the one you filled in table i_poitem-po_item

i_poitemx-quantity = 'X'.

APPEND i_poitem.

APPEND i_poitemx.

i_poitem-po_item = <item_number3>

i_poitem-quantity = <item_quantity>

i_poitemx-po_item = <item_number3> "this should be the same as the one you filled in table i_poitem-po_item

i_poitemx-quantity = 'X'.

APPEND i_poitem.

APPEND i_poitemx.

CALL FUNCTION 'BAPI_PO_CHANGE'

EXPORTING

purchaseorder = po_number "purchase order

TABLES

RETURN = itab_return

POITEM = i_poitem

POITEMX = i_poitemx.

Hope it helps.

Regards,

Ling

Read only

0 Likes
444

Hi,

In which tcode BAPI_PO_CHANGE is seen.

Ashok

Read only

0 Likes
444

You can look for all the BAPIs in transaction BAPI.