View sap enhancements

Source: Internet
Author: User
From: http://hi.baidu.com/%B7%EF%CE%E8%C3%F4%D0%C4/blog/item/aa4d73f2c04ae158342acc40.html Tips Perspective ERP Enhanced (1) What is enhancement )?Simply put, enhancement is the exit of the standard program in the ERP system. In this exit, users write custom logic code according to the actual needs of the enterprise. Enhancement is an ERP system design. Considering that the actual process of the enterprise may be different from the default standard process of the system, an interface is specially reserved under the standard process framework. Each interface corresponds to a custom function, these export functions have parameters and output parameters passed in by the standard processing program. You can write the logic suitable for the enterprise process based on the system input parameters, and then transmit the output parameters back. (2) Enhanced User ClassificationSAP User enhancements generally include the following three categories. 1. E Class: Enhancement exits, which is usually called the user_exit user exit ). Use tcode: se37 to search for exit *. Most of the functions found are system-reserved exit functions. As mentioned earlier, user exit is the interface left by the standard program to users, standard programs generally do not allow users to modify them at will. If you need to apply for an access key and modify the standard program, the ERP company is generally not responsible for errors. In SAP, a custom program usually starts with a reserved word Y or Z. Therefore, the exit function contains a program starting with Z. 2. c Class: Gui Codes) 3. s Class: Screen exit. For example, screen enhancement is reserved for the system when you create a purchase order, ticket, or fixed asset master data, that is to say, you can customize the user input interface and write corresponding Input and Output Processing programs. In various enhancements, users may also define their own structures or tables, and the corresponding types of the system T Class. For example, the mm06e005 enhancement allows users to establish two structures: ci_ekkodb and ci_ekpodb. Next, we will focus on the application of function export. (3) Organizational user Enhancement Related enhancement tables: Modsap:Enhanced table Tfdir: All function tables including exit functions (Class E) Cuatexts: Modify the gvi interface. Interface: menu text is customer (Class C)
Tsdir: Call customer subscreen (S Class) in the dynamic program area) * For Exit function starting with, TFDIR-MAND The value is C. Indicates that the exit function is activated. Related enhancement check functions:Modx_function_active_check: Check whether the e-class user exit is activated. Modx_menuentry_active_check: Check the C-class enhanced activation status modx_subscreen_active_check: Check the S-class enhanced activation status. You may find that any transaction code (tcode) of each sap Module) the corresponding standard program leaves a large number of user exits. It is sap's flexible configuration functions and powerful user exits that make it possible for its products to easily respond to various complex needs, the system also makes effective organization for quickly finding and activating these enhancements. Various enhancements are recorded in the table and related check functions are provided to facilitate enterprise users. Friends familiar with ABAP development usually collect a program that can input the transaction code to quickly find all the exits left by the system. The following table is a simple reference program for detecting system enhancement activation.

* This program can detect all activated user enhancements in the system. * By stone Fu. on 2006/11/07. * used to find out all the activated user-exit of SAP. report zfindactexit. tables: modsap, tfdir. data: Begin of itab_exit occurs 0, funcname like tfdir-funcname, Mand like tfdir-Mand, name like modsap-name, end of itab_exit. data: field1 (30 ). _ select ~ Funcname ~ Mand B ~ Nameinto table itab_exitfrom tfdir as a inner join modsap as B on ~ Funcname = B ~ Memberwhere ~ Mand = 'C' and ~ Funcname = B ~ Member. format color col_heading intensified on. write:/1 sy-vline, 2 'enhancement name', 21 sy-vline, 22 'activated exit function', 95 sy-vline.write:/(95) sy-uline.loop at itab_exit.format color col_normal intensified off. write:/1 sy-vline, 2 itab_exit-name hotspot on, 21 sy-vline, 22 itab_exit-funcname, 95 sy-vline.endloop.at line-selection.get cursor field field1.set parameter ID 'mon' field sy-lisel + 1 (10 ). call transaction 'smod and skip first screen.
There is a direct and effective search User exitThe enhancement method is to use the modx_function_active_check function, as shown in figure Figure 1. Figure 1If tfdir-Mand = aktiv_flag (constant C) in, the exit function active flag = 'x', indicating that the user exit is activated and the processing logic will be transferred from the standard program to the exit function, when a breakpoint is set in the statement and any transaction code is run, the function is called to determine whether a user exit exists. ( 4) Enhance Application Instances Business background: If the purchase order has been verified, you are no longer allowed to change the price. Related procedures: mm06efpo_pot_fuellen | mm06ef0c_custscr1_item_set_dat Related tcode: smod | cmodIf the Procurement approval function is not enabled, the SAP standard function allows users to modify the purchase price at any time. Different enterprises have different policies for controlling the purchase price, enterprise A is relatively small and may open a large purchase order for procurement in the next few months in order to save trouble. If the material price changes in the middle of the process, you can directly modify the price. Group B strictly controls the purchase price, procurement prices are centrally maintained by the headquarters, and purchasers of various enterprises only need to maintain the procurement quantity and other information. In this case, the ERP system obviously does not prohibit users from modifying the price. If the enterprise does need this, this can be implemented through enhancement. We have already introduced how to set the user exit reserved for each transaction in the breakpoint Tracking System by Using the modx_function_active_check function. You will soon find the enhancement Mm06e005Of Exit_sapmm06e_017 User exitThis is ideal for your business background. First, let's take a look at the enhanced Exit_sapmm06e_017 User exit ( Hereinafter referred to as 017 Exit)Processing Process: The include program mm06efpo_pot_fuellen is specially used to process the enhancement exit. The subroutine custscr1_item_set_data_pai ( Corresponding to the next-level include Program mm06ef0c_custscr1_item_set_dat), Analyze the code of the include program mm06ef0c_custscr1_item_set_dat, as shown in the following table. This program was originally copied from the system. Pay attention to the notes I have added. Bold part:

