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

BADI's function

Former Member
0 Likes
1,004

Hi Experts,

I am praticing in BADI in HR infotype 8. When I create implementation with help of SE19 tcode, it will appear an error "Interface implementation IF_EX_GOS_SRV_SELECT does not exist" occur. Kindly help me out in BADI.

Thanks

Syed Tayab shah

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
764

Hai.

check this.

Steps to create a HR Infotype:

1) Go to Transaction PM01.

2) Enter the custom Infotype number which you want to create (Should be a 4 digit number, start with 9).

3) Select the 'Employee Infotype' radio button.

4) Select the 'PS Structure Infotype'.

5) Click on Create... A separate table maintenance window appears...

6) Create a PS structure with all the fields you want on the Infotype

7) Save and Activate the PS structure

😎 Go back to the initial screen of PM01.

9) Click on 'All' push button. It takes a few moments.

10) Click on 'Technical Characteristics'. Infotype list screen appears

11) Click on 'Change'(pencil) button

12) Select your Infotype and click on 'Detail' (magnifying glass) button

13) Give 'T591A' as subtype table

14) Give 'T591S' as subtype txt tab

15) Give your subtype field as subtype field

16) Save and come back to PM01 initial screen

17) Click on 'Infotype Characteristics' ... Infotype list screen appears

18) Click on 'Change' (pencil) button

19) Click on 'New Entries'

20) Enter your Infotype number and short text

21) Here we have to set different Infotype Characteristics as per the requirement. (Better open another session with some standard Infotype's infotype characteristics screen and use as the reference to fill yours)

22) Save your entries.

23) Now the Infotype is created and ready to use.

24) If you want to change the layout of the Infotype as per your requirement...

25) In the PM01 initial screen...Select 'Screen' radio button and give 2000 as the screen name, then click on edit.

26) In the next screen.. Select 'Layout Editor' and click 'Change'.

27) Screen default layout appears...here you can design/modify the screen..change the attributes of the fields..etc.

28) Save and activate. (Don't forget to 'Activate at every level)

Subtype Creation :

Transaction PM01 Goto Subtype Characteristics. Click on Append and then subtype. Enter the name and description of subtype on screen.

Then goto technical Characteristics and maintain the details of subtype there. I.e name of subtype i.e. component name defined in PSnnnn. Subtype table is T591A.

Subty.text tab is T591S and time const tab is T591A.

-


Business Add-Ins

Business Add-Ins are a new SAP enhancement technique based on ABAP Objects. They can be inserted into the SAP System to accommodate user requirements too specific to be included in the standard delivery. Since specific industries often require special functions, SAP allows you to predefine these points in your software.

As with customer exits (SMOD/CMOD [Page 40]), two different views are available:

• In the definition view, an application programmer predefines exit points in a source that allow specific industry sectors, partners, and customers to attach additional software to standard SAP source code without having to modify the original object.

• In the implementation view, the users of Business Add-Ins can customize the logic they need or use a standard logic if one is available.

In contrast to customer exits, Business Add-Ins no longer assume a two-system infrastructure (SAP and customers), but instead allow for multiple levels of software development (by SAP, partners, and customers, and as country versions, industry solutions, and the like). Definitions and implementations of Business Add-Ins can be created at each level within such a system infrastructure.

SAP guarantees the upward compatibility of all Business Add-In interfaces. Release upgrades do not affect enhancement calls from within the standard software nor do they affect the validity of call interfaces. You do not have to register Business Add-Ins in SSCR.

The Business Add-In enhancement technique differentiates between enhancements that can only be implemented once and enhancements that can be used actively by any number of customers at the same time.

In addition, Business Add-Ins can be defined according to filter values. This allows you to control add-in implementation and make it dependent on specific criteria (on a specific Country value, for example). All ABAP sources, screens, GUIs, and table interfaces created using this enhancement technique are defined in a manner that allows customers to include their own enhancements in the standard.

A single Business Add-In contains all of the interfaces necessary to implement a specific task. In Release 4.6A, program and menu enhancements can be made with Business Add-Ins. The actual program code is enhanced using ABAP Objects. In order to better understand the programming techniques behind the Business Add-In enhancement concept, SAP recommends reading the section on ABAP Objects

DEFINING THE BADI

1) execute Tcode SE18.

2) Specify a definition Name : ZBADI_SPFLI

3) Press create

4) Choose the attribute tab. Specify short desc for badi.. and specify the type :

multiple use.

5) Choose the interface tab

6) Specify interface name: ZIF_EX_BADI_SPFLI and save.

7) Dbl clk on interface name to start class builder . specify a method name (name,

level, desc).

Method level desc

Linese;ection instance methos some desc

😎 place the cursor on the method name desc its parameters to define the interface.

Parameter type refe field desc

I_carrid import spfli-carrid some

I_connid import spefi-connid some

9) save , check and activate…adapter class proposed by system is

ZCL_IM_IM_LINESEL is genereated.

IMPLEMENTATION OF BADI DEFINITION

1) EXECUTE tcode se18.choose menuitem create from the implementation menubar.

