Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

components of badi

Former Member
0 Kudos

hi gurus

what are the components of badi

2 REPLIES 2

Former Member

Former Member
0 Kudos

Hi

Tcodes:

SE18: BADI Definition.

SE19: BADI Implementation.

For One Badi def we able to provide n no.of implementation.

Components:

1) Attributes:

we found Name of the Business add in class,

we have a chance tick or untick the Multiple use checkbox for custom badi def and

Filter type: Fiter type always should be dataelement and search help needs to be attached.

2)Interface:

we found the inteface name ofor the badi def.

In this interface provided the method definitions.

we need to provide implementation with these method

using se19 tcode.

3)Fcodes and Subscreens.

These should be used when we add our own screen to

SAP statndard tcode.

example:

There is a business demand in ABC corporation . when the user will post goods receipt via transaction MIGO, he should enter same date in document date and posting date field.

Else, an information message will ask the user to do that.

The Bill of Lading number should start with ‘NP’

You, as a SAP Technical Consultant, is asked to translate this idea into the appropriate section of the code.

Your manager has asked you to use BADI instead of any user or field exits to implement the idea.

Go to the program behing MIGO and search for the phrase : CL_EXITHANDLER=>GET_INSTANCE in the main program. This will show you the BADIs which can be implemented by you to incorporate the business demand.

So, you get to know now that there are two BADIs which can come to your use. They are:

MB_MIGO_BADI

MB_MIGO_ITEM_BADI.

Now, you have to go to transaction SE18 and explore each of the BADIs to find out the suitable one. In fact, the suitable one will have a method in it for which import/export parameters should have some reference to document/posting dates.

On investigation, you will find that in BADI : MB_MIGO_ITEM_BADI, there is a method : ITEM_MODIFY which uses : is_gohead as import parameter. This has the structure GOHEAD which contains the fields for document and posting date as columns.

Now, you will implement this BADI. Go to transaction SE19 and create an implementation for the BADI. In the code for the method, write the following:-

method IF_EX_MB_MIGO_ITEM_BADI~ITEM_MODIFY .

DATA : L_INI(2) TYPE C.

IF is_gohead-bldat ne is_gohead-budat.

message i398(00) with 'Both posting and document dates should be same'.

ENDIF.

L_INI = IS_GOHEAD-FRBNR+0(2).

TRANSLATE L_INI TO UPPER CASE.

IF L_INI NE 'NP'.

MESSAGE I398(00) WITH 'Bill of Lading should start with NP'.

ENDIF.

endmethod.

If it is helpful rewards points

Regards

Pratap.M