‎2009 Jan 31 3:45 AM
hi,
my requirement is to trigger ZBADI using a standard transaction va01 for which i have done
like below.
i have created a Zbadi defintion like: zbadi_sd_sales and the interface as ZIF_EX_BADI_SD_SALES
in the enhancement spot BADI_SD_SALES.Now in SE19 i have defined the implemetation say as
zbadi_sd_sales_imp,but it is not getting trigered when i execute va01.
when i use the standard BADI definition BADI_SD_SALES it is working. iam using ZBADI definition
because i need to add an import parameter to standard interface.
is my approach correct? iam new to BADI's
please help me
‎2009 Jan 31 9:20 PM
Hello Ganesh
No, your approach cannot work because the standard system does not have any clue about what it should do with your Z-BAdI definition. The standard program objects only refer to standard BAdIs. Example:
When the system encounters the statement
GET BADI lo_badi. " lo_badi is of TYPE REF TO IF_EX_BADI_SD_SALESit checks whether there are active implementation of the underlying BAdI (here: BADI_SD_SALES).
If the variable lo_badi were of TYPE REF TO zif_ex_badi_sd_sales then I would look up active implementation of ZBADI_SD_SALES. However, this would imply that you enhance / modify the standard report.
Assuming that the additional IMPORTING parameters are GLOBAL variables of the main program you can use the following approach:
[SAP User Exits and the People Who Love Them|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/208811b0-00b2-2910-c5ac-dd2c7c50c8e8]
Regards
Uwe
‎2009 Feb 02 7:57 AM
hi Uwe Schieferstein ,
yes my requirement is to enhance the standard program of va01 using BADI's.
my interface ZIF_EX_BADI_SD_SALES is copy of standadr interface IF_EX_BADI_SD_SALES
with extra one importing parameter added, which is IT_XTHEAD like TAB_THEADVB.
Now in my zbadi_sd_sales_imp implementation i have to implement my coding
in the method SAVE_DOCUMENT_PREPARE and this is the only place i have to implement logic.
Now if i execute VA01 the ZBADI implemented by me should get triggered.
can explain how to do it.
‎2009 Feb 02 9:29 AM
Hi ganesh,
Since your requirement is to process some extra logic during SAVE.
Instead of creating a ZBADI definition and implimentation, you can directly write your requisite piece of code in User Exit Include MV45AFZZ FORM USEREXIT_SAVE_DOCUMENT_PREPARE.
This might solve your requirement.
Hope this helps.
Regards,
Abhisek.
‎2009 Feb 04 5:02 AM
hi Uwe Schieferstein ,
Thanks for the document, though my requirement differs it has given me an alternate way of doing.