Search code examples
abapsap-r3

Is it possible to select data in the post save BADI of a deletion?


I am using Badi MD_PLDORD_POST when I delete an order using transaction MF50.

I want to retrieve data that is not available in the parameters of the IF_EX_MD_PLDORD_POST~POST_AFTER_SAVE_MAN method.

I tried using BYPASSING BUFFER:

SELECT SINGLE plnum
      FROM plaf
      INTO @DATA(lv_plnum)
      BYPASSING BUFFER
      WHERE plnum = @im_plaf_new-plnum.

It does not find any data, but if I but a break on the select and check the data in SE11, table PLAF - the entry is there.

This select works when the order is being created or edited, so it is not a conversion problem.

Is it impossible the get the data at this point (if so, then why is the data still visible in SE11 at that point ?) , or am I using the BYPASSING BUFFER wrong ?


Solution

  • Using CONNECTION r/3*my_conn in the select statement worked!

    I also removed BYPASSING BUFFER from the statement:

    SELECT SINGLE plnum
          FROM plaf
          INTO @DATA(lv_plnum)
          CONNECTION r/3*my_conn
          WHERE plnum = @im_plaf_new-plnum.