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: 

BADI Implementation

VB09104
Active Participant
0 Kudos

hello all,

i want to write a code in badi associated with transaction MB22, used for deletion of reservations. i need to get this history in SLG1 log.

can anyone please tell me how do i solve this.

<b>also can i write subroutines in the implementation methods?</b>

thanks for help..

regards,

vikas

1 ACCEPTED SOLUTION

0 Kudos

Hi,

BADI implementations are basically Global classes. So its like a class that you create using the Class builder SE24.

Its not possible to create subroutines in a CLASS or in method of its class.

But if you want to use Subroutines what you can do is create a Subtoutine pool and create your subroutines there.

ANd you can call these subrotuines using this syntax.

PERFORM <subroutine_name> IN PROGRAM <program _name>.

SE19 is the transaction used for creating BADI implementations.

Regards,

Sesh

6 REPLIES 6

0 Kudos

Hi,

BADI implementations are basically Global classes. So its like a class that you create using the Class builder SE24.

Its not possible to create subroutines in a CLASS or in method of its class.

But if you want to use Subroutines what you can do is create a Subtoutine pool and create your subroutines there.

ANd you can call these subrotuines using this syntax.

PERFORM <subroutine_name> IN PROGRAM <program _name>.

SE19 is the transaction used for creating BADI implementations.

Regards,

Sesh

0 Kudos

thanks fr ur reply..

how do i create subroutine pool and do i need to write above syntax in that method to call that subroutine?

what will be the PROGRAM name?

thanks,

vikas

0 Kudos

Hi,

For creating a Subrotuine pool

1) Goto Se80

2) Select Program from the DROP DOWN

3) Enter program name

4) Press enter, you will be asked to create if the program already does not exist

5) Unselect the TOP_INCL check box in the next dialog

6) In the next Dialog under "Attributes" from program type drop downselect "subrotuine pool".

7) Then click on save.

Now the program saved and ready for you to create any routines. use FORM ENDFORM to create your routines.

In the above syntax you need to pass the program name that you have here.

Regards,

Sesh

Former Member
0 Kudos

Hi Vikas,

Check the possibility of implementing BADI MB_RESERVATION_BADI.

There it seems a possiblity of issuing an message based on data verification.

Since I am not sure about data could not pass any code to you.

Let me know in case of any further queries.

Thanks & Regards

Mahendra

0 Kudos

thanks fr ur reply..

yes i am using the BADI MB_RESERVATION_BADI with implementation created ZMA0_MB_RESERVATIONS.

what i need to do is, when one delete the reservation thr' MB22 it should reflect in SLG1 log with some information like reservation number, material..

please suggest me..

0 Kudos

Hi,

You may use code similar to this.

  • In this example the content of field recipient is checked depending

  • on the plant and movement type

  • The checks are only to be performed for movement type 501 in

  • plant 0001.

check is_resb-bwart = '501' and is_resb-werks = '0001'.

  • Send a warning in case the user enters a different recipient than

  • 'Schmidt' and send an error message in case the recipient is left

  • blank.

if is_resb-wempf <> 'SCHMIDT' and not is_resb-wempf is initial.

message W666(01) with 'The default recipient is SCHMIDT'

raising EXTERNAL_MESSAGE.

elseif is_resb-wempf is initial.

message E666(01) with 'Please enter a recipient'

'The default recipient is SCHMIDT'

raising EXTERNAL_MESSAGE.

endif.

Thanks & Regards

Mahendra