2) Specify aname for implementation ZIM_LINESEL

3) Specify short desc.

4) Choose interface tab. System proposes a name fo the implementation class.

ZCL_IM_IMLINESEL which is already generarted.

5) Specify short desc for method

6) Dbl clk on method to insert code..(check the code in “AAA”).

7) Save , check and activate the code.

Now write a sample program to use this badi method..

Look for “BBB” sample program.

“AAA”

data : wa_flights type sflight,

it_flights type table of sflight.

format color col_heading.

write:/ 'Flight info of:', i_carrid, i_connid.

format color col_normal.

select * from sflight

into corresponding fields of table it_flights

where carrid = i_carrid

and connid = i_connid.

loop at it_flights into wa_flights.

write:/ wa_flights-fldate,

wa_flights-planetype,

wa_flights-price currency wa_flights-currency,

wa_flights-seatsmax,

wa_flights-seatsocc.

endloop.

“BBB”

&----


*& Report ZBADI_TEST *

*& *

&----


REPORT ZBADI_TEST .

tables: spfli.

data: wa_spfli type spfli,

it_spfli type table of spfli with key carrid connid.

*Initialise the object of the interface.

data: exit_ref type ref to ZCL_IM_IM_LINESEL,

exit_ref1 type ref to ZIF_EX_BADISPFLI1.

selection-screen begin of block b1.

select-options: s_carr for spfli-carrid.

selection-screen end of block b1.

start-of-selection.

select * from spfli into corresponding fields of table it_spfli

where carrid in s_carr.

end-of-selection.

loop at it_spfli into wa_spfli.

write:/ wa_spfli-carrid,

wa_spfli-connid,

wa_spfli-cityfrom,

wa_spfli-deptime,

wa_spfli-arrtime.

hide: wa_spfli-carrid, wa_spfli-connid.

endloop.

at line-selection.

check not wa_spfli-carrid is initial.

create object exit_ref.

exit_ref1 = exit_ref.

call method exit_ref1->lineselection

EXPORTING

i_carrid = wa_spfli-carrid

i_connid = wa_spfli-connid.

clear wa_spfli.

regards.

sowjanya.b

4 REPLIES 4
Read only

Former Member
0 Likes
765

Hai.

check this.

Steps to create a HR Infotype:

1) Go to Transaction PM01.

2) Enter the custom Infotype number which you want to create (Should be a 4 digit number, start with 9).

3) Select the 'Employee Infotype' radio button.

4) Select the 'PS Structure Infotype'.

5) Click on Create... A separate table maintenance window appears...

6) Create a PS structure with all the fields you want on the Infotype

7) Save and Activate the PS structure

😎 Go back to the initial screen of PM01.

9) Click on 'All' push button. It takes a few moments.

10) Click on 'Technical Characteristics'. Infotype list screen appears

11) Click on 'Change'(pencil) button

12) Select your Infotype and click on 'Detail' (magnifying glass) button

13) Give 'T591A' as subtype table

14) Give 'T591S' as subtype txt tab

15) Give your subtype field as subtype field

16) Save and come back to PM01 initial screen

17) Click on 'Infotype Characteristics' ... Infotype list screen appears

18) Click on 'Change' (pencil) button

19) Click on 'New Entries'

20) Enter your Infotype number and short text

21) Here we have to set different Infotype Characteristics as per the requirement. (Better open another session with some standard Infotype's infotype characteristics screen and use as the reference to fill yours)

22) Save your entries.

23) Now the Infotype is created and ready to use.

24) If you want to change the layout of the Infotype as per your requirement...

25) In the PM01 initial screen...Select 'Screen' radio button and give 2000 as the screen name, then click on edit.

26) In the next screen.. Select 'Layout Editor' and click 'Change'.

27) Screen default layout appears...here you can design/modify the screen..change the attributes of the fields..etc.

28) Save and activate. (Don't forget to 'Activate at every level)

Subtype Creation :

Transaction PM01 Goto Subtype Characteristics. Click on Append and then subtype. Enter the name and description of subtype on screen.

Then goto technical Characteristics and maintain the details of subtype there. I.e name of subtype i.e. component name defined in PSnnnn. Subtype table is T591A.

Subty.text tab is T591S and time const tab is T591A.

-


Business Add-Ins

Business Add-Ins are a new SAP enhancement technique based on ABAP Objects. They can be inserted into the SAP System to accommodate user requirements too specific to be included in the standard delivery. Since specific industries often require special functions, SAP allows you to predefine these points in your software.

As with customer exits (SMOD/CMOD [Page 40]), two different views are available:

• In the definition view, an application programmer predefines exit points in a source that allow specific industry sectors, partners, and customers to attach additional software to standard SAP source code without having to modify the original object.

• In the implementation view, the users of Business Add-Ins can customize the logic they need or use a standard logic if one is available.

In contrast to customer exits, Business Add-Ins no longer assume a two-system infrastructure (SAP and customers), but instead allow for multiple levels of software development (by SAP, partners, and customers, and as country versions, industry solutions, and the like). Definitions and implementations of Business Add-Ins can be created at each level within such a system infrastructure.

SAP guarantees the upward compatibility of all Business Add-In interfaces. Release upgrades do not affect enhancement calls from within the standard software nor do they affect the validity of call interfaces. You do not have to register Business Add-Ins in SSCR.

The Business Add-In enhancement technique differentiates between enhancements that can only be implemented once and enhancements that can be used actively by any number of customers at the same time.

In addition, Business Add-Ins can be defined according to filter values. This allows you to control add-in implementation and make it dependent on specific criteria (on a specific Country value, for example). All ABAP sources, screens, GUIs, and table interfaces created using this enhancement technique are defined in a manner that allows customers to include their own enhancements in the standard.

A single Business Add-In contains all of the interfaces necessary to implement a specific task. In Release 4.6A, program and menu enhancements can be made with Business Add-Ins. The actual program code is enhanced using ABAP Objects. In order to better understand the programming techniques behind the Business Add-In enhancement concept, SAP recommends reading the section on ABAP Objects

DEFINING THE BADI

1) execute Tcode SE18.

2) Specify a definition Name : ZBADI_SPFLI

3) Press create

4) Choose the attribute tab. Specify short desc for badi.. and specify the type :

multiple use.

5) Choose the interface tab

6) Specify interface name: ZIF_EX_BADI_SPFLI and save.

7) Dbl clk on interface name to start class builder . specify a method name (name,

level, desc).

Method level desc

Linese;ection instance methos some desc

😎 place the cursor on the method name desc its parameters to define the interface.

Parameter type refe field desc

I_carrid import spfli-carrid some

I_connid import spefi-connid some

9) save , check and activate…adapter class proposed by system is

ZCL_IM_IM_LINESEL is genereated.

IMPLEMENTATION OF BADI DEFINITION

1) EXECUTE tcode se18.choose menuitem create from the implementation menubar.

2) Specify aname for implementation ZIM_LINESEL

3) Specify short desc.

4) Choose interface tab. System proposes a name fo the implementation class.

ZCL_IM_IMLINESEL which is already generarted.

5) Specify short desc for method

6) Dbl clk on method to insert code..(check the code in “AAA”).

7) Save , check and activate the code.

Now write a sample program to use this badi method..

Look for “BBB” sample program.

“AAA”

data : wa_flights type sflight,

it_flights type table of sflight.

format color col_heading.

write:/ 'Flight info of:', i_carrid, i_connid.

format color col_normal.

select * from sflight

into corresponding fields of table it_flights

where carrid = i_carrid

and connid = i_connid.

loop at it_flights into wa_flights.

write:/ wa_flights-fldate,

wa_flights-planetype,

wa_flights-price currency wa_flights-currency,

wa_flights-seatsmax,

wa_flights-seatsocc.

endloop.

“BBB”

&----


*& Report ZBADI_TEST *

*& *

&----


REPORT ZBADI_TEST .

tables: spfli.

data: wa_spfli type spfli,

it_spfli type table of spfli with key carrid connid.

*Initialise the object of the interface.

data: exit_ref type ref to ZCL_IM_IM_LINESEL,

exit_ref1 type ref to ZIF_EX_BADISPFLI1.

selection-screen begin of block b1.

select-options: s_carr for spfli-carrid.

selection-screen end of block b1.

start-of-selection.

select * from spfli into corresponding fields of table it_spfli

where carrid in s_carr.

end-of-selection.

loop at it_spfli into wa_spfli.

write:/ wa_spfli-carrid,

wa_spfli-connid,

wa_spfli-cityfrom,

wa_spfli-deptime,

wa_spfli-arrtime.

hide: wa_spfli-carrid, wa_spfli-connid.

endloop.

at line-selection.

check not wa_spfli-carrid is initial.

create object exit_ref.

exit_ref1 = exit_ref.

call method exit_ref1->lineselection

EXPORTING

i_carrid = wa_spfli-carrid

i_connid = wa_spfli-connid.

clear wa_spfli.

regards.

sowjanya.b

Read only

Former Member
0 Likes
764

Hi Syed Tayab Shah ,

if you are implement in V_EXT_NO then it is not possible because it is only for SAP so plz check it.

and now you are able to impliment in V_EXT_IMP only..

If Satisfied Rewards me..

Kind Regards

Yogesh Gupta

Read only

0 Likes
764

Hi,

I am creating my own implementation i.e. ZFIRST_IMP

where cant save it because a error occur

"Interface implementation IF_EX_GOS_SRV_SELECT does not exist"

so i check it on defination GOS_SRV_SELECT. But method IF_EX_GOS_SRV_SELECT exist in interface tab.

Syed Tayab Shah

Read only

0 Likes
764

Hi,

I am creating my own implementation i.e. ZFIRST_IMP

where cant save it because a error occur

"Interface implementation IF_EX_GOS_SRV_SELECT does not exist"

so i check it on defination GOS_SRV_SELECT. But method IF_EX_GOS_SRV_SELECT exist in interface tab.

Syed Tayab Shah