bapi的创建方法

上传人:沈*** 文档编号:146928148 上传时间:2022-09-01 格式:DOC 页数:12 大小:525KB
收藏 版权申诉 举报 下载
bapi的创建方法_第1页
第1页 / 共12页
bapi的创建方法_第2页
第2页 / 共12页
bapi的创建方法_第3页
第3页 / 共12页
资源描述:

《bapi的创建方法》由会员分享,可在线阅读,更多相关《bapi的创建方法(12页珍藏版)》请在装配图网上搜索。

1、窗体顶端Implementation Project for New BAPIsThis form will guide you through all the work steps necessary for implementing BAPIs. It also enables you to create a checklist to document the steps as you complete them, thereby providing you with a record of the creation process for your BAPI. Complete this

2、 form for each of your projects. One project may cover either a single BAPI, or several BAPIs within the framework of one scenario. However, there must only be one person responsible for each project. Overview: 1. Project Organization 2. Scenario Analysis 3. BAPI Design 4. Defining BAPI Data Structu

3、res 5. Creating BAPI Function Modules 6. Defining BAPI Methods in the BOR 7. Documenting BAPIs 8. BAPI/ALE Integration - Generating IDocs 9. ToDo Checks and Tests 10. Release Project OrganizationProject namePerson responsible for projectQuality ManagerScenario AnalysisBAPIs are always implemented as

4、 part of an integration scenario. This ensures that the various BAPIs complement each other and provide structured, focused access to SAP functionality. When analyzing the scenario, you must answer the following questions: What requirements need to be met? How can the business process be described i

5、n business terms? (= business process description) How can the business process be described in software terms? (= scenario description) Which business objects are affected? Can you use an existing object model? Which methods (BAPIs) are required? You can find further information in the BAPI Program

6、ming guide under Analysis Name of the ALE integration scenarioObject model exists.The following BOR methods (BAPIs) must be implemented for the scenario:Business ObjectMethod (BAPI)Function moduleBAPI DesignDuring the design phase, you must define the BAPI signature at a conceptual level. Then descr

7、ibe the contents of the BAPI and specify the parameter names and parameter structure. You can find detailed information on the design phase in the BAPI Programming guide under Designing the BAPI. During the design phase, you must bear in mind that there is a series of standard methods and parameters

8、 that provide certain basic functions. If the BAPIs you want to implement and their parameters are included in this category, then you must adhere to the relevant guidelines. You can find an overview in the BAPI Programming guide under Standardized BAPIs and under Standardized Parameter.When you are

9、 working on the implementation of a BAPI, you must consider whether, based on its functionality, it is an instance method or a class method.Instance methods refer to a specific instance of a business object; for example, the SalesOrder.GetDetail BAPI displays the detailed data for precisely one sale

10、s order (which you must specify). Such methods are defined as instance-dependent in the BOR. Class methods do not refer to a specific instance of a business object; for instance, the SalesOrder.GetList BAPI gets a list of all available sales orders that fulfill certain criteria. Class methods includ

11、e standardized create methods. Create methods are used to create new instances; for example, the SalesOrder.Create BAPI creates a new sales order in the SAP System. Such methods are defined as instance-independent in the BOR. You must adhere to the following conventions for BAPI methods:You must est

12、ablish whether you are dealing with an instance method or a class method.The method name must be in English (maximum 30 characters).The individual name components of BAPI names are marked by initial capital letters. Underscores (_) are not permitted in BAPI names. Every BAPI must have a return param

13、eter that is either an export parameter or an export table.Every BAPI must have an ExtensionIn and an ExtensionOut parameter to enable customer enhancements.You can find further information on customer enhancements of BAPIs in the document titled Customer Enhancement and Modification of BAPIs.The fo

14、llowing conventions are valid for parameters:The parameter and field names must be in English (maximum 30 characters).The individual name components of parameter names are marked by initial capital letters to ensure maximum readability.Fields that are ISO-relevant (country, language, quantity, curre

15、ncy) have additional fields for ISO codes.You must include quantity unit fields for all quantity fields, and currency descriptors for all currency amount fields.Defining BAPI Data StructuresYou must now define, in the ABAP Dictionary, all data structures (including domains and data elements) that ar

16、e required for the parameters of the BAPI to be implemented. You can find further information on defining BAPI data structures in the BAPI Programming guide under Actions in the ABAP Dictionary. ABAP Dictionary (SE11) The following conventions are valid in this phase: Conventions for BAPI data struc

17、tures:Each parameter must refer to a data structure in the ABAP Dictionary. For structured parameters, this is always the overall BAPI data structure. However, if the parameter consists of only one field, then it must refer to a field in a BAPI data structure. You must create specific data structure

18、s for BAPIs, which must be independent of the data structures that are used generally in SAP applications. Tool: existing internal structures can be mapped to existing BAPI structures using a module to map fields that is automatically generated by a mapping tool (Transaction BDBS). Mapping Tool All

