Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question