Skip to Content
avatar image
Former Member

Unable to update EKET custom field using BAPT_PO_CHANGE

Hello Everyone,

I am unable to update EKET custom field data using BAPI_PO_CHANGE.

below is my code (can anyone let me know where am I going wrong , the same bapi (BAPI_PO_CHANGE) is working fine for update custom field data for EKPO but it is not working for EKET , please let me know the issue)

    str_schedule-po_item = str_schedulex-po_item = wa_sto_sch-ebelp.

     str_schedule-SCHED_LINE = str_schedulex-SCHED_LINE = wa_sto_sch-etenr.

     APPEND str_schedule  TO lt_schedule.

     APPEND str_schedulex TO lt_schedulex.

*------------------------*

*-New Z-fields in EKPO  -*

*------------------------*

     str_BAPI_TE_MEPOSCHEDULEX-EBELP_KEY          = wa_sto_sch-ebelp.

     str_BAPI_TE_MEPOSCHEDULEX-ETENR_KEY          = wa_sto_sch-etenr.

     str_BAPI_TE_MEPOSCHEDULEX-ZZSENT_TO_OTM      = 'X'.

*   str_BAPI_TE_MEPOSCHEDULE-EBeln                = ekpo-ebeln.

     str_BAPI_TE_MEPOSCHEDULE-EBELP               = wa_sto_sch-ebelp.

     str_BAPI_TE_MEPOSCHEDULE-ETENR               = wa_sto_sch-etenr.

     if wa_sto_sch-lpein = 'X'.

     str_BAPI_TE_MEPOSCHEDULE-ZZSENT_TO_OTM       = 'R'.

     elseif

     str_BAPI_TE_MEPOSCHEDULE-ZZSENT_TO_OTM       = 'W'.

     endif.

     str_extensionin-structure        = 'BAPI_TE_MEPOSCHEDULE'.

     str_extensionin-valuepart1       = str_BAPI_TE_MEPOSCHEDULE.

     APPEND str_extensionin TO lt_extensionin.

     str_extensionin-structure        = 'BAPI_TE_MEPOSCHEDULEX'.

     str_extensionin-valuepart1       = str_bapi_te_MEPOSCHEDULEx.

     APPEND str_extensionin TO lt_extensionin.

endloop.

     CALL FUNCTION 'BAPI_PO_CHANGE'

       EXPORTING

         purchaseorder                = ekpo-ebeln

       TABLES

        RETURN                       = i_return1

        POSCHEDULE                   = lt_schedule

        POSCHEDULEX                  = lt_schedulex

        EXTENSIONIN                  = lt_extensionin.

     CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

       EXPORTING

         wait = 'X'.

If any one has updated the EKET custom field using any other BAPI or by any other method please mention the same.

Thanks in Advance.

Regards,

Aniket Kumar

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jan 07, 2015 at 10:43 AM

    As per general rules, custom fields on standard table should be managed via EXTENSIONING table.

    Problem: for EKET Table we do not have any extensionin available in BAPI_PO_CHANGE, just these.


    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 07, 2015 at 10:49 AM

    Hi

    The version of BAPI_PO_CHANGE (in my system) doesn't support the extension for schedule data, but only for header, item and accounting

    Max

    Add comment
    10|10000 characters needed characters exceeded