0% found this document useful (0 votes)
328 views

Generate Bapi ALE Interface

This document discusses how to create a custom BAPI and generate an ALE interface for it. BAPIs are integrated with ALE and use ALE services for asynchronous communication between distributed SAP systems. The document provides a step-by-step guide to creating a BAPI, generating the required IDoc type, and establishing the ALE interface to enable communication between systems using the custom BAPI.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
328 views

Generate Bapi ALE Interface

This document discusses how to create a custom BAPI and generate an ALE interface for it. BAPIs are integrated with ALE and use ALE services for asynchronous communication between distributed SAP systems. The document provides a step-by-step guide to creating a BAPI, generating the required IDoc type, and establishing the ALE interface to enable communication between systems using the custom BAPI.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 36

BAPI-ALE Interfaces Published On: July 19, 2008

BAPI-ALE INTERFACES

Summary:
This document talks about custom BAPI creation and generating the ALE interface
for the Custom BAPI.

BAPIs are integrated into the ALE communication model. 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.0 BAPIs are the standardized interfaces for ALE-supported
communication. ALE services, such as asynchronous BAPI calls, distribution model,
monitoring and error handling can be used for BAPIs. The IDoc types required for the
ALE services can be generated from BAPIs.

Author(s): Izhar Khan


Company: Deloitte Consulting India Pvt Ltd

Izhar Khan is working as SAP Netweaver Consultant with Deloitte Consulting India Pvt
Ltd. His key areas are ABAP, XI & ALE.

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

TABLE OF CONTENT
1.0 Introduction............................................................................................................... 3
1.1 Concept ................................................................................................................. 3
1.2 Mini requirement for the creation of a BAPI........................................................ 4
2.0 Step by Step BAPI-ALE Interface creation .............................................................. 5

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

1.0 Introduction

This document talks about custom BAPI creation and generating the ALE interface
for the Custom BAPI.

BAPIs are integrated into the ALE communication model. 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.0 BAPIs are the standardized interfaces for ALE-supported
communication. ALE services, such as asynchronous BAPI calls, distribution model,
monitoring and error handling can be used for BAPIs. The IDoc types required for the ALE
services can be generated from BAPIs.

1.1 Concept
Below Object stack shows flow of message from source system to target system.
Object Stack:
o/b – outbound
i/b – inbound

Once ALE-BAPI interface is created, below objects will get generated.


1. Inbound function module
2. Outbound function module
3. Custom IDoc type
4. Custom message type

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

5. Custom IDoc segments

ALE-BAPI interface is used to push IDoc from one SAP system to another SAP
system. IDoc transmission can be triggered in two ways.
1. Via some object event
a. When any Object event is triggered, transaction data is passing to
BAPI-ALE outbound function module which will in turn generate
corresponding IDoc. This IDoc will then get transmitted to
corresponding target system via tRFC based on Partner profile setting.
b. On receiver side, it will be received by BAPI-ALE inbound function
module based on partner profile settings. Inbound function module
will convert this IDoc data into structures/tables of BAPI and the
BAPI in turn shall implement the required Business logic.
2. Explicitly calling BAPI-ALE outbound function module.
a. One can directly call BAPI-ALE outbound function module by passing
all required structure/tables data. BAPI-ALE outbound function
module which will in turn generate corresponding IDoc. This IDoc
will then get transmitted to corresponding target system via tRFC
using Partner profile setting.
b. On receiver side, it will be received by BAPI-ALE inbound function
module based on partner profile settings. Inbound function module
will convert this IDoc data into structures/tables of BAPI and the
BAPI in turn shall implement the required Business logic

Notice the inbound process flow exits during the inbound function module. Above
inbound function module sits a BAPI and supporting Business object. They are
required for the generation of the BAPI-ALE interface objects, but are not utilized
during the processing of the inbound IDoc.

1.2 Mini requirement for the creation of a BAPI


1. Do not use “type” for parameters. Use “like”
2. Import parameters must be passed in as “value”
3. Must had “Return” parameter
4. Must be “RFC enabled”
Note:
 For full BAPI compliance, check the “BAPI Project” in the “BAPI
