bapi的创建方法_第1页
bapi的创建方法_第2页
bapi的创建方法_第3页
bapi的创建方法_第4页
bapi的创建方法_第5页
已阅读5页,还剩7页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

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.  complet

2、e this 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

3、data structures 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 manager scenario analysisbapis a

4、re always implemented as 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? 

5、· how can the business process be described in 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?  ·

6、 which methods (bapis) are required? you can find further information in the bapi programming 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 modul

7、e bapi designduring the design phase, you must define the bapi signature at a conceptual level. then describe 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 'designin

8、g the bapi'. during the design phase, you must bear in mind that there is a series of standard methods and parameters 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

9、can find an overview in the bapi programming guide under 'standardized  bapis' and under 'standardized parameter'.when you are 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 meth

10、ods refer to a specific instance of a business object; for example, the salesorder.getdetail  bapi displays the detailed data for precisely one sales order (which you must specify). such methods are defined as instance-dependent in the bor.  class methods do not refer to a specific instanc

11、e of a business object; for instance, the salesorder.getlist bapi gets a list of all available sales orders that fulfill certain criteria. class methods include standardized create methods. create methods are used to create new instances; for example, the salesorder.create bapi creates a new sales o

12、rder 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 establish whether you are dealing with an instance method or a class method.the method name must be in english (maximum 30 characters).the

13、 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 parameter that is either an export parameter or an export table.every bapi must have an extensionin and an extensionout paramete

14、r 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 following conventions are valid for parameters:the parameter and field names must be in english (maximum 30 charact

15、ers).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, currency) have additional fields for iso codes.you must include quantity unit fields for all quantity fields, and curr

16、ency 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 are required for the parameters of the bapi to be implemented. you can find further information on defining b

17、api 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 structures:each parameter must refer to a data structure in the abap dictionary. for structured

18、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 structures for bapis, which must be independent of the data structures that are used generally in sa

19、p 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 data structure names must begin with < namespace > bapi. you must not use appends or

20、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 create a list of proposals for english field names for an abap dictionary

21、 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 element. this name then becomes the proposal always given by the bapifeld

22、 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 bapifeldconventions for input helpindividual values or a value table may be maint

23、ained 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 foreign keys for the fields of a bapi structure. if a value table has been

24、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 the external key must be used for the bapi interface. field that are is

25、o-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. all quantity and currency amounts must have the decimal point in the cor

26、rect 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. . for quantity fields, the reference field/reference table must be set

27、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 generated segment name will be too long and will require manual correction. in

28、dividual 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 data elements).  creating bapi function modulesonce the parameter

29、s 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 transactional bapi.for more information see the bapi programming

30、guide under 'transaction model for developing bapis'.all function modules must correspond to the following naming convention: bapi_<business-object>_<method>. a maximum of 30 characters is permitted. if you need to, you can use abbreviations that correspond to the above conventio

31、n, 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. interface de

32、finition 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 definition in the

33、 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 functi

34、on 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 modu

35、le. 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,

36、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 param

37、etername in the functuin builder.)you must also observe the following conventions 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 parameterna

38、me. (example: extensionin, in the function builder: extension_in). you must use the bapiparex 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

39、bapi-specific requirements for function module coding are as follows: a bapi must not execute 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 th

40、e bapi itself, but also for all function modules called indirectly from the bapi. you cannot use 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 corres

41、ponding message (message type a, termination message) in the return parameter. you must provide 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'.

42、you can find a comprehensive overview of all requirements that you must meet in the  bapi programming guide 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

43、object method. this not only enables central storage in the business object repository (bor), but also object-oriented access to 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. thi

44、s automatically generates the bor method from the function module. in the bor, first choose the change mode for the object you are 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

45、 tasks in the wizard. note the following points in particular: initial capital letter for each word.ensure that the import and export behavior 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 ta

46、bles. you should only choose import/export if the table has actually been imported or exported. the return parameter must always be defined as 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 parti

47、cularly important for the following aspects:for every function module parameter there is a bor parameter (or a key field) with the same name (and vice versa). these two parameters refer to the same abap dictionary structure. these two parameters have the same characteristics (mandatory or optional,

48、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 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 (swo

49、1)ibus, customers and partners must also observe the following additional points:you must read the document titled 'customer enhancement and modification 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

50、 business object type. you must not define new bapis for sap business object types, since this constitutes a modification.see 'customer enhancement and modification to bapis' for details. you must create all development objects (business object types, bapis and parameters) in your own namesp

51、ace.  documenting bapisfor the bapi  to be used correctly (particularly by users outside the sap system) you must provide all relevant information in the documentation.  bapi documentation is automatically transferred from the function module documentation. create comprehensive raw do

52、cumentation 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 documentation in the bapi programming guide under 'bapi documentation'. all bapis and all parameters are fully do

53、cumented.the return parameter documentation contains all relevant error messages. the documentation developer then saves the active version of the function module and parameter documentation (otherwise the documentation cannot be translated).the business objects have been documented in the bor. 

54、0;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 integration for distributed sap systems, for instance, for distributing master data. as of release 4.0, bapis are the standa

温馨提示

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

评论

0/150

提交评论