‎2007 Aug 28 12:50 PM
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
‎2007 Aug 28 12:54 PM
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
‎2007 Aug 28 12:54 PM
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
‎2007 Aug 28 12:59 PM
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
‎2007 Aug 28 1:05 PM
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
‎2007 Aug 28 8:38 PM
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
‎2007 Aug 29 5:12 AM
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..
‎2007 Aug 29 6:12 PM
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