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

Using Function BAPI_PO_CHANGE

Former Member
0 Likes
535

Hi guys,

This function just makes me kill my self over and over

It worked , now it doesn't anymore, and can't find the problem.

CALL FUNCTION 'BAPI_PO_CHANGE'

         EXPORTING

           purchaseorder = gs_ekko-ebeln

           poheader      = gt_header

           poheaderx     = gt_headerx

         TABLES

           return        = return

           poitem        = gt_item

           poitemx       = gt_itemx

Changing the header still works ,but when i try to change the item it doesn't change it anymore.

gt_item and gt_itemx are tables with header line

LOOP AT itab INTO wa.

         CLEAR gt_item.

         gt_item-po_item = wa-ebelp.

         gt_item-quantity = wa-menge.

         APPEND gt_item.

         CLEAR gt_itemx.

         gt_itemx-po_item = wa-ebelp.

         gt_itemx-quantity = gv_check. " 'X'

         APPEND gt_itemx.

ENDLOOP.

I've did some debugging and i see that i pass gt_item with the new values, but after the function it comes back with the old values. Why does it modify my values i passed? And as information , but i don't think it's very important , i'm working with screen and i call a perform to do this in my module ( input , user_command 'save' ) .

Any help would be wonderful. Thank you.

1 ACCEPTED SOLUTION
Read only

former_member404244
Active Contributor
0 Likes
483

Hi,

In the item strcutre you might be having update flag , please check and pass it as 'U', also for itemx pass it as 'X'. I believe you are able to change the quantity manually, Please check the Po in mE22N and try to change the value manually and see.. what is the return strucre giving??

Regards,

Nagaraj.

2 REPLIES 2
Read only

former_member404244
Active Contributor
0 Likes
484

Hi,

In the item strcutre you might be having update flag , please check and pass it as 'U', also for itemx pass it as 'X'. I believe you are able to change the quantity manually, Please check the Po in mE22N and try to change the value manually and see.. what is the return strucre giving??

Regards,

Nagaraj.

Read only

0 Likes
483

Yep another stupid question from my side . i've done all but not double checked the me22n, because i done that this morning. someone played with the the po_documents i was using and they were un-editable anymore