Application Development and Automation 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: 
Read only

using zbadi definition

Former Member
0 Likes
948

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

4 REPLIES 4
Read only

uwe_schieferstein
Active Contributor
0 Likes
813

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_SALES

it 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

Read only

0 Likes
813

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.

Read only

0 Likes
813

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.

Read only

0 Likes
813

hi Uwe Schieferstein ,

Thanks for the document, though my requirement differs it has given me an alternate way of doing.