* ----------------------------------------------------------------------- * User-exit für positionsfelder versorgen (PAI) FormCustscr1_item_set_data_paiUsing im_no_screen like fc_call. "770427 data: l_ucomm like sy-ucomm, l_enj_call type C. statics: first_call (1) Type C value 'x', active like sy-calld.ENHANCEMENT-POINT custscr1_item_set_data_1__02 spots es_mm06ef0c_custscr1_ I _set_dat include bound. * $-start: custscr1_item_set_data_1__02 seconds $ * enhancement 1 oi0_common_mm06ef0c_item_s_dat. "Active version * c5030897 I. twardowski Implementation of Badi for ogsdperform oi0_badiscr1_item_set_data_assist.endenhancement. * $-end: custscr1_item_set_data_pai_02 ------------------------------------------------------- $ * if not first_call is initial. clear first_call.*Note: modx_function_active_checkUsed to check 017Whether the exit is activated,Executed if activated.Call function 'modx _ function_active_check 'exporting cprogname = 'sapmm06e' funcnumber = '017' importing active = active exceptions not_found = 1 Others = 2. if not sy-subrc is initial. clear active. endif. endif. check not active is initial. if fc_vorga EQ cva_en. rochelle enj_call = 'x '. else. rochelle enj_call = space. endif.*-Define data:Data: lt_usr_tekpo like bekpo occurs 0, lt_usr_teket like beket occurs 0, lt_usr_tekkn like ekknu occurs 0, lt_usr_tkomv like tkomv occurs 0.*-Copy tables:Lt_usr_tekpo [] = pot []. lt_usr_teket [] = ETT []. lt_usr_tekkn [] = Knt []. lt_usr_tkomv [] = tkomv []. l_ucomm = OK-code.*Note:The general step of calling the exit is to first define the data (define data ),Mostly internal tables or work areas,Then, assign the parameter to these internal tables (copy tables ),Equivalent *Creates a mirror of the original parameter.*-User Exit:*IfExecute exit enhancement if it is activated.Call function 'exit _ authorization' exporting I _ekpo = Ekpo region = * Ekpo I _ekko = Ekko region = aktyp region = Ekko-bstyp region = im_no_screen "770427 region = lfa1 I _lfm1 = lfm1 Limit = rekpo protocol = kekpo protocol = aekpo I _reban = reban protocol = mt06e I _eina = * eina I _eine = * eine protocol = komp I _ucomm = l_ucomm protocol = export tables tekpo = export teket = export tekkn = lt_usr_tkomv exceptions others = 0. endform. "custscr1_item_set_data_pai
The above program code is very simple. I believe that smart readers will begin to understand the ERP enhancement design ideas. Now you can easily understand, Enhancement is ERP Designers set some suitable game rules at the right location and provide meaningful games for users to play on their own!Happy, happy with others, happy? You should leave something fun for the user. Next, write the enhancement program. You can use tcode: smod to directly activate the enhancement or cmod to create a project that contains one or more enhancements, such Figure 2, Input Enhancement Mm06e005And activate it, and then Exit_sapmm06e_017Write code in the exit function. In Figure 2, We found enhancements Mm06e005Including user exit and screen exit, screen enhancement allows users to customize the user interface in the purchase order, so that the purchase order contains more enterprise custom information, this kind of screen enhancement has been used to its full potential in the fixed assets module. Exit_sapmm06e_017Inclusion Program Zxm06u42, Program Zxm06u42The sample code is shown in the following table. The logic of this custom code is very simple. For convenience, I have commented out the input parameters of the export function. There is no output parameter for this export function, that is, you can only judge based on input parameters, but cannot change any data:

* Enhanced zxm06u42 sample code * by stone. Fu 2007/01/02 * "*" lokale schnittstelle:* Importing/TablesIs a single input parameter and an inner table parameter.* "Importing *" value (I _ekpo) Like Ekpo structure Ekpo * "value (I _aktyp) *" value (I _bstyp) Like EKKO-BSTYP * "value (I _no_screen) *" value (I _lfa1) like lfa1 structure lfa1 * "value (I _lfm1) Like lfm1 structure lfm1 *" value (I _ekko) Like Ekko structure Ekko * "value (I _rekpo) like Ekpo structure Ekpo optional * "value (I _kekpo) Like Ekpo structure Ekpo optional *" value (I _aekpo) Like Ekpo structure Ekpo optional * "value (I _reban) like Eban structure Eban optional * "value (I _mt06e) Like mt06e structure mt06e optional *" value (I _eina) Like eina structure eina optional * "value (I _eine) like eine structure eine optional * "value (I _ekpo_old) Like Ekpo structure Ekpo optional *" value (I _komp) Like komp structure komp optional * "value (I _ucomm) like SY-UCOMM optional * "value (I _enj_call) optional *" tables * "tekpo structure bekpo optional *" teket structure beket optional * "tekkn structure ekknu optional *" tkomv structure komv optional *"----------------------------------------------------------------------*The program code is as follows:Data zwatekpo like bekpo. Tables ekbe.*Input inner table parameter tekpoRecord all original and old data of the purchase order.*Input I _ekpoThe parameter indicates the currently processed Po.The row project contains the latest update data of the procurement line project.Read Table tekpo into zwatekpo with key ebelp = I _EKPO-EBELP.***Only for me21n/22/23.Check the SY-TCODE = 'me22n' or SY-TCODE = 'me22n' or SY-TCODE = 'me23n '.* ** EkbeYes Po historyTable,Q, RIndicates the invoice verification history,Price Change not allowed ##Select single _ * From ekbe where ebeln = I _EKPO-EBELN and ebelp = I _EKPO-EBELP and (bewtp = 'q' or bewtp = 'R ').*If SY-SUBRC = 0Indicates that the invoice has been verified and the price cannot be changed.Check SY-SUBRC = 0.*Determine whether the unit price of the project in the new purchase line is consistent with the unit price of the project in the original row read from the database after the data is changed.If the I _EKPO-NETPR <> ZWATEKPO-NETPR. Message e001 (00)'The purchase order line project has been checked for invoices, and the price cannot be modified.Endif.
If you are familiar with the enhancement, you will find that some user exits will pass in the old data and the new data to facilitate the comparison between the two, and the replacement of the financial module ( Substitution) Different, ERP systems generally have a strict attitude towards enhancing retention, which is generally only allowed at the exit. CheckWork, this is similar to the inspection of the financial module ( Validation). ( 5) further analysis and EnhancementOne of the purposes of implementing ERP in an enterprise is to share information among various departments to avoid data islands. The purpose is to take a simple purchase and receipt as an example. As long as the warehouse personnel enter the purchase order number and receipt date when receiving the goods, the system will automatically generate data of each module for the number and position of materials received. For financial data, the system will find the factory in the main data of the purchase order based on the entered PO number, find the corresponding company code through the ing between the factory and company code set in the organizational structure; find the corresponding subject through the valuation class of the shipping material and the shipping mobile type, obtain the inventory amount of this item through the receipt quantity * purchase unit price, and obtain the business scope and profit center through the main material data, so that the financial credential data is automatically collected; if there is a purchase difference at the standard price of the material and the Model Recognition cost object of the different subject is mapped to the profit analysis segment, the data will be written into the profit analysis module. What I want to say is, behind these complex logics, any module's collection process has validation, and any validation failure ERP system will stop the business transaction, for example, the validation receipt date is not within the range allowed during the material or accounting period, if the verification fails, an error is reported to the user. For example, the corresponding error cannot be found in the budget module. The Fund Center prompts that the transaction is aborted incorrectly. When all the verification is completed, the system will commit the data to the database. These verification are system-standard, and the enhancement is reserved by the system for users, as with system verification, this business transaction will be stopped if an error occurs in any module enhancement. In Figure 3Keyword such as check/substitution/enhancement/Field Movement/derivation. In fact, these items can be seen as system enhancement, that is, using custom code to enhance the standard function. Interestingly, SAP's various enhanced code compilation methods are extremely simple, for example, check/replace/Field Movement/derivation users, or even drag and drop the corresponding source and target fields to associate them. The code is automatically generated, even coding is simple. What's amazing is that as an SAP consultant, you can even have no idea about programming and databases. In fact, most sap consultants do. You only need to focus on business blueprint implementation, this point is worth studying in China's management software design counterparts. In the management software design process, the details also determine the success or failure. New Generation enhanced badi (tcode: se17 | se18)Badi (Business add-in) is a new concept of function enhancement. It uses object-oriented concepts such as classes, interfaces, and methods, use an object-oriented method for SAP Enhancement

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.