Skip to Content
author's profile photo Former Member
Former Member

Updating EKPO Zfields using BAPI_PO_CHANGE

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 03, 2010 at 07:10 PM

    Hi..

    You will have to enhance the standard BAPI.

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

    BAPI enhancement.

    adding-field-to-a-standard-bapi

    Regards,

    Karthik

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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 03, 2010 at 06:58 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • author's profile photo Former Member
    Former Member
    Posted on Sep 13, 2010 at 06:37 AM

    Thanks alot

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.