Bapi programming guide pdf




















They enable specific instances of an object type to be copied to one or more different systems. They should be implemented the same in all BAPIs. Specific reference structures are defined for address parameters in BAPIs. You should copy these structures to use in your BAPI, especially if the underlying object type uses the central address management CAM. For more information see Address Parameters. In BAPIs that cause database changes for example, Change and Create BAPIs you must be able to distinguish between parameter fields that contain modified values and parameter fields that have not been modified.

For more information see Change Parameters. Each BAPI must have an export return parameter for returning messages to the calling application. To provide application programmers with a consistent error handling process for BAPI calls, all return parameters must be implemented in the same, standardized way.

For further information see Return Parameters. Standardized selection parameters are used in BAPIs that can be used to search for specific instances of a business object type e. These parameters enable the BAPI caller to specify the relevant selection criteria. For more information see Selection Parameters. The parameter TestRun is used in write BAPIs Create and Change , to check the entries for the object instance in the database before actually creating the object instance.

The creation of the object instance is only simulated and data is not updated. For further information see Test Run Parameters. To transfer BAPI documentation texts e. For more information see Text Transfer Parameters. The inbound interface should be clearly structured and intuitive. Example: Structured parameters should be structured so that they contain all the fields required for the simplest application in one logical block.

Additional fields required for special cases should be grouped by application and attached to the "main block". The interface must not contain any fields that external users would not be able to interpret. You should check whether scalar parameters might be used in the future as more complex selection parameters for example in the definition of ranges. To avoid later changes to the interface, which may be incompatible, parameters should be created as "optional" wherever possible.

Whenever possible, search help F4 help should be provided for parameters and parameter fields. This enables the client to easily determine all the possible input values for a field by calling the BAPI Helpvalues. GetList method.

If you call the Helpvalues. GetList method, the system finds all existing airline IDs. Dependencies between data fields and between parameters must be included in the documentation.

All the information supplied with a BAPI should be able to be used easily without having to change any of the data. So export structures should be able to be reused as the input of a different BAPI. If there are several texts for one key field, these texts must be stored in a separate table. The following documentation provides an overview of the implementation process and the relevant components and tools for the BAPIs are introduced. Each work step is then described in detail.

These function modules are created and described in the Function Builder. Implementing the Function Module in the Function Builder 3. All three phases have accompanying documentation that is created in the corresponding tools. These data structures are required for the parameters of the BAPI to be implemented.

In the case of structured parameters this is always to the whole BAPI data structure. But if the parameter consists of only one field, it must refer to a field in a BAPI structure. You have to create separate data structures for BAPIs that are independent of the data structures generally used in the SAP application. Existing internal structures can be mapped to existing BAPI structures with a field mapping function module that is automatically generated by a mapping tool transaction BDBS.

Always try to use existing central data elements and domains for fields. GetDetail shows how data structures should be defined. The fields in structures must have meaningful English names with a maximum of 30 characters. Refer to the report documentation to find out how to use the report. A meaningful English default field name with a maximum of 30 characters should be defined for each data element.

You may have to define single values or a value table for the domain so that F4 help is available for use. To do this a foreign key must be specified in the fields of a BAPI structure.

If a search help has been defined in a field domain, a foreign key must also be defined. The internal data format is used for all parameter fields. If an external key as well as an internal key has been defined in the database, the external key must always be used in the BAPI interface. For fields relevant for ISO country, language, unit of measure, currency , additional fields for ISO codes are provided.

Always try to use the standard domains listed below for fields. We recommend that you use your own data elements for the fields. If it does not make sense to use your own data elements, use the standard data elements that are listed below. You must always use a period for the decimal point.

All currency amounts and units of measure must have the decimal point in the correct place. BAPI structure names must not be longer than 27 characters, otherwise the automatically generated name for the associated segment will be too long and will have to be changed manually later.

If IBUs, partners and customers are creating data structures domains or data elements , the Namespaces provided by SAP must be complied with. Make sure that SAP internal namespaces are consistent, too. This means that if a namespace is used for the whole application, the BAPIs must use the same namespace. A maximum of 30 characters is allowed.

If required, you can abbreviate the name but still following the above convention. You must still be able to recognize the business object type assignment. Method name: FlightBooking. You should only deviate from this rule in exceptional cases.

You have to perform some additional tasks in this procedure. Keep in mind the following points:. The import and export behavior of the table parameters must be correctly defined in the BOR. Reason : Unlike the function module, in the BOR you can differentiate between import and export tables.