Explorer” - BAPI
 If Filter Objects are to be used, parameters must be passed as tables (i.e.
multi-line in BAPI parameters.

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

2.0 Step by Step BAPI-ALE Interface creation


1. Analyze the fields that require filling in the IDOC segment. Create a dictionary
structure for the same fields. Follow the naming standard as
ZBAPI_<FRICEID>_<DESC>

2. In this scenario structure looks as below.

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

3. Create function group. Follow naming standard as Z<APPLICATION


AREAS><FRICE ID>

4. Save and assign to a package and request.

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

5. Create Function module .Follow naming standard as Z_BAPI_<FRICEID>_<DESC>

6. Supply function group that was created already.

7. Select Processing type as “Remote-Enabled-Module” as shown in screen shot.

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

8. Go to TABLE tab pass the structure that was created at first (point: 1) and assign a
parameters name.

9. BAPI returns the value. Go to EXPORT tab and pass BAPIRETURN as shown below.

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

10 .Save and activate. Release it as shown below. In the status bar you can see the
message.

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

11. Go to T.code SWO1 and create object. Follow naming standard as


Z<APPLICATION AREA><FRICEID>

12. Assign values to the fields as shown below and continue.

13. Object ZMINT207 was created as shown.

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

14. Select on the key fields as shown and select create button on the tool bar.

15. A pop up message will display as shown. Select YES.

16. Pass the dictionary table i.e. as to your scenario and select the key field and continue.

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

17. If you want you can change the names & description and then select create button.

18. It added key field (Order) to the node key fields.

19. Add method: To add methods go to menu Utilities->API methods->Add Method

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

20 Then it will request for function module name. Supply BAPI that was created earlier
(Ref STEP-5) and continue.

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

21. Then by default it will has a method, name, description. We can change these names
if required .Click on the continue arrow as shown.

22. Again continue the screen as shown

23. It displays a pop up window. Select YES.

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

24. It inserted a method under methods node and message can see in the status bar.

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

25. Implement the object type as shown.

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

26. After implemented the object type. Message can see in the status bar.

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

27. Release the object type shown below.

28. Continue the information message

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

29. Continue the information message

30. Released message can see in the status bar.

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

31. Implement the object type component as shown below.

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

32. Implemented status can see in the status bar.

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

31. Release object type component as shown below.

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

32. Release status can see in the status bar.

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

33. Finally generate it.

34. Generated status can see in the status bar. As shown below.

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

35. Go to T.code BAPI .Select tab ALPHABETIC. Check for your object name which
was created in the STEP: 12.

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

36. Expand the object name and select method .In the right hand side observes the ALE
message type – “does not exit”. Click on.

37. Generate a new ALE interface for BAPI .To do this click on the create button as
shown.

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

38. By default it shown the message type with certain name. Continue.

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

39. A pop up interface parameter screen appears .By default it has certain names.
Continue

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

40. Check rounded check box as shown. Continue

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

41. Finally it generated an ALE interface for the BAPI. As shown below.

42. Click on the IDOC type as shown below

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

43. The screen shown as below.

44. Set release status for IDOC as shown.

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

45. A POP up message was displayed. Just click on the YES. It the status bar you can the
see the release message.

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

46. Click on the Segment type as shown below.

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

47. Set release status for segment as shown.

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

48. Once it was set to release. Release check was checked as shown below.

49. Finally by calling the BAPI we can trigger the IDOC.

SAP GEEKS CLUB http://sapgeeksclub.com


BAPI-ALE Interfaces Published On: July 19, 2008

Disclaimer:

Sapgeeksclub is determined to provide useful learning materials but it does not


hold liability or responsibility of any damage caused by using the code sample or
information provided in this document.

This document has been published based on Author’s understanding of the subject
and neither the author nor sapgeeksclub can be hold responsible for any disparity
in the information provided here and at any other source.

SAP GEEKS CLUB http://sapgeeksclub.com

You might also like