ABAP Proxy Generation - General Procedure
Use
This section outlines the general procedure for generating, regenerating, and deleting ABAP proxies with generation source ESR or external WSDL. Additional information for generating specific proxy types is provided in separate sections.
The procedure to generate ABAP proxies is essentially the same for each different type of proxy. There are two main steps:
-
Select the objects to be called or implemented.
-
Generate and activate the proxies.
Prerequisites
To work with ABAP proxies, you need the SAP_XI_DEVELOPER_ABAP role, which is included in the composite role SAP_XI_DEVELOPER. Use the profile generator (transaction PFCG) to assign roles.
Depending on the proxy type, the following tasks must be done before you generate a proxy:
-
All objects must be modeled in the ES Repository - or be made available as external WSDL descriptions.
Some objects in the ESR are combinations of other objects. For example, a service interface contains data types and message types. Therefore, a proxy (a Web service provider or a Web service consumer) can only be generated when all referenced types are generated as well. When a proxy that is modeled in the ES Repository is generated for an object that references another object in the same namespace, the proxy for the referenced object will be generated automatically. For example, a proxy could be generated for a service interface that references a specific data type. If a referenced object is in a different namespace, you need to generate the proxy for the referenced object separately.
When a proxy is generated from an external WSDL document, all of its objects are generated.
-
The package structure in the ABAP back-end system must be defined.
The package structure defines where the proxies will be created, where the service provider will be, and how the packages will fit into the overall application structure. Note that for proxies from external WSDLs, the package is part of the external name and objects that reference other objects use the external names for these references. If the package of some of these objects is changed after proxy generation, these references get lost. Therefore, the package should not be changed after proxy generation.
-
Prefixes for the ABAP objects can be defined.
When generating proxies, many different objects are created. All external objects have a rather long qualified name consisting of name and namespace. The ABAP objects only have a 30-character ABAP name. The ABAP name is derived from the external name (without namespace) and, if a prefix is set, it is set in front. Therefore, it is recommended that you define prefixes as they allow you to ensure that ABAP objects in the back-end system are assigned unique and consistent names and name collisions are avoided. In many ABAP projects, you need to use an ABAP namespace. You can define this using a prefix. Because of the reduction to 30 characters, it is possible that generated names are not descriptive. It is therefore recommended to check all generated names manually and adapt them accordingly.
Procedure
Generating a Proxy
You need to be working in the system in which you want to generate the proxy. Proxies are generated in the ABAP back-end system, in which the object will subsequently be provided.
-
Start the Enterprise Service Browser.
Use transaction code SPROXY.
-
Select an object. In the Enterprise Service Browser, you can locate an object according to different criteria, such as the generation source, the package, or the object type.
-
To generate the proxy, open the context menu and choose Create proxy.
-
Specify a package and a prefix, and choose Enter.
Valid ABAP names are proposed. You can change the proposed names as required.
The prefix you specified is displayed as part of the ABAP name in the Properties tab and also in the Structure tab.
-
Activate the proxy.
The ABAP objects, such as DDIC types, classes, and interfaces, are created or changed only when the proxies are activated. When generating, regenerating, and editing, or saving the proxies, the ABAP objects are not touched. When saving a proxy, an inactive version of the metadata is created. To change the ABAP objects that are used at runtime, an active version is necessary.
-
Release the transport request.
Note that the proxy (SPRX object) and the generates (CLAS, INTF, TAB, DTEL) are transported together.
-
Create a runtime configuration for the proxies.
In the system that consumes the Web service, create a logical port for the Web service consumer. In the provider system, create an endpoint for the service definition. For more information, see Configuring Web Services in SOA Manager.
Generating Proxies with Industry-Specific Enhancements
To activate industry classifications, you need to select an industry when you generate proxies for Web services delivered with an Enhancement Package. Perform the following steps:
-
Log on to the back-end system in English.
-
Start transaction SM30.
-
Choose the SVW_INDUSTRY view.
-
Select your industries.
Regenerating a Proxy
If an object is changed in the Enterprise Services Repository (ES Repository) after it has been generated, the changes will not automatically be reflected in the proxy in the ABAP back-end system. If an object in the ES Repository is changed, you will need to regenerate the corresponding proxy manually.
-
In the Enterprise Services Repository Browser, locate the object whose proxy you want to regenerate.
-
Open the context menu and choose Regenerate proxy
This function will only be available if a proxy has already been generated.
Only the proxy interfaces, datatypes, and classes will be overwritten. ABAP names and types will remain intact if possible. If, for example, a datatype has been changed in a way that its ABAP type is no longer valid, it is adapted.
-
Reactivate the proxy.
From the context menu, choose Activate Proxy.
You can choose between the options Activate, Activate Main, and Activate All, depending on wheter you want the underlying objects to be activated as well.
Deleting a Proxy
-
In the ES Repository Browser, select an object.
-
From the menu, choose .
Result
When proxy objects are activated, one or more of the following ABAP objects are created:
-
ABAP Dictionary types
ABAP Dictionary types represent the global data types in the ES Repository. The system also generates the data types that will be used as method parameters.
-
ABAP interface
An ABAP interface comprises interface types and constants.
-
A template of an ABAP class (proxy class or implementing class) for provider or consumer proxies, if not already existent
You have to manually adapt and activate ths template. If you want to create a new one, you have to delete the implementing class or change its name.
The ABAP class of a service provider contains the implementation of the service provider methods, and uses an ABAP interface. A service provider class has one method for each operation modeled in the ES Repository. For a proxy to be used by an application, the methods will need to be filled with application coding.

