Skip to Content

Hi,

Recently I am involve in a very big project and we are discussing ways to code in old fashion user exit (form exit ,functions).

One of the options is to use BADI within the enhancement framework .

I became aware of this idea from  A framework for local/region specific requirements in user-exits using BAdIs and the new enhancement framework (revisited). by Bruno Esperança

This small blog post will present an idea how to sort the BADI implementation prior to execution.

For code See attache program Y_R_EITAN_TEST_51_18

The basis of the idea is based on the fact that internal table IMPS that contains the implementations is public.

/wp-content/uploads/2014/10/2014_10_07_06h41_39_557110.png

/wp-content/uploads/2014/10/2014_10_07_06h41_56_557113.png

In the BADI interface we can create a method that will give the implementation the option to return its sorting value .

/wp-content/uploads/2014/10/2014_10_07_08h36_29_557112.png

FORM test_01 is “regular” call .

And the result:

/wp-content/uploads/2014/10/2014_10_07_08h44_20_557114.png

FORM test_02 is “sorted” call .

From each implementation we get the result of get_sort_value to create the a sorting table .

/wp-content/uploads/2014/10/2014_10_07_08h59_08_557128.png

We sort the implementation in descending order .

And the result:

/wp-content/uploads/2014/10/2014_10_07_08h46_03_557115.png

It seems to be working .

Mind you that this sorting code was not tested in actual production environment .

Regards.

To report this post you need to login first.

8 Comments

You must be Logged on to comment or reply to a post.

  1. Shai Sinai

    Hi,

    May I ask why do you need to sort the implementations?

    Anyway,

    You have a standard way to achieve it:

    For new BAdI, you have in the BAdI implementation a dedicated field called “Layer of a BAdI Implementation” (Data element /DBM/OE_ENHBADI_IMPL_LAYER_D) by default.

    For classic BAdI you might need to work a little harder and first explicitly activate the sorting option via SE18 -> Utilities -> Sort (read further details in SAP Help). Then you should have a similar field in the BAdI implementation (SE19).

    (0) 
    1. Eitan Rosenberg Post author

      Hi,

      I have no need for sorting at the moment.

      I am on on ecc6 .

      Maybe I missed that but I do not see any sort under ….

      My phone is public can you call me please.

      Regards.

      (0) 
          1. Suhas Saha

            This SORT feature is supported for classical BAdIs only. The one that you have defined is a Kernel BAdI and it can be sorted by BADI_SORTER only.

            (0) 
            1. Shai Sinai

              Suhas,

              It seems you are right.

              For some reason, I thought that this is default behaviour in new BAdI, but it seems it depends on implementation of BADI_SORTER.

              (0) 

Leave a Reply