Thursday 9 September 2021

Kernel Badi Sorter with Multiple Implementation

The intention here is to do a sample test Sorting of Multiple Implementations of a Kernel BADI.

A pre-requisite of knowing Kernel BADI basics is required.

So, I have defined a Enhancement Spot ZDPK_KERNEL_BADI_SORT_EHN

ABAP Development, ABAP Connectivity, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Study Material, SAP ABAP Preparation, SAP ABAP Certification
Create Badi

A Badi defined by the name ZDPK_KB_SORT_DEF with an interface as

ZIF_DPK_KB_SORT_DEF

ABAP Development, ABAP Connectivity, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Study Material, SAP ABAP Preparation, SAP ABAP Certification
Badi definition and Interface

Create Implementation.

ABAP Development, ABAP Connectivity, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Study Material, SAP ABAP Preparation, SAP ABAP Certification

My Badi interface Contain only one Method without parameter.

ABAP Development, ABAP Connectivity, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Study Material, SAP ABAP Preparation, SAP ABAP Certification

And am creating multiple implementations of my badi and activated also.

I have created two implementations and just printing implementation and number of

implementations.

Implementation 1:

ABAP Development, ABAP Connectivity, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Study Material, SAP ABAP Preparation, SAP ABAP Certification

Implementation 2:

ABAP Development, ABAP Connectivity, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Study Material, SAP ABAP Preparation, SAP ABAP Certification

Create one report Program for testing Purpose and Execute it.

ABAP Development, ABAP Connectivity, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Study Material, SAP ABAP Preparation, SAP ABAP Certification

Output:

ABAP Development, ABAP Connectivity, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Study Material, SAP ABAP Preparation, SAP ABAP Certification
Without sorting badi implementation output

Now we need to change the sequence of Badi Implementation.

For that we need to Screen Enhancement to create a layer screen.

Now we need to create a Implementation in BADI_SORTER.

ABAP Development, ABAP Connectivity, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Study Material, SAP ABAP Preparation, SAP ABAP Certification

ABAP Development, ABAP Connectivity, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Study Material, SAP ABAP Preparation, SAP ABAP Certification
Create Badi implementaion and Implementing Class

A Sample implementation Class has been provided already. Just copy that class.

ABAP Development, ABAP Connectivity, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Study Material, SAP ABAP Preparation, SAP ABAP Certification

Create Filter Combination.

ABAP Development, ABAP Connectivity, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Study Material, SAP ABAP Preparation, SAP ABAP Certification

Am providing Filter value for my implementation.

ABAP Development, ABAP Connectivity, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Study Material, SAP ABAP Preparation, SAP ABAP Certification

Am adding screen Enhancement for my Badi. Go to Screen Enhancement.

SAPLENH_BADI_SORTER_SUBSCREENS this is one of the Standard Program.

Some different screen there under the Standard Program. Now am using screen number 2000.

ABAP Development, ABAP Connectivity, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Study Material, SAP ABAP Preparation, SAP ABAP Certification

Activating my implementaion.

ABAP Development, ABAP Connectivity, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Study Material, SAP ABAP Preparation, SAP ABAP Certification

Go back your Badi implementation.

Now you can see additional sub-screen with the title Layer.  Now you choose your

implementation

which implementation need to execute first and last.

Filter value as ‘2’ for my First Implementation.

ABAP Development, ABAP Connectivity, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Study Material, SAP ABAP Preparation, SAP ABAP Certification
First Implementation

Filter value as ‘1’ for my Second Implementation.

ABAP Development, ABAP Connectivity, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Study Material, SAP ABAP Preparation, SAP ABAP Certification
Second Implementation

Am activating my Badi implementation.

Go to report Program and Executing it.

ABAP Development, ABAP Connectivity, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Study Material, SAP ABAP Preparation, SAP ABAP Certification
With sorting Badi implementation Output

I hope abapers will understand badi sorter with multiple implementation.

No comments:

Post a Comment