cancel
Showing results for 
Search instead for 
Did you mean: 

Return PO-Populate field EKPV-SPE_AUTH_NUMBER with value

0 Kudos

Hi All

While creating return PO, we would like to populate field EKPV-SPE_AUTH_NUMBER. We need to have this field populated with ekpo.labnr field because once it is there, then it will automatically flow in to delivery and then to EWM etc.

We have tried badi - ME_PROCESS_PO_CUST. sample code as below. But getting error - Message No. MEPO151 - Data from Business Add-In ME_PROCESS_PO_CUST not adopted.

CALL METHOD im_item->get_shipping_data RECEIVING re_ekpv = ls_shipping.

ls_shipping-spe_auth_number = ls_item_data-labnr.

CALL METHOD im_item->set_shipping_data EXPORTING im_ekpv = ls_shipping.

What is the solution? How to resolve this?

Accepted Solutions (0)

Answers (3)

Answers (3)

raymond_giuseppi
Active Contributor
0 Kudos

Try to only call set_shipping_data (and any set_data method) when you actually changed some value (new_ekpv <> old_ekpv) to prevent infinite loops.

CALL METHOD im_item->get_shipping_data RECEIVING re_ekpv = ls_shipping.
IF ls_shipping-spe_auth_number <> ls_item_data-labnr.
  ls_shipping-spe_auth_number = ls_item_data-labnr.
  CALL METHOD im_item->set_shipping_data EXPORTING im_ekpv = ls_shipping.
ENDIF.

Prasoon
Active Contributor
0 Kudos

Hi,

Kindly refer the KBA: 2157373 - Hints for error MEPO151 in BADI ME_PROCESS_PO_CUST which explains the different possibilities and solution for the error.

Regards,

yogananda
Product and Topic Expert
Product and Topic Expert
0 Kudos

yogisap007

The error message ‘MEPO151’ is generated when the system enters an infinite loop because of an incorrect sequence the BADI implementation’s logic. In order to solve the error message, please check these points with your ABAP developer and correct ...1.

0 Kudos

Tried this. But not resolved problem.