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: 

Unable to update Item Text using Bapi_po_change

Former Member
0 Kudos
721

Hi Experts,

I am unable to update Item Text Field sing BAPI_PO_CHANGE.

Here is my Code

CLEAR: lt_item[], lt_itemx[], lt_extensionin[].

***Udating standerd fields

     str_item-po_item     = str_itemx-po_item    = ekpo-ebelp.

     str_item-stge_loc    = ekpo-lgort.

     str_itemx-stge_loc   = 'X'.

     str_item-CONF_CTRL  = '0004'.

     str_itemx-CONF_CTRL = 'X'.

***    str_item-weightunit  = ekpo-gewei.

***    str_itemx-weightunit = 'X'.

***    str_item-volume      = ekpo-volum.

***    str_itemx-volume     = 'X'.

***    str_item-volumeunit  = ekpo-voleh.

***    str_itemx-volumeunit = 'X'.

     APPEND str_item  TO lt_item.

     APPEND str_itemx TO lt_itemx.

*****************below is the issue***************

***Updateing Recharge flag

     str_flag-PO_NUMBER   = ekpo-ebeln.

     str_flag-PO_ITEM     = ekpo-ebelp.

     str_flag-text_id     = 'F99'.

     str_flag-TEXT_FORM   = '  '.

     str_flag-text_line = stxl-tdspras.

     APPEND str_flag TO lt_flag.

****************************************************************

***Updating New Z-fields in EKPO*

     str_bapi_te_mepoitemx-po_item         = ekpo-ebelp.

     str_bapi_te_mepoitemx-zzdest_wellsite = 'X'.

     str_bapi_te_mepoitemx-zzkostl_tms     = 'X'.

     str_bapi_te_mepoitem-po_item          = ekpo-ebelp.

     str_bapi_te_mepoitem-zzdest_wellsite  = ekpo-zzdest_wellsite.

     str_bapi_te_mepoitem-zzkostl_tms      = ekpo-zzkostl_tms .

     str_extensionin-structure        = 'BAPI_TE_MEPOITEM'.

     str_extensionin-valuepart1       = str_bapi_te_mepoitem.

     APPEND str_extensionin TO lt_extensionin.

     str_extensionin-structure        = 'BAPI_TE_MEPOITEMX'.

     str_extensionin-valuepart1       = str_bapi_te_mepoitemx.

     APPEND str_extensionin TO lt_extensionin.

     CALL FUNCTION 'BAPI_PO_CHANGE'

       EXPORTING

         purchaseorder  = ekpo-ebeln

       TABLES

         return         = i_return

         poitem         = lt_item

         poitemx        = lt_itemx

         extensionin    = lt_extensionin

         POTEXTITEM     = lt_flag.

     CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

       EXPORTING

         wait = 'X'.

please let me know what is the issue or any alternate way to update  it.

Regards,

Aniket Kumar

5 REPLIES 5

custodio_deoliveira
Active Contributor
0 Kudos
255

Hi Aniket,

You should check for error before calling BAPI_COMMIT. Anyway, this is not why you are getting errors. You should check i_return and maybe post here what messages you are getting than it would be easier for us to help you.

Still, I have a guess that this text id is wrong. Where did you get this text_id from?

raymond_giuseppi
Active Contributor
0 Kudos
255

Could you analyze the RETURN parameter for errors, or at least check thru transaction SE75 for allowed ID for object EKPO (F99?)

Regards,

Raymond

Former Member
0 Kudos
255

Hi Aniket,

For PO item text, the text id is F01.

Change your code as below and check.

     str_flag-PO_NUMBER   = ekpo-ebeln.

     str_flag-PO_ITEM     = ekpo-ebelp.

     str_flag-text_id     = 'F01'.

     str_flag-text_line = 'Your text'.

     APPEND str_flag TO lt_flag.

Former Member
0 Kudos
255

Hi Aniket

Text id is 'F01'. You can see the Text id - > double click the text area in PO, then Tab 'GOTO' -> Click Header.

Former Member
0 Kudos
255

Hi Aniket,

Another one you passed Language to text line(str_flag-text_line = stxl-tdspras.). Please change and pass your text.