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

Problem populating PO customer fields using BAPI_PO_CHANGE

Former Member
0 Likes
2,157

Hi gurus!

I added some fields to PO at item level. Now I need to change value of some field, so I tried to use BAPI_PO_CHANGE.

Here is my code:

   ls_str_item-po_item    = ls_changed_data-ebelp.

    APPEND ls_str_item  TO lt_item.

 

    ls_str_itemx-po_item = ls_changed_data-ebelp.

    ls_str_itemx-po_itemx  = 'X'.

    APPEND ls_str_itemx TO lt_itemx.

 

    ls_str_bapi_te_mepoitemx-po_item        = ls_changed_data-ebelp.

    ls_str_bapi_te_mepoitemx-order_status   = 'X'.

    ls_str_bapi_te_mepoitem-po_item         = ls_changed_data-ebelp.

    ls_str_bapi_te_mepoitem-order_status    = ls_changed_data-order_status.

    ls_str_extensionin-structure           = 'BAPI_TE_MEPOITEM'.

    ls_str_extensionin-valuepart1(151)  = ls_str_bapi_te_mepoitem(151).

    APPEND ls_str_extensionin TO lt_extensionin.

    ls_str_extensionin-structure           = 'BAPI_TE_MEPOITEMX'.

    ls_str_extensionin-valuepart1(96)    = ls_str_bapi_te_mepoitemx(96).

    APPEND ls_str_extensionin TO lt_extensionin.

 

    CALL FUNCTION 'BAPI_PO_CHANGE'

      EXPORTING

        purchaseorder = ls_changed_data-ebeln

        poheader      = ls_bapi_poheader

        poheaderx     = ls_bapi_poheaderx

      TABLES

        return         = lt_return

        poitem         = lt_item

        poitemx        = lt_itemx

        extensionin    = lt_extensionin.

 

    COMMIT WORK AND WAIT.

After running BAPI I've got error:

Releases already effected are liable to be reset

Error transferring ExtensionIn data for enhancement CI_EKKODB

No data changed

1. Why BAPI checking header line (CI_EKKODB), I didn't changed anything?

2. What I am doing wrong?

Any help would be more than appreciated.

8 REPLIES 8
Read only

Azeemquadri
Contributor
0 Likes
1,574

In the header structures are you passing anything?

ls_bapi_poheaderx and ls_bapi_poheader.

Please check if you can change the header entries that you pass and see if you get the same error.

Read only

0 Likes
1,574

Hi, thank you for quick reply.

I do not passing anything the header structures. I tried to send empty structures and also tried not to send them at all.

I've got same error. I don't need to change any of header fields.

Read only

anuraj_rana
Explorer
0 Likes
1,574

Hi,

1. "Releases already effected are liable to be reset" for this error you might need to reset the release of the PO using ME29N.You can also check the status in EKKO field FRGZU (Release status). Try to reset the release of PO.

2. As you have used BAPI_TE_MEPOITEM, if you look into this structure it consists of an include structure CI_EKPODB (Customer fields for EKPO) which is also used in EKPO table.CI_EKPODB is used to add custom fields. Since you are using order_status fields, first of all the filed should be present in CI_EKPODB strucuture.Moreover there should not be any field with data type other tha Char.

3. You can also implement code related to custom fields in BADI ME_BAPI_PO_CUST using method  MAP2I_EXTENSIONIN.

Hope it help.

Thanks

Read only

0 Likes
1,574

Hi, thanks for the answer.

1. I canceled the release.

2. All my fields present in CI_EKPODB and they are char type.

3. Is there "standard"  way to update fields without coding?

Read only

Former Member
0 Likes
1,574

Hi Dan,

Check this Note 828557 - EnjoySAP purchase order BAPI: ExtensionOut contains

Regard's

Smruti

Read only

0 Likes
1,574

Hi, thank you for help.

But this Note(828557)  is for sap appl release 500 and we have 605. It must be already implemented, right?

Read only

0 Likes
1,574

Hi Dan,

Ok , i don't know about ur Release , but can you read the Note: Symptom, 


"At least one customer enhancement (CI_EKKODB, CI_EKPODB, CI_COBL) is active"

Check your Custom Enhancement is Active.

also read this Note 323152 - Enjoy BAPI: Implementation of customer enhancements .

Regard's

Smruti


Read only

bbalci
Contributor
1,574

I had a similar problem,

I was setting extension (ZZ) fields on EKKO by implementing BADI : ME_BAPI_PO_CUST.

But somehow , EKKO extension fields wasn't posted on database without any warning or error.
After debugging the standard flow on BAPI_PO_CHANGE , I found out that another user-exit (EXIT_SAPMM06E_008) was deleting the field values.

Thanks , Bulent Balci