19、data structure names must begin with BAPI. You must not use APPENDs or INCLUDEs in BAPI data structures. Conventions for field names.Fields in structures must have easily understandable English names that are no longer than 30 characters.Tool: Internally at SAP, you can use the BAPIFELD report to cr

20、eate a list of proposals for English field names for an ABAP Dictionary structure. You can find a description of how to use this report in the report documentation. Report BAPIFELDYou must also create an easily understandable English default name that is no longer than 30 characters for each data el

21、ement. This name then becomes the proposal always given by the BAPIFELD SAP internal report.Tool: The BAPIFELD report shows which data elements still need to be processed. Enter the default field name for the data element in the ABAP Dictionary using Definition ?Default field name. Report BAPIFELDCo

22、nventions for Input HelpIndividual values or a value table may be maintained for a domain, which enables you to use the F4 help. All useful input help (that can be used with the HelpvaluesGetList service BAPI) must be maintained for the data structures/data elements.To do this, you must specify fore

23、ign keys for the fields of a BAPI structure. If a value table has been defined for a field domain, then a foreign key is mandatory. Technical ConventionsInternal data presentation is used for all parameters. Tool: Mapping Tool If both an internal and an external key are stored in the database, then

24、the external key must be used for the BAPI interface. Field that are ISO-relevant (country, language, quantity, currency) have additional fields for ISO codes. All currency fields use the BAPICURR domain. In special cases you can also use the BAPICUREXT domain. You must always use a decimal point. A

25、ll quantity and currency amounts must have the decimal point in the correct place.Reason: BAPIs always have standardized amount representations with decimal points. Therefore you must use function modules BAPI_CURRENCY_CONV_TO_EXTERNAL and BAPI_CURRENCY_CONV_TO_INTERNAL to convert currency amounts.

26、. For quantity fields, the reference field/reference table must be set correctly to the quantity unit field. All data elements for date fields have the format YYYYMMDD. Conventions for BAPI/ALE IntegrationBAPI structure names must not be longer than 27 characters, otherwise the automatically generat

27、ed segment name will be too long and will require manual correction. Individual fields in a data structure have a maximum length of 250 bytes. Conventions for Customer DevelopmentsIBUs, partners and customers must always observe the namespaces defined by SAP when creating data structures (domains or

28、 data elements). Creating BAPI Function ModulesOnce the parameters have been defined, the function module on which the BAPI is based is implemented in the Function Builder (Transaction SE37). Function Builder (SE37) When creating this module, you must observe the following rules:The BAPI is a transa

29、ctional BAPI.For more information see the BAPI Programming guide under Transaction Model for Developing BAPIs.All function modules must correspond to the following naming convention: BAPI_. A maximum of 30 characters is permitted. If you need to, you can use abbreviations that correspond to the abov

30、e convention, as long as the assignment to the business object remains clear.All BAPIs for one SAP business object type should be summarized to a function group. You should only deviate from this rule in exceptional cases.BAPIs for different object types must not be summarized to a function group. I

31、nterface Definition A BAPI parameter must be defined both in the function module and in the method for that business object type in the BOR. The definitions must be identical in both cases, excepting only the key fields of the business object type.You can find further information on interface defini

32、tion in the BAPI Programming guide under Defining the interface.The following conventions are valid for key fields with function module interfaces :For instance methods, all BOR key fields are mandatory import parameters in the function module. BOR key fields cannot be export parameters in the funct

33、ion module. For class methods, BOR key fields cannot be export parameters in the function module (exception: create methods). BOR key fields also cannot exist as import parameters in the function module. For create methods, all BOR key fields for that method are export parameters in the function mod

34、ule. BOR key fields (as for all class methods) cannot be import parameters in the function module. Create methods are defined as instance-independent in the BOR. If key fields occur as parameters in function modules, then you must observe the following conventions:You must use the fully defined key,

35、 not the partial key. Each key for the business object type has its own parameter in the function module. The function module parameter and the BOR key field have the same name. (Underscores (_) are not allowed in the parametername in the Functuin Builder.)You must also observe the following convent

36、ions for function module interfaces:In the Function Builder only capitalization is used. Because of this underscores (_) are allowed and recommended in order to mark the individual name components of parametername. (Example: ExtensionIn, in the Function Builder: EXTENSION_IN). You must use the BAPIP

37、AREX structure for parameters ExtensionIn and ExtensionOut. You must base the return parameter on structure BAPIRET2. The function module must be RFC-capable. Implementing the Function Module The most important BAPI-specific requirements for function module coding are as follows: A BAPI must not exe

38、cute a COMMIT-WORK command.The database can only be changed by updating. A BAPI cannot display anything on the screen, that is, it cannot create lists, queries or dialog boxes.This is valid not just for the BAPI itself, but also for all function modules called indirectly from the BAPI. You cannot us

39、e exceptions in a BAPI.Instead, all error messages are returned to the calling program using the standardized parameter Return. A BAPI itself cannot cause program termination, it can only return the corresponding message (message type A, termination message) in the return parameter. You must provide

40、 customer exits to enable customer enhancements of BAPIs.You can find further information on customer enhancements of BAPIs in the document titled Customer Enhancement and Modification to BAPIs. You can find a comprehensive overview of all requirements that you must meet in the BAPI Programming guid

41、e under Implementing the Function Module.Defining BAPI Methods in the BOROnce the implementation of the function module is complete, you must define the BAPI as a business object method. This not only enables central storage in the Business Object Repository (BOR), but also object-oriented access to

42、 the BAPI and the option to link to the ALE distribution model (for ansychronous BAPIs). BOR (SWO1)Use the BOR/BAPI Wizard to implement the BAPI as a method in the BOR. This automatically generates the BOR method from the function module. In the BOR, first choose the change mode for the object you a

43、re working on and then the menu path: Utilities ?/font API methods ?/font Add methodFollow the steps in the wizard. You will have to complete a few additional tasks in the wizard. Note the following points in particular: Initial capital letter for each word.Ensure that the import and export behavior

44、 of the table parameters is correctly maintained in the BOR.Reason: Unlike function modules, in the BOR you can differentiate between import and export for tables. You should only choose Import/Export if the table has actually been imported or exported. The return parameter must always be defined as

45、 export. Apart from simplifying the tasks, the wizard also ensures that the BAPI interface is identical in both the BOR and the function module. This is particularly important for the following aspects:For every function module parameter there is a BOR parameter (or a key field) with the same name (

46、and vice versa). These two parameters refer to the same ABAP Dictionary structure. These two parameters have the same characteristics (mandatory or optional, import, export or table parameters). Note: If you cannot use the BOR/BAPI wizard (for example, if you are changing the BAPI at a later date or

47、 redefining a method), work on the method in the BOR itself. If you are doing this, you must take particular care to observe the points listed above. BOR (SWO1)IBUs, customers and partners must also observe the following additional points:You must read the document titled Customer Enhancement and Mo

48、dification to BAPIs. As a customer you can create your own BAPIs for your own business object types, or you can define a subtype for an existing SAP business object type. You must not define new BAPIs for SAP business object types, since this constitutes a modification.See Customer Enhancement and M

49、odification to BAPIs for details. You must create all development objects (business object types, BAPIs and parameters) in your own namespace. Documenting BAPIsFor the BAPI to be used correctly (particularly by users outside the SAP System) you must provide all relevant information in the documentat

50、ion. BAPI documentation is automatically transferred from the function module documentation. Create comprehensive raw documentation for each BAPI and each parameter in the Function Builder (SE37). This will then be processed by the documentation developers. You can find further information on BAPI d

51、ocumentation in the BAPI Programming guide under BAPI Documentation. All BAPIs and all parameters are fully documented.The return parameter documentation contains all relevant error messages. The documentation developer then saves the active version of the function module and parameter documentation

52、 (otherwise the documentation cannot be translated).The business objects have been documented in the BOR. BAPI/ALE Integration - Generating IDocsBAPIs are integrated into the ALE distribution model. ALE distribution is asynchronous and based on messages. ALE distribution is the preferred means of in

53、tegration for distributed SAP Systems, for instance, for distributing master data. As of Release 4.0, BAPIs are the standardized interfaces for ALE-supported distribution. ALE services, such as asynchronous calls, use of the distribution model, monitoring and error processing, can all be used for BA

54、PIs. The IDocs required for ALE services can be generated from the BAPIs.Message types are created and IDocs are generated for all write BAPIs. Generate ALE Interface for BAPI (BDBG) All IDocs are released.Releasing IDocs is currently linked to authorizations. The BAPI interface and the IDoc interfa

55、ce are identical. Ensure that, when you have changed a BAPI, the message type, the IDoc type and the segments are regenerated. You can find further information in the document titled Using ALE-Services. ToDo Checks and TestsYou must run special tests and carry out ToDo checks in order to ensure that

56、 the BAPIs, the business object types and the documentation are correct. You can find further information on the test phase in the BAPI Programing guide under Testing and Releasing. A ToDo check has been carried out for the BAPIs and no messages with priority 1 or 2 were displayed.he single test and

57、 the integration test were successful.The documentation has been checked for completeness and clarity.ReleaseOnce all the tests have been completed successfully, the BAPIs and all related development objects must be released in order for them to be available to the customer. This can happen once the

58、 following conditions have been met:All required documentation has been created.No consistency errors were found.You must carry out the following steps when releasing a BAPI:Release the BAPI function module (in the Function Builder).Release the business object type (in the BOR).Release the BAPI as a method in the BOR. For potential write BAPIs: Release the IDoc and its segments.窗体底端

展开阅读全文
温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!