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: 

Updating EKPO Zfields using BAPI_PO_CHANGE

Former Member
0 Kudos

Hi all,

I have almost 10 custom fields in EKPO.like ZZKUNNR, ZZSDESC(60), and so on...under CI_Include

how can I update them usig BAPI_PO_CHANGE.

provide me sample code.

Thanks all,

Suresh

Edited by: Suresh Nel on Aug 3, 2010 8:49 PM

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi..

You will have to enhance the standard BAPI.

Please check the following links where similar issue is discussed and is answered as well.

Regards,

Karthik

Edited by: Karthik S on Aug 4, 2010 12:40 AM

6 REPLIES 6

Former Member
0 Kudos

you have to use the following tables parameter of the FM interface...

EXTENSIONIN LIKE BAPIPAREX Customer's Own Fields (Import Parameters)

Edited by: gvsastry on Aug 3, 2010 2:58 PM

0 Kudos

Hi Gvsastry,

Thanks for your reply. the below is the code i have used to change Customfields

ZZKUNNR(10),

ZZORDTYP(4),

ZZDATE(8),

ZZSTOKBASE(8),

ZZVERSION(4),

ZZSTOCDESC(60).

but its giving error when i try to change ZZSTOCDESC(60). field under VALUE PART1,

its saying LEngth exceeds.

please provide me sample code to add all these fields

method bapi_update_po_item.

data: lt_item type table of bapimepoitem,

str_item type bapimepoitem,

lt_itemx type table of bapimepoitemx,

str_itemx type bapimepoitemx,

lt_extensionin type table of bapiparex,

str_extensionin type bapiparex,

str_bapi_te_mepoitem type bapi_te_mepoitem,

str_bapi_te_mepoitemx type bapi_te_mepoitemx.

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

str_item-po_item = str_itemx-po_item = ebelp.

append str_item to lt_item.

append str_itemx to lt_itemx.

----


-New Z-fields in EKPO -

----


str_bapi_te_mepoitemx-po_item = ebelp.

str_bapi_te_mepoitemx-zzkunnr = 'X'.

str_bapi_te_mepoitem-po_item = ebelp.

str_bapi_te_mepoitem-zzkunnr = sy-datum.

str_extensionin-structure = 'BAPI_TE_MEPOITEM'.

str_extensionin-valuepart1(240) = str_bapi_te_mepoitem(240).

append str_extensionin to lt_extensionin.

str_extensionin-structure = 'BAPI_TE_MEPOITEMX'.

str_extensionin-valuepart1(10) = str_bapi_te_mepoitemx(10).

append str_extensionin to lt_extensionin.

-


Field 2----


str_bapi_te_mepoitemx-po_item = ebelp.

str_bapi_te_mepoitemx-zzordtyp = 'X'.

str_bapi_te_mepoitem-po_item = ebelp.

str_bapi_te_mepoitem-zzordtyp = sy-datum.

str_extensionin-structure = 'BAPI_TE_MEPOITEM'.

str_extensionin-valuepart1(240) = str_bapi_te_mepoitem(240).

append str_extensionin to lt_extensionin.

str_extensionin-structure = 'BAPI_TE_MEPOITEMX'.

str_extensionin-valuepart1(4) = str_bapi_te_mepoitemx(4).

append str_extensionin to lt_extensionin.

clear return_t[].

call function 'BAPI_PO_CHANGE'

exporting

purchaseorder = ebeln

tables

return = return_t

  • poitem = lt_item

  • poitemx = lt_itemx

extensionin = lt_extensionin.

commit work and wait.

endmethod.

Former Member
0 Kudos

Hi..

You will have to enhance the standard BAPI.

Please check the following links where similar issue is discussed and is answered as well.

Regards,

Karthik

Edited by: Karthik S on Aug 4, 2010 12:40 AM

0 Kudos

hi can you provide me the sample code for theabove mentioned fields.

thank you very much.

0 Kudos

Refer to the below thread; it has the sample code for BAPI

Former Member
0 Kudos

Thanks alot