In particular this concerns the following points:. Make sure that the above points are complied with. For developments undertaken by IBUs, customers and partners the additional points below are important:. As a customer you can create your own BAPIs for your own business object types or you can define a subtype of an existing SAP business object type.

All development objects business object types, BAPIs, parameters have to be created in their own namespace. However, there are constraints when you create a technical name for a business object since it may contain a maximum of 10 characters only.

The documentation must be in sufficient detail so that an external developer familiar with the business background but not with the SAP System, can use the BAPI. Are there any important limitations, that is, are there functions that this BAPI cannot perform?

What must you pay particular attention to with this BAPI? Which fields of a parameter must be filled, that is, what are the mandatory fields? What are the dependencies between fields?

Are there parameter dependencies and field dependencies within a structure? What are the default values of the parameter? All the fields that are assigned default values by Customizing and are therefore write-protected, must be documented.

Does the documentation of the return parameter comply with the guidelines and does it contain all the relevant error messages? If there is a termination, is a database rollback executed as an exception within the BAPI? If it is, you must describe this process in the documentation for the return parameter. Finally, you must also make sure that the documentation about the function modules and parameters has been saved by the documentation developer as an active version so that it appears in the translator's worklist.

ALE communication is asynchronous and message-based. ALE communication is the preferred way to integrate distributed SAP Systems, for example, for distributing master data. Since Release 4. You can use Transaction BDBG to create the other objects required for the asynchronous communication message type, IDoc type, inbound and outbound function module. A BAPI should only be implemented as an asynchronous interface, if at least of the following conditions is satisfied:.

If the connection is interrupted the client system would not be able to function properly. In this situation a synchronous interface cannot be used because performance would be too low. All BAPI export parameters with the exception of the return parameter are ignored and are not included in the IDoc type that is generated. To do this, the data structures that the BAPI uses including the data elements and domains , and the ALE interface have to move to the application basis.

If the applications have restricted usability, you have to explicitly release the BAPI function module for cross-application use. Testing and Releasing To check that the BAPIs, business object types and documentation are all correct, special tests and ToDo checks must be carried out.

Once the test phase has been successfully completed, the business object type, BOR methods and function modules can be released. Carry out the test together with the persons responsible for quality control in your development group. Check that the documentation for each business object type, each BAPI and for each interface parameter is available and that you understand it. In the test phase you must check that the BAPI meets all the conventions described above, and that you have followed the guidelines for developing BAPIs.

After you have checked that the syntax is correct, you have to check that the semantics of the BAPI are correct testing the functions and integrity. You have the following options:. You can test the parameters in your function module in one test. Enter the appropriate test values in the parameters to verify that the source code in the function module can run without errors. So, for example, no regression tests can be carried out. Tests with the CATT should be carried out in preference to tests in the Function Builder because the test runs are retained and can be optimally integrated into the SAP quality assurance process.

This should be checked using appropriate tests from the Middleware departments. For an example of mapping, see Application Example. Like currency amount fields, the decimal point in quantity fields and unit of measurement fields must be converted correctly.

A field to indicate the amount or the unit of measure must be assigned to all amount and quantity fields. In some situations an internal technical key is maintained in the database alongside the external key. Examples are work breakdown structure plans or networks in project systems.

These conversion transactions are not included in the transactions described in the section Converting Between Internal and External Data Formats. Always try to use the standard domains listed below for fields. We recommend that you use your own data elements for the fields. If it does not make sense to use your own data elements, use the standard data elements that are listed below.

Reason: If standard domains are used, the generated mapping modules automatically convert the ISO code. If you use other domains, you have to manually convert the ISO code in the module modules. Click on Yes. Step Now save after you add the method. Step The below shown screen will be displayed. Click on yes. The message shows, The object type status set to modeled. There would be two pop ups coming up. Click continue on the Pop Ups.

Step Keep the cursor on the 'Method'. Shown as below. Now we are done with the creation of a BAPI. Find your BAPI as shown. Step The below screen is displayed. Step The below screen will be displayed where you would require entering the data against the empty input fields.

And click the execute button. By this, we would get it confirmed that our BAPI is working properly. We can even check it by passing different values again.

Come back to the input and execution screen. We are now done with the creation and successful execution of a BAPI. ABAP Development. Browse pages.



0コメント

  • 1000 / 1000