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

Updating T'code ME23N using BAPI's

Former Member
0 Likes
2,370

Dear All,

I am updating T'code ME23N using BAPI " BAPI_PO_CHANGE". First i m tried in SE37 there its not updating it giving error like " PO could not be changed using the Enjoy-BAPI" for this i m trying in 4.6c.

Here i have to update only two check boxes those are NO_MORE_GR(ELIKZ) and FINAL_INV(EREKZ).

Please tell me any one there are any other BAPI's are avialable or how to slove this porblem.

Best Regards,

Srinivas.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,625

Hello

I just have run this code in 4.6C. It working fine.


DATA: xreturn  like BAPIRET2      occurs 0 with header line,
      xpoitem  like BAPIMEPOITEM  occurs 0 with header line,
      xpoitemx like BAPIMEPOITEMX occurs 0 with header line.
xpoitem-po_item = p_ebelp.  " set position here
xpoitem-no_more_gr = 'X'.
xpoitem-final_inv = 'X'.
append xpoitem.
xpoitemx-po_item = p_ebelp. " set position here
xpoitemx-no_more_gr = 'X'.
xpoitemx-final_inv = 'X'.
append xpoitemx.

CALL FUNCTION 'BAPI_PO_CHANGE'
     EXPORTING
              purchaseorder    = p_ebeln "set ebeln here
     TABLES
              return           = xreturn
              poitem           = xpoitem
              poitemx          = xpoitemx.
if sy-subrc = 0.
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
       EXPORTING WAIT = 'X'.
endif.

7 REPLIES 7
Read only

Former Member
0 Likes
1,626

Hello

I just have run this code in 4.6C. It working fine.


DATA: xreturn  like BAPIRET2      occurs 0 with header line,
      xpoitem  like BAPIMEPOITEM  occurs 0 with header line,
      xpoitemx like BAPIMEPOITEMX occurs 0 with header line.
xpoitem-po_item = p_ebelp.  " set position here
xpoitem-no_more_gr = 'X'.
xpoitem-final_inv = 'X'.
append xpoitem.
xpoitemx-po_item = p_ebelp. " set position here
xpoitemx-no_more_gr = 'X'.
xpoitemx-final_inv = 'X'.
append xpoitemx.

CALL FUNCTION 'BAPI_PO_CHANGE'
     EXPORTING
              purchaseorder    = p_ebeln "set ebeln here
     TABLES
              return           = xreturn
              poitem           = xpoitem
              poitemx          = xpoitemx.
if sy-subrc = 0.
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
       EXPORTING WAIT = 'X'.
endif.

Read only

0 Likes
1,625

Dear Dzed,

Thanks for your replay.

I have tried with your code still it giving same error "PO could not be changed using the Enjoy-BAPI"

Please tell what shall I do.

Regards,

Srinivas.

Read only

0 Likes
1,625

Dear Dzed,

Thanks for your replay.

I have tried with your code still it giving same error "PO could not be changed using the Enjoy-BAPI"

Please tell what shall I do.

Regards,

Srinivas.

Read only

0 Likes
1,625

Dear Dzed,

Thanks for your replay.

I have tried with your code still it giving same error "PO could not be changed using the Enjoy-BAPI"

Please tell what shall I do.

Regards,

Srinivas.

Read only

0 Likes
1,625

Dear Dzed,

Thanks for your replay.

I have tried with your code still it giving same error "PO could not be changed using the Enjoy-BAPI"

Please tell what shall I do.

Regards,

Srinivas.

Read only

0 Likes
1,625

Hello

Are you trying to change this PO within ME22N ?

It may be problem in PO.

Read only

Former Member
0 Likes
1,625

HI,

If you are you going to update the data using enjoy transaction you must to use BAPI. Oetherwise it should not update the PO data.

Try the BAPI FM - BAPI_PO_CHANGE. I hope it will change the PO data.

Regards

Thiru