04-07-2010 10:33 AM
Hi,
I want to modify standard program in 3 different part through enhancement framework.
Is I ave to create 3 different enhancement implementation or i can use only one?.
Regards,
Himanshu
04-07-2010 12:58 PM
Could you please share the detailed requirements?
If the codes need to be implemented for certain conditions, you can implement the codes under different conditions in a single enhancement implementation.
04-07-2010 1:08 PM
Hi,
Below is given code which i have added in copy of stranded program at diff. code ares and its running fine.
Now i want to write in stranded code through enhancement framework.
I dont think we can write it in 1 place.? what you say.
Internal tables
******Added By Himanshu*****
BDMNG LIKE RESB-BDMNG,
******Himanshu*****
***Himanshu modification*****
DATA: BEGIN OF xtab1 OCCURS 10, "Tabelle der Reservierungen
werks LIKE resb-werks,
lgort LIKE resb-lgort,
charg LIKE resb-charg,
matnr LIKE resb-matnr,
bdmng LIKE resb-bdmng,
bdmns LIKE resb-bdmng,
erfme LIKE resb-erfme, "ALRK014884 SW
erfmg LIKE resb-erfmg, "ALRK014884 SW
END OF xtab1.
DATA: kzwso LIKE mara-kzwsm,
ytab1 like xtab1 occurs 0 with header line.
RANGES: xbdart FOR resb-bdart,
MS_WERKS FOR MARC-WERKS.
REFRESH XBDART.
CLEAR XBDART.
XBDART-SIGN = 'I'.
XBDART-OPTION = 'EQ'.
XBDART-LOW = 'AR' .
APPEND XBDART.
XBDART-LOW = 'MR' .
APPEND XBDART.
REFRESH MS_WERKS.
CLEAR MS_WERKS.
XBDART-SIGN = 'I'.
XBDART-OPTION = 'EQ'.
XBDART-LOW = 1010.
APPEND XBDART.
end Himanshu********
FORM data_selection.
****Himanshu*****
data : begin of it_mat occurs 0,
matnr like mara-matnr,
end of it_mat.
select matnr into corresponding fields of table it_mat
from mara
where matnr in matnr.
CLEAR: XTAB1 . REFRESH XTAB1 .
loop at it_mat .
CALL FUNCTION 'MB_ADD_RESERVATION_QUANTITIES'
EXPORTING
X_MATNR = it_mat-matnr
X_XLOEK = SPACE
X_KZEAR = SPACE
X_KZWSO = KZWSO "ALRK014884 SW
TABLES
XTAB1 = XTAB1
XWERKS = MS_WERKS
XBDART = XBDART.
ytab1 = xtab1.
append ytab1.
endloop.
****end himanshu*****
FORM fieldcatalog.
*****Himanshu Modification******
loop at ytab1.
read table bestand with key matnr = ytab1-matnr.
if sy-subrc = 0.
bestand-bdmng = ytab1-bdmng.
MODIFY TABLE bestand .
endif.
endloop.
******end Himanshu *******
*****Himanshu Modification******
CLEAR fieldcat.
fieldcat-fieldname = 'BDMNG'.
fieldcat-tabname = 'BESTAND'.
fieldcat-ref_tabname = 'YTAB1'.
FIELDCAT-SELTEXT_S = 'Reserved'.
fieldcat-outputlen = 8.
APPEND fieldcat.
*****end Himanshu******
04-07-2010 1:12 PM
Hi,
i have added cod in seven different places in copy of my standard program. In that case i have to create seven enhancement implementation to modify stranded program.is I am correct?
Regards,
Ranu
04-08-2010 8:44 AM
Hi,
There will be some implicit enhancement points already available in your standard program. Please check whether all your code can be accomodated in the implicit enhancement points provided already.
You can find the implicit enhancements
At the end of all the programs (Includes, Reports, Function pool, Module pool, etc.), after the last statement
At the beginning and end of all FORM subroutines
At the end of all Function Modules
At the end of all visibility areas (public, protected and private) of local class
To view all the implicit options available in a source code, choose u2018Edit -> Enhancement Operations -> Show Implicit Enhancement Optionsu2019 from the editor. You can right click on the enhancement point and create an implementation directly.
If your code can't be accomodated in the enhancement points defined, you can create explicit enhancements.
Please check the Wiki for explicit enhancement creation
http://wiki.sdn.sap.com/wiki/display/ABAP/How%2bto%2bdo%2bExplicit%2bEnhancement