cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_PO_CHANGE

frknkzlrsln
Participant
0 Kudos
270

Hello friends, I want to change the LOEKZ field in EKPO as seen in the codes below. However, although BAPI returns a success message, LOEKZ does not change. Why could it be ? I add my code below .

 

       LOOP AT lt_wf_td_003 INTO ls_wf_td_003.
          APPEND INITIAL LINE TO lt_poitem ASSIGNING <fs_poitem>.
          <fs_poitem>-po_item    ls_wf_td_003-ebelp.
          <fs_poitem>-delete_ind abap_false.

          APPEND INITIAL LINE TO lt_poitemx ASSIGNING <fs_poitemx>.
          <fs_poitemx>-po_item    ls_wf_td_003-ebelp.
          <fs_poitemx>-po_itemx   abap_true .
          <fs_poitemx>-delete_ind abap_true.

          UNASSIGN<fs_poitem>,<fs_poitemx>.
        ENDLOOP.

        " Call BAPI To Update PO With Items Table
        CALL FUNCTION 'BAPI_PO_CHANGE'
          EXPORTING
            purchaseorder iv_doc_number+0(10)
          TABLES
            return        lt_return_po
            poitem        lt_poitem
            poitemx       lt_poitemx.

        LOOP AT lt_return_po TRANSPORTING NO FIELDS WHERE type CA 'EAX'.
          EXIT.
        ENDLOOP.
        IF sy-subrc NE 0" No Error
          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
            EXPORTING
              wait 'X'.

       ENDIF.

Sandra_Rossi
Active Contributor
0 Kudos
LOEKZ does not change from what value to what value? (i.e. what value do you have before, what value do you expect after? What happens if you try to change it manually via ME22N? Did you check the many SAP notes about BAPI_PO_CHANGE and LOEKZ?
View Entire Topic
raga1234
Explorer
0 Kudos

Please debug and check your Commit has triggered.