0% found this document useful (0 votes)
2 views

enhancments_batch4

enhnacments

Uploaded by

satishkurra9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

enhancments_batch4

enhnacments

Uploaded by

satishkurra9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 12

SD - sales and distrub

MM - material managment
FI - finnace
PP - Production Planning
PM - Plant Maintaince
QM - Qulaity Managment
PS -- Project systems

Modification :

User exit :

we can see user exits only in SD module .


user exits are in the form of subroutines .

Form userexit_<name >.

End form
Required Acces key for the User exit.(Only first time ).
acces key will provide by Basis team.

SAPMV45A ---- MV45AFZZ.


USEREXIT_SAVE_DOCUMENT_PREPARE.
USEREXIT_FIELD_MODIFICATION.

WE can call it as modification.


we are taking the acces key and doing the code cxahnges in standard includes .

finding the User exit :

Go Spro --> click in Refernec IMG -->


Expand Sales and distribution --> Systme modifcatioms --

SE80 -- select the Package - provide the package VMOD -- expland the includes -->

A --
MV45afzz

B --
mv45afzx

DE3 QE3 PE3


60 360 we doent have acces for PE3
90 FFID 0 fire fighter id
100
testing
Customer Exit :

we can see in all modules like SD,MM,FI,PP,PM.


customer exits are in the form of Call function-Customer (Function modules ).
we does not require acces key .
Project creation manadatory .
SMOD - find out the customer exit
CMOD - project creation
customer exit will have only single implementation.

lets suppose we have created one project ZTEST and assigned Enhancement ABC . if
we trying to create one more project ZTEST1 and assigng the same enhancmnent name
system will throw the error.

call function-customer '001'.


call function-customer '003'.

find the package name -- -


Se93 -- provide t code --- Take the package name

go to SMOD --> Click on F4 provide the pacakge name .

we can see the list of customer exits for the package .

documentations of customer exit or function module documentation.

we need check the signature of the function modules.

lets take example in MM01 based on the plant i want to change the value of Profit
Center .

In this case Plant should be my importing Parameter and Profit center should be
export or change or tables.
if profit in importing parameter we canot achevie the functionality .

Second way :
Lets suppose we want to find at the time of save customer exit ..
Before click on save /H on command prompt

click on save --- it will go debug --> Break points -->break point at statment --
> Call customer-function.

system will stop at call customer function stament.

customer exit related information will save in below tables:


MODACT - we will find the project name against the enhamnet .

MODSAP - we will find function module name or enahncemnet name.

CMOD - Provide the Project name -->


Click on Ceate -- > Click on Enhancment assigment --> Provie the customer exit
name -->click on components -->

we can see function exit ,screen exit or menu exit.


with in the fm we can see Z include we can double click and enter . in side that
include we can write the logic.

if we delete the Z include code only delete.

BADIs :

we can create multiple implementaions .


badis will follow object oreinted approach .

Interface ---- the main reason badis allowing multiple implementaion was interfaces
.

Polymorphansiam also we can see in Badis level.

ZTEST_TEST - implemnetation name


IF_EX_VENDOR_ADD_DATA - defination only ]
ZCL_IM_TEST_TEST

ZTEST_VENDOR_NAME - implementation name


IF_EX_VENDOR_ADD_DATA
ZCL_IM_TEST_VENDOR_NAME

it_bsg
delete it_bseg where bukrs = '500'.

if bukrs = '300'.
it_bseg
elseif bukrs = '500'.
it_bseg

else
endif.

properties :
with in sap :
we canot create the implementation if we try to create it will throw the error.

multiple use - this check box checked by sap team.

if this check box checked then only badi will have multiple implementations .

if this check box was not checed then it will have only one active implementation
at a time.

existing implementaion if we have added new logic functional team need to do


integration testing .

lets suppose we have added the new logic in the same implementation and moved to
QE3 (quality) and PE3(Production ).
Later user comes back with he does not reuqired the earlier changes then if we have
multiple implementations we can deactivate or delete the implementation we can move
the changes to QE3 and PE3.

Filter Dependent Badi : this was also check by sap

lets suppose we have created two implementations A and B for badi .if we want to
execute A implementation for country US and B implementation needs to exectue for
UK .
this kind of scenarioes this filter dependemt will helpful.

it will allow to create multiple implementatiosn but the fiter condition needs to
be different.

if land1 = 'US'.

else land1 = 'UK'.

LAND1 -- country key

EU

SE18 - badi definiation


Se19 - badi implementation
to see the active implementations for specific badi :
SE18 ---- > provide badi defination --> go with menu option enhnacment
implementation --> display

Finding BADIs :

SE24 -- cl_exithandler -- get_instance method put the break point and run then in
EXIT NAME parameter we can see the badi names.

find the package name --


se93 -- provide t code click on display

se84 --- expand the enhancements ---> expand BADI --> provide package name ---

Dynamic Break points :

/h on command prompt before action (based on your requirement)

go with menu option Break points --> break point at -->


break point at method -->
provide class name cl_exithandler
method name get_instance.
Commit work statement in Enhancements :

it will save the changes to data base.

Lets suppoes we have written commit work stament in BADI .after executing my badi
if transction went to dump then till the commit wrk data will be saved into data
base tables.So data in consitencey will come .so we wont write commit work in
enhancment.

Va01 --

A --

Commit work - data base commit

t code dump --

LUW -- logical unit work

SAP LUW
Db LUW - data was successfully

DB luw

BADI --- 1 st
customer exit -- 2nd
implict - 3 rd
explict - 4 th

if sy-uname = 'satishk' or sy-uname = '503103495'.

endif.
enhancment frame work :

Source code enhancemnts:


implicit - we need to be take care it needs not be disturb standrad
functinalities .

SAP has provides some predefined places where we can implement the logic

start of subroutine
end of subroutine
start of function module
end of function module etc.
method starting
method ending

open the include or program name -----


click on enhnace sprial button
go with menu option goto -- > enhancment operations ---> show implicit
enhancaments.

explict -- point ,Section


if we want to insert custom code in the middle of standard code then sap has
provided some plug ins Enhancment-point and enhancement-section these we can call
it as explicit enhancments.

Open the program or include --

click on Global find button --> Enhancment-point or enhnacemnt section

then we can see the list of point and sections.

Enhancment point :

if we wanto execute our custom code along with the satandard we will create
point.it will have mutiple implementations.

satand code + custom code = point

Enhancment section : (Replacmemt of standard code )

if we want to execute only our custom code not the standard code then we will
create section.only one implementations .

only custom code -- section .

ZTest - US company code


ZTest1 - UK company code

click on enhance spairl button -->

place the cursor on enhancment-point or enhancment-section right click --


enhancmenet opertaions --> click on create implementaion.

dyanamic enhacment - code


select * from bseg
into table it_bseg

static enhancment - decalration


it_bseg type table of ty_bseg.

Switch Frame work :

lets suppoes we have implementing GAS and OIL industry solutions if we want to
make invisable repositry objects of GAS to oil and same as to make invisable
repositry objects of OIL to gas.
this kind of scenarios switch frame wrk wil useful.

SFW1 -- WE WILL MAINTAIN THE PACKAGE NAME


SFW2 --- ACTIVation ---- botth static and dyanmic will trigger .

STAND BY ---- only static enhnacment

Lets suupose we have create static and dynamic enhancments . if switch was in
activation mode both static and dynamic will trigger .

if switch was in standard by mode only static enhancaments.

A ---- Gas --- --- need to hide oil related repositry objects

oil --- need to hide gas related repositry objects

Class enhnacments :
if want to add new method to standard class or
adding code to standrad method.

adding code to standrad method.


only redefine methods only we can create below ooptions.

custom first and later standrd - Pre exit


standrd first and custom later - post exit
complte custom - overwritten exit

goto se24 ----


provide class name
go with menu option class ---> enhancment

create implementation .

go with menu option edit --> enhancment opertaions --> insert pre method
insert post method
insert overwriten
delete pre method
delete post method
delete overwrotten method

Function Enhancements

if we want to enhance the standard function modules we can use function


enhancment.

Kernal badi :
Run time -- execution
complie time - syntax check

classical badis implemnetatins will load at the time of run time.

object instantitaion
call method
kernal badis implemenetations will load at the time of complie time.it will be
loaded to sap kernal .

kernal badis are very fast compare with classical badis.

in kernal badis sap has interduce new key words GET badi and Call badi.

get badi will use to creat the object.

call badi will use to call the method.

Fall back class :

in kernal badi if no implementation executed defaulth the logic in fall back class
will be executed .

if any implementation executed it wil not exceute fall back class.

https://blogs.sap.com/2014/03/04/is-kernel-badi-really-faster-than-classic-badi/

SE38 - acces kernal badis

Step1 :

obj rerefce of the type badi defination .

stpe2 :

Create object using key word Get badi .

stpe3 :
call the ,method using key word Call badi.

SE38 : classical badi call

Step1 :

obj rerefce of the type interface of badi defination .

stpe2 :

call the method get_instance of class cl_exithandler

patterns :

stpe3 :
call the ,method using key word Call method.

TRY
catch CX_BADI_NOT_IMPLEMENTED.
get_text method we need to call to display message.

End Try
A - 2 layer value
B - 3 layer value
C - 1 layer value
D - 4 layer value

sequnce of badi implementation :

Classical badi
se18 -- - badi definination --> goto -- sort ----> standard sort - it will ask
work bench request

.
then implementation level automatically layer value will come.

in layer valye will mention numbers .

Kernal badi

BADI_SORTER (Screen ehnacment)------ SORT_IMPLS/ data to sub screen / sub screen to


data method need to write the logic based on layer value.

https://blogs.sap.com/2016/10/02/badisorter-with-kernel-badi-and-other-sorting-
options/

ZCL

get_final

data : <objname > type ref to < class name >.

create object < object name>

data : obj type ref to zcl.

create object obj.

in classical badis we does not have any key words to create object and acces
method.

Sap kernal ---

sap has interduce new key words for kernal badi

Get badi --- creat the object


Call badi ---- to acces the method with refernec to object.

ZCLass - get_mara

call function <fm name > in update task.

commit work

se38 --

data : obj type ref to zclass.

call method obj->get_mara.

Kernal Badi

ztest
ztest1 -

1000

2000

filter dependent badi

A --
zif_interface
get_Data
se_data

A - ztest
zcl_test

A - Zest1
ZCL_test

MMO1 -- selection screen


if plant -- 0001 -- input
Profit center -- 6000 - change

Enhancemnets :

Customer exit
classical Badi

enahncment frame work :


source code enhanmments
a) implicit
b) explicit

Class enhancemnet
function group enhanment
kernal Badis

Validations --

if order qty was more than the ware house qty then system needs to throw
error .order qty was more than the ware house qty .

Values update based on conditons :

when ever creating the sale order based on conditons plant needs to update .

new tabs in standard t codes

adding new tabs in standard t codes .

Va01 ---

1200

1400 --

ATP qty -- Avalibale Promise Qty

Miro -- Invoice create in MM

1000
05

Payment terms --

Custom Tabs

